Commit ·
6a843ee
1
Parent(s): 488d5ee
fixed nonstreaming
Browse files798 unmodified lines799800801802803804805806798 unmodified linesgoogle_api_response = resp.json()# The actual response is nested under the "response" keystandard_gemini_response = google_api_response.get("response")# The standard client expects a list containing the response objectreturn Response(content=json.dumps([standard_gemini_response]), status_code=200, media_type="application/json")except (json.JSONDecodeError, AttributeError) as e:print(f"Error converting to standard Gemini format: {e}")# Fallback to sending the original content if conversion fails798 unmodified lines799800801802803804805806798 unmodified linesgoogle_api_response = resp.json()# The actual response is nested under the "response" keystandard_gemini_response = google_api_response.get("response")# Return the response object directly, not wrapped in a listreturn Response(content=json.dumps(standard_gemini_response), status_code=200, media_type="application/json")except (json.JSONDecodeError, AttributeError) as e:print(f"Error converting to standard Gemini format: {e}")# Fallback to sending the original content if conversion fails
gemini_proxy.py+2-2