Spaces:
Build error
Build error
Update chat.py
Browse files340 unmodified lines341342343344345346347348349350351340 unmodified lines# Try to parse the response as JSONtry:# Find the JSON-like section and load itstart_index = response_content.find("{")json_part = response_content[start_index:] # Extract starting from the first '{'structured_data = json.loads(json_part) # Parse the JSON partprint("Parsed JSON:", structured_data)except (json.JSONDecodeError, ValueError) as e:print(f"Error: {e}")340 unmodified lines341342343344345346347348349350351340 unmodified lines# Try to parse the response as JSONtry:# Find the JSON-like section and load itstart_index = response_content.find("{")json_part = response_content[start_index:] # Extract starting from the first '{'structured_data = json.loads(json_part) # Parse the JSON partprint("Parsed JSON:", structured_data)except (json.JSONDecodeError, ValueError) as e:print(f"Error: {e}")
chat.py+5-5