File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -258,10 +258,13 @@ def _process_response(self, response):
258258 reasoning_contents = []
259259
260260 for output_item in response .output :
261- output_item_type = output_item .type
261+ output_item_type = output_item .type if hasattr ( output_item , "type" ) else output_item . get ( "type" )
262262 if output_item_type == "message" :
263- for content_item in output_item .content :
264- text_outputs .append (content_item .text )
263+ content = output_item .content if hasattr (output_item , "content" ) else output_item .get ("content" , [])
264+ for content_item in content :
265+ text_outputs .append (
266+ content_item .text if hasattr (content_item , "text" ) else content_item .get ("text" )
267+ )
265268 elif output_item_type == "function_call" :
266269 tool_calls .append (output_item .model_dump ())
267270 elif output_item_type == "reasoning" :
You can’t perform that action at this time.
0 commit comments