diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index fefa014c..39902e85 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -270,6 +270,7 @@ def _should_include_event_in_context( return not ( _contains_empty_content(event) or not _is_event_belongs_to_branch(current_branch, event) + or _is_adk_framework_event(event) or _is_auth_event(event) or _is_request_confirmation_event(event) ) @@ -656,6 +657,11 @@ def _is_request_confirmation_event(event: Event) -> bool: return _is_function_call_event(event, REQUEST_CONFIRMATION_FUNCTION_CALL_NAME) +def _is_adk_framework_event(event: Event) -> bool: + """Checks if the event is an ADK framework event.""" + return _is_function_call_event(event, 'adk_framework') + + 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.