@@ -117,7 +117,7 @@ def _extract_code_from_error_message(
117117 return None
118118
119119
120- def _maybe_recover_from_api_rejection (llm_response ) -> bool :
120+ def _maybe_recover_from_api_rejection (llm_response : LlmResponse ) -> bool :
121121 """Recovers an executable_code part from a Gemini 2.x API rejection.
122122
123123 When ADK uses a non-built-in code executor (e.g.,
@@ -199,7 +199,7 @@ def explore_df(df: pd.DataFrame) -> None:
199199'''
200200
201201
202- class _CodeExecutionRequestProcessor (BaseLlmRequestProcessor ):
202+ class _CodeExecutionRequestProcessor (BaseLlmRequestProcessor ): # type: ignore[misc]
203203 """Processes code execution requests."""
204204
205205 @override
@@ -233,7 +233,7 @@ async def run_async(
233233request_processor = _CodeExecutionRequestProcessor ()
234234
235235
236- class _CodeExecutionResponseProcessor (BaseLlmResponseProcessor ):
236+ class _CodeExecutionResponseProcessor (BaseLlmResponseProcessor ): # type: ignore[misc]
237237 """Processes code execution responses."""
238238
239239 @override
@@ -357,7 +357,7 @@ async def _run_pre_processor(
357357
358358async def _run_post_processor (
359359 invocation_context : InvocationContext ,
360- llm_response ,
360+ llm_response : LlmResponse ,
361361) -> AsyncGenerator [Event , None ]:
362362 """Post-process the model response by extracting and executing the first code block."""
363363 agent = invocation_context .agent
@@ -482,7 +482,7 @@ def _extract_and_replace_inline_files(
482482 llm_request : LlmRequest ,
483483) -> list [File ]:
484484 """Extracts and replaces inline files with file names in the LLM request."""
485- all_input_files = code_executor_context .get_input_files ()
485+ all_input_files : list [ File ] = code_executor_context .get_input_files ()
486486 saved_file_names = set (f .name for f in all_input_files )
487487
488488 # [Step 1] Process input files from LlmRequest and cache them in CodeExecutor.
@@ -531,7 +531,7 @@ def _get_or_set_execution_id(
531531 if not invocation_context .agent .code_executor .stateful :
532532 return None
533533
534- execution_id = code_executor_context .get_execution_id ()
534+ execution_id : Optional [ str ] = code_executor_context .get_execution_id ()
535535 if not execution_id :
536536 execution_id = invocation_context .session .id
537537 code_executor_context .set_execution_id (execution_id )
@@ -623,7 +623,7 @@ def _get_normalized_file_name(file_name: str) -> str:
623623 return var_name
624624
625625 if file .mime_type not in _DATA_FILE_UTIL_MAP :
626- return
626+ return None
627627
628628 var_name = _get_normalized_file_name (file .name )
629629 loader_code = _DATA_FILE_UTIL_MAP [file .mime_type ].loader_code_template .format (
0 commit comments