Skip to content

Commit 295b345

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Filter out adk_request_input event from content list
Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 859321034
1 parent b57a3d4 commit 295b345

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/google/adk/flows/llm_flows/contents.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from .functions import remove_client_function_call_id
3030
from .functions import REQUEST_CONFIRMATION_FUNCTION_CALL_NAME
3131
from .functions import REQUEST_EUC_FUNCTION_CALL_NAME
32+
from .functions import REQUEST_INPUT_FUNCTION_CALL_NAME
3233

3334
logger = logging.getLogger('google_adk.' + __name__)
3435

@@ -280,6 +281,7 @@ def _should_include_event_in_context(
280281
or _is_adk_framework_event(event)
281282
or _is_auth_event(event)
282283
or _is_request_confirmation_event(event)
284+
or _is_request_input_event(event)
283285
)
284286

285287

@@ -675,6 +677,11 @@ def _is_adk_framework_event(event: Event) -> bool:
675677
return _is_function_call_event(event, 'adk_framework')
676678

677679

680+
def _is_request_input_event(event: Event) -> bool:
681+
"""Checks if the event is a request input event."""
682+
return _is_function_call_event(event, REQUEST_INPUT_FUNCTION_CALL_NAME)
683+
684+
678685
def _is_live_model_audio_event_with_inline_data(event: Event) -> bool:
679686
"""Check if the event is a live/bidi audio event with inline data.
680687

src/google/adk/flows/llm_flows/functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
AF_FUNCTION_CALL_ID_PREFIX = 'adk-'
5050
REQUEST_EUC_FUNCTION_CALL_NAME = 'adk_request_credential'
5151
REQUEST_CONFIRMATION_FUNCTION_CALL_NAME = 'adk_request_confirmation'
52+
REQUEST_INPUT_FUNCTION_CALL_NAME = 'adk_request_input'
5253

5354
logger = logging.getLogger('google_adk.' + __name__)
5455

0 commit comments

Comments
 (0)