From f3d6fcf44411d07169c14ae12189543f44f96c27 Mon Sep 17 00:00:00 2001 From: Hangfei Lin Date: Thu, 6 Nov 2025 12:19:59 -0800 Subject: [PATCH] chore: Add debug logging for missing function call events This change adds a debug log statement to output the function response IDs and the event list when a matching function call event is not found, which helps in debugging. Co-authored-by: Hangfei Lin PiperOrigin-RevId: 829059186 --- src/google/adk/flows/llm_flows/contents.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index 797bad4d..75f5ae8d 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -15,6 +15,7 @@ from __future__ import annotations import copy +import logging from typing import AsyncGenerator from typing import Optional @@ -29,6 +30,8 @@ from .functions import remove_client_function_call_id from .functions import REQUEST_CONFIRMATION_FUNCTION_CALL_NAME from .functions import REQUEST_EUC_FUNCTION_CALL_NAME +logger = logging.getLogger('google_adk.' + __name__) + class _ContentLlmRequestProcessor(BaseLlmRequestProcessor): """Builds the contents for the LLM request.""" @@ -183,6 +186,12 @@ def _rearrange_events_for_latest_function_response( break if function_call_event_idx == -1: + logger.debug( + 'No function call event found for function responses ids: %s in' + ' event list: %s', + function_responses_ids, + events, + ) raise ValueError( 'No function call event found for function responses ids:' f' {function_responses_ids}'