Update app/main.py
Browse files1286 unmodified lines128712881289129012911292129312944 unmodified lines12991300130113021303130413051286 unmodified linesdef is_response_valid(response):"""Checks if the Gemini response contains valid, non-empty text content."""# Print the response structure for debuggingprint(f"DEBUG: Response type: {type(response)}")print(f"DEBUG: Response attributes: {dir(response)}")if response is None:print("DEBUG: Response is None")4 unmodified lines# First, try to get text directly from the responseif hasattr(response, 'text') and response.text:print(f"DEBUG: Found text directly on response: {response.text[:50]}...")return True# Check if candidates exist1286 unmodified lines128712881289129012911292129312944 unmodified lines12991300130113021303130413051286 unmodified linesdef is_response_valid(response):"""Checks if the Gemini response contains valid, non-empty text content."""# Print the response structure for debugging# print(f"DEBUG: Response type: {type(response)}")# print(f"DEBUG: Response attributes: {dir(response)}")if response is None:print("DEBUG: Response is None")4 unmodified lines# First, try to get text directly from the responseif hasattr(response, 'text') and response.text:# print(f"DEBUG: Found text directly on response: {response.text[:50]}...")return True# Check if candidates exist
app/main.py+3-3