From 295b34558774d1f64022009980e3edd8eb79527b Mon Sep 17 00:00:00 2001 From: Shangjie Chen Date: Wed, 21 Jan 2026 16:55:30 -0800 Subject: [PATCH] chore: Filter out `adk_request_input` event from content list Co-authored-by: Shangjie Chen PiperOrigin-RevId: 859321034 --- src/google/adk/flows/llm_flows/contents.py | 7 +++++++ src/google/adk/flows/llm_flows/functions.py | 1 + 2 files changed, 8 insertions(+) diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index 046a443a..0a17ade6 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -29,6 +29,7 @@ from ._base_llm_processor import BaseLlmRequestProcessor from .functions import remove_client_function_call_id from .functions import REQUEST_CONFIRMATION_FUNCTION_CALL_NAME from .functions import REQUEST_EUC_FUNCTION_CALL_NAME +from .functions import REQUEST_INPUT_FUNCTION_CALL_NAME logger = logging.getLogger('google_adk.' + __name__) @@ -280,6 +281,7 @@ def _should_include_event_in_context( or _is_adk_framework_event(event) or _is_auth_event(event) or _is_request_confirmation_event(event) + or _is_request_input_event(event) ) @@ -675,6 +677,11 @@ def _is_adk_framework_event(event: Event) -> bool: return _is_function_call_event(event, 'adk_framework') +def _is_request_input_event(event: Event) -> bool: + """Checks if the event is a request input event.""" + return _is_function_call_event(event, REQUEST_INPUT_FUNCTION_CALL_NAME) + + def _is_live_model_audio_event_with_inline_data(event: Event) -> bool: """Check if the event is a live/bidi audio event with inline data. diff --git a/src/google/adk/flows/llm_flows/functions.py b/src/google/adk/flows/llm_flows/functions.py index ec1cd230..6e512ae8 100644 --- a/src/google/adk/flows/llm_flows/functions.py +++ b/src/google/adk/flows/llm_flows/functions.py @@ -49,6 +49,7 @@ if TYPE_CHECKING: AF_FUNCTION_CALL_ID_PREFIX = 'adk-' REQUEST_EUC_FUNCTION_CALL_NAME = 'adk_request_credential' REQUEST_CONFIRMATION_FUNCTION_CALL_NAME = 'adk_request_confirmation' +REQUEST_INPUT_FUNCTION_CALL_NAME = 'adk_request_input' logger = logging.getLogger('google_adk.' + __name__)