diff --git a/defog_utils/utils_llm.py b/defog_utils/utils_llm.py index aacca21..71ccb5b 100644 --- a/defog_utils/utils_llm.py +++ b/defog_utils/utils_llm.py @@ -432,7 +432,7 @@ def chat_gemini( if response_format: # convert the content into Pydantic class - content = response_format.parse_raw(content) + content = response_format.model_validate_json(content) return LLMResponse( model=model, @@ -494,7 +494,7 @@ async def chat_gemini_async( if response_format: # convert the content into Pydantic class - content = response_format.parse_raw(content) + content = response_format.model_validate_json(content) return LLMResponse( model=model,