Spaces:
Sleeping
Sleeping
anhdt-dsai-02
commited on
Commit
•
53498dd
1
Parent(s):
f195c77
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ from gemini import complete_gemini_async
|
|
9 |
class Data(BaseModel):
|
10 |
prompt: str
|
11 |
key: str
|
|
|
12 |
|
13 |
app = FastAPI()
|
14 |
origins = ["*"]
|
@@ -22,7 +23,7 @@ app.add_middleware(
|
|
22 |
@app.post("/gemini_gate")
|
23 |
async def gate(data: Data):
|
24 |
try:
|
25 |
-
result = await complete_gemini_async(data.prompt, data.key)
|
26 |
return result
|
27 |
except Exception as e:
|
28 |
raise HTTPException(status_code=500, detail="An error occurred: {}".format(traceback.format_exc()))
|
|
|
9 |
class Data(BaseModel):
|
10 |
prompt: str
|
11 |
key: str
|
12 |
+
params : dict
|
13 |
|
14 |
app = FastAPI()
|
15 |
origins = ["*"]
|
|
|
23 |
@app.post("/gemini_gate")
|
24 |
async def gate(data: Data):
|
25 |
try:
|
26 |
+
result = await complete_gemini_async(data.prompt, data.key, data.params)
|
27 |
return result
|
28 |
except Exception as e:
|
29 |
raise HTTPException(status_code=500, detail="An error occurred: {}".format(traceback.format_exc()))
|