Spaces:
Paused
Paused
Commit
·
6a843ee
1
Parent(s):
488d5ee
fixed nonstreaming
Browse files- gemini_proxy.py +2 -2
gemini_proxy.py
CHANGED
|
@@ -799,8 +799,8 @@ async def proxy_request(request: Request, full_path: str, username: str = Depend
|
|
| 799 |
google_api_response = resp.json()
|
| 800 |
# The actual response is nested under the "response" key
|
| 801 |
standard_gemini_response = google_api_response.get("response")
|
| 802 |
-
#
|
| 803 |
-
return Response(content=json.dumps(
|
| 804 |
except (json.JSONDecodeError, AttributeError) as e:
|
| 805 |
print(f"Error converting to standard Gemini format: {e}")
|
| 806 |
# Fallback to sending the original content if conversion fails
|
|
|
|
| 799 |
google_api_response = resp.json()
|
| 800 |
# The actual response is nested under the "response" key
|
| 801 |
standard_gemini_response = google_api_response.get("response")
|
| 802 |
+
# Return the response object directly, not wrapped in a list
|
| 803 |
+
return Response(content=json.dumps(standard_gemini_response), status_code=200, media_type="application/json")
|
| 804 |
except (json.JSONDecodeError, AttributeError) as e:
|
| 805 |
print(f"Error converting to standard Gemini format: {e}")
|
| 806 |
# Fallback to sending the original content if conversion fails
|