Ok2 / app.py
THED1's picture
Update app.py
bb5c0de verified
Raw
History Blame Contribute Delete
427 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class ChatRequest(BaseModel):
prompt: str
@app.get("/")
def root():
return {
"status": "running",
"message": "Space is working"
}
@app.get("/health")
def health():
return {
"healthy": True
}
@app.post("/chat")
def chat(req: ChatRequest):
return {
"reply": f"You said: {req.prompt}"
}