reverted to an earlier version
This commit is contained in:
@@ -140,17 +140,13 @@ async def gemini_chat(
|
||||
db.commit()
|
||||
|
||||
except Exception as e:
|
||||
import json
|
||||
error_data = {"status": "error", "detail": str(e)}
|
||||
return PlainTextResponse(content=json.dumps(error_data), media_type="text/plain")
|
||||
return {"status": "error", "detail": str(e)}
|
||||
|
||||
|
||||
# Final Response
|
||||
import json
|
||||
response_data = {
|
||||
return {
|
||||
"status": "success",
|
||||
"model": "gemini",
|
||||
"response": response.text
|
||||
}
|
||||
# We return PlainTextResponse to disguise the JSON from corporate firewalls
|
||||
from fastapi.responses import JSONResponse, FileResponse, PlainTextResponse
|
||||
return PlainTextResponse(content=json.dumps(response_data), media_type="text/plain")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user