sahil239 commited on
Commit
521cf23
·
verified ·
1 Parent(s): 5548077

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -6
main.py CHANGED
@@ -71,13 +71,12 @@ app.add_middleware(
71
  class ChatRequest(BaseModel):
72
  prompt: str
73
 
 
 
 
 
 
74
  @app.get("/", response_class=HTMLResponse)
75
  async def homepage():
76
  html_path = Path(__file__).parent / "index.html"
77
  return HTMLResponse(content=html_path.read_text(), status_code=200)
78
-
79
-
80
- @app.post("/chat")
81
- def chat_endpoint(req: ChatRequest):
82
- reply = generate_response(req.prompt)
83
- return {"response": reply}
 
71
  class ChatRequest(BaseModel):
72
  prompt: str
73
 
74
+ @app.post("/chat")
75
+ def chat_endpoint(req: ChatRequest):
76
+ reply = generate_response(req.prompt)
77
+ return {"response": reply}
78
+
79
  @app.get("/", response_class=HTMLResponse)
80
  async def homepage():
81
  html_path = Path(__file__).parent / "index.html"
82
  return HTMLResponse(content=html_path.read_text(), status_code=200)