Update app.py
Browse files
app.py
CHANGED
|
@@ -167,6 +167,15 @@ async def fast_ai(user: str, model: str = "llama3-70b", system: str = "Answer as
|
|
| 167 |
except Exception as e:
|
| 168 |
raise HTTPException(status_code=500, detail=f"Error during Snova AI request: {e}")
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
@app.get("/api/streaming-fastAI")
|
| 171 |
async def fast_ai(user: str, model: str = "llama3-8b", system: str = "Answer as concisely as possible."):
|
| 172 |
"""Get a streaming response from the Snova AI service."""
|
|
|
|
| 167 |
except Exception as e:
|
| 168 |
raise HTTPException(status_code=500, detail=f"Error during Snova AI request: {e}")
|
| 169 |
|
| 170 |
+
@app.post("/api/fastAI-post")
|
| 171 |
+
async def fast_ai(user: str, model: str = "llama3-70b", system: str = "Answer as concisely as possible."):
|
| 172 |
+
"""Get a response from the Snova AI service."""
|
| 173 |
+
try:
|
| 174 |
+
response = await asyncio.to_thread(fastai, user, model, system)
|
| 175 |
+
return JSONResponse(content={"response": response})
|
| 176 |
+
except Exception as e:
|
| 177 |
+
raise HTTPException(status_code=500, detail=f"Error during Snova AI request: {e}")
|
| 178 |
+
|
| 179 |
@app.get("/api/streaming-fastAI")
|
| 180 |
async def fast_ai(user: str, model: str = "llama3-8b", system: str = "Answer as concisely as possible."):
|
| 181 |
"""Get a streaming response from the Snova AI service."""
|