fix: patch gemini 2.5 pro (#1643)

Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
This commit is contained in:
Charles Packer
2025-04-09 18:35:53 -07:00
committed by GitHub
parent 8f5a43b886
commit ee8e095b69
5 changed files with 65 additions and 12 deletions

View File

@@ -828,7 +828,7 @@ def parse_json(string) -> dict:
raise ValueError(f"JSON from string input ({string}) is not a dictionary (type {type(result)}): {result}")
return result
except Exception as e:
print(f"Error parsing json with json package: {e}")
print(f"Error parsing json with json package, falling back to demjson: {e}")
try:
result = demjson.decode(string)
@@ -836,7 +836,7 @@ def parse_json(string) -> dict:
raise ValueError(f"JSON from string input ({string}) is not a dictionary (type {type(result)}): {result}")
return result
except demjson.JSONDecodeError as e:
print(f"Error parsing json with demjson package: {e}")
print(f"Error parsing json with demjson package (fatal): {e}")
raise e