THED1 commited on
Commit
bb5c0de
·
verified ·
1 Parent(s): 5f9bd59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -3,14 +3,28 @@ from pydantic import BaseModel
3
 
4
  app = FastAPI()
5
 
6
- class Request(BaseModel):
 
7
  prompt: str
8
 
9
- @app.post("/chat")
10
- def chat(req: Request):
11
 
12
- # Yahan tool-calling loop implement karna hoga
 
 
 
 
 
 
13
 
 
 
 
 
 
 
 
 
 
14
  return {
15
- "message": "agent response"
16
  }
 
3
 
4
  app = FastAPI()
5
 
6
+
7
+ class ChatRequest(BaseModel):
8
  prompt: str
9
 
 
 
10
 
11
+ @app.get("/")
12
+ def root():
13
+ return {
14
+ "status": "running",
15
+ "message": "Space is working"
16
+ }
17
+
18
 
19
+ @app.get("/health")
20
+ def health():
21
+ return {
22
+ "healthy": True
23
+ }
24
+
25
+
26
+ @app.post("/chat")
27
+ def chat(req: ChatRequest):
28
  return {
29
+ "reply": f"You said: {req.prompt}"
30
  }