Update app/main.py
Browse files- app/main.py +3 -3
app/main.py
CHANGED
@@ -1287,8 +1287,8 @@ async def chat_completions(request: OpenAIRequest, api_key: str = Depends(get_ap
|
|
1287 |
def is_response_valid(response):
|
1288 |
"""Checks if the Gemini response contains valid, non-empty text content."""
|
1289 |
# Print the response structure for debugging
|
1290 |
-
print(f"DEBUG: Response type: {type(response)}")
|
1291 |
-
print(f"DEBUG: Response attributes: {dir(response)}")
|
1292 |
|
1293 |
if response is None:
|
1294 |
print("DEBUG: Response is None")
|
@@ -1299,7 +1299,7 @@ def is_response_valid(response):
|
|
1299 |
|
1300 |
# First, try to get text directly from the response
|
1301 |
if hasattr(response, 'text') and response.text:
|
1302 |
-
print(f"DEBUG: Found text directly on response: {response.text[:50]}...")
|
1303 |
return True
|
1304 |
|
1305 |
# Check if candidates exist
|
|
|
1287 |
def is_response_valid(response):
|
1288 |
"""Checks if the Gemini response contains valid, non-empty text content."""
|
1289 |
# Print the response structure for debugging
|
1290 |
+
# print(f"DEBUG: Response type: {type(response)}")
|
1291 |
+
# print(f"DEBUG: Response attributes: {dir(response)}")
|
1292 |
|
1293 |
if response is None:
|
1294 |
print("DEBUG: Response is None")
|
|
|
1299 |
|
1300 |
# First, try to get text directly from the response
|
1301 |
if hasattr(response, 'text') and response.text:
|
1302 |
+
# print(f"DEBUG: Found text directly on response: {response.text[:50]}...")
|
1303 |
return True
|
1304 |
|
1305 |
# Check if candidates exist
|