@@ -171,7 +171,7 @@ def extract_contents_text(contents):
171
171
172
172
# Content object with parts - recurse into parts
173
173
if getattr (contents , "parts" , None ):
174
- return extract_contents_text (contents .parts ) # type: ignore
174
+ return extract_contents_text (contents .parts )
175
175
176
176
# Direct text attribute
177
177
if hasattr (contents , "text" ):
@@ -229,13 +229,13 @@ def extract_tool_calls(response):
229
229
230
230
# Extract from candidates, sometimes tool calls are nested under the content.parts object
231
231
if getattr (response , "candidates" , []):
232
- for candidate in response .candidates : # type: ignore
232
+ for candidate in response .candidates :
233
233
if not hasattr (candidate , "content" ) or not getattr (
234
234
candidate .content , "parts" , []
235
235
):
236
236
continue
237
237
238
- for part in candidate .content .parts : # type: ignore
238
+ for part in candidate .content .parts :
239
239
if getattr (part , "function_call" , None ):
240
240
function_call = part .function_call
241
241
tool_call = {
@@ -245,7 +245,7 @@ def extract_tool_calls(response):
245
245
246
246
# Extract arguments if available
247
247
if getattr (function_call , "args" , None ):
248
- tool_call ["arguments" ] = safe_serialize (function_call .args ) # type: ignore
248
+ tool_call ["arguments" ] = safe_serialize (function_call .args )
249
249
250
250
tool_calls .append (tool_call )
251
251
0 commit comments