dmar1313 commited on
Commit
58abd1e
1 Parent(s): 994fe63

Create fastAPI.py

Browse files
Files changed (1) hide show
  1. fastAPI.py +12 -0
fastAPI.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from pydantic import BaseModel
3
+
4
+ app = FastAPI()
5
+
6
+ class Prompt(BaseModel):
7
+ text: str
8
+
9
+ @app.post("/chat")
10
+ async def chat(prompt: Prompt):
11
+ response = generate_response(prompt.text)
12
+ return {"response": response}