| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| app = FastAPI() | |
| class ChatRequest(BaseModel): | |
| prompt: str | |
| def root(): | |
| return { | |
| "status": "running", | |
| "message": "Space is working" | |
| } | |
| def health(): | |
| return { | |
| "healthy": True | |
| } | |
| def chat(req: ChatRequest): | |
| return { | |
| "reply": f"You said: {req.prompt}" | |
| } |