File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1079,15 +1079,16 @@ def _extract_text_from_content(
10791079
10801080 text_fragments : list [str ] = []
10811081 for part in content :
1082- if part .type == "input_text" :
1082+ part_type = getattr (part , "type" , None )
1083+ if part_type == "input_text" :
10831084 input_text_part = cast (InputTextPart , part )
10841085 if input_text_part .text :
10851086 text_fragments .append (input_text_part .text .strip ())
1086- elif part . type == "output_text" :
1087+ elif part_type == "output_text" :
10871088 output_text_part = cast (OutputTextPart , part )
10881089 if output_text_part .text :
10891090 text_fragments .append (output_text_part .text .strip ())
1090- elif part . type == "refusal" :
1091+ elif part_type == "refusal" :
10911092 refusal_part = cast (ContentPartRefusal , part )
10921093 if refusal_part .refusal :
10931094 text_fragments .append (refusal_part .refusal .strip ())
You can’t perform that action at this time.
0 commit comments