File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,13 @@ def extraction_tool(
222222 When you call this tool it overwrites the previous extraction, if you want to expand the extraction use jsonpatch.
223223 This tool needs to be Successfully invoked before the patch tool can be used."""
224224
225- logger .info ("extraction_tool called" , extra = {"models_extraction" : extraction })
226225 # Note: The @tool decorator passes data as a dict, not as a model instance
227226 # We need to validate it manually using the Pydantic model
228227 extraction_model = model_class .model_validate (extraction ) # pyright: ignore[reportAssignmentType]
229228 extraction_dict = extraction_model .model_dump (mode = "json" )
229+ logger .info (
230+ "extraction_tool called" , extra = {"models_extraction" : extraction_dict }
231+ )
230232 agent .state .set (key = "current_extraction" , value = extraction_dict )
231233 logger .debug (
232234 "Successfully stored extraction in state" ,
@@ -863,7 +865,9 @@ async def structured_output_async(
863865 state = {
864866 "current_extraction" : None ,
865867 "images" : {},
866- "existing_data" : existing_data .model_dump () if existing_data else None ,
868+ "existing_data" : existing_data .model_dump (mode = "json" )
869+ if existing_data
870+ else None ,
867871 "extraction_schema_json" : schema_json , # Store for schema reminder tool
868872 },
869873 conversation_manager = SummarizingConversationManager (
Original file line number Diff line number Diff line change @@ -927,7 +927,7 @@ def _invoke_extraction_model(
927927 context = "Extraction" ,
928928 )
929929
930- extracted_fields = structured_data .model_dump ()
930+ extracted_fields = structured_data .model_dump (mode = "json" )
931931 metering = response_with_metering ["metering" ]
932932 parsing_succeeded = True
933933 else :
You can’t perform that action at this time.
0 commit comments