V1oris commited on
Commit
dbb5c2c
·
verified ·
1 Parent(s): 8b7c183

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI, File, UploadFile, Form
2
+ from fastapi.middleware.cors import CORSMiddleware
3
+
4
+ app = FastAPI()
5
+
6
+ app.add_middleware(
7
+ CORSMiddleware,
8
+ allow_origins=["*"],
9
+ allow_methods=["*"],
10
+ allow_headers=["*"],
11
+ )
12
+
13
+ @app.get("/")
14
+ def root():
15
+ return {"status": "ok"}
16
+
17
+ @app.post("/v1/chat")
18
+ async def chat(
19
+ text: str = Form(""),
20
+ image: UploadFile = File(None),
21
+ audio: UploadFile = File(None),
22
+ video: UploadFile = File(None),
23
+ ):
24
+ # Your AI logic here
25
+ return {"reply": f"You said: {text}"}