Skip to content

Commit f3d6fcf

Browse files
hangfeicopybara-github
authored andcommitted
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 <[email protected]> PiperOrigin-RevId: 829059186
1 parent dd706bd commit f3d6fcf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import annotations
1616

1717
import copy
18+
import logging
1819
from typing import AsyncGenerator
1920
from typing import Optional
2021

@@ -29,6 +30,8 @@
2930
from .functions import REQUEST_CONFIRMATION_FUNCTION_CALL_NAME
3031
from .functions import REQUEST_EUC_FUNCTION_CALL_NAME
3132

33+
logger = logging.getLogger('google_adk.' + __name__)
34+
3235

3336
class _ContentLlmRequestProcessor(BaseLlmRequestProcessor):
3437
"""Builds the contents for the LLM request."""
@@ -183,6 +186,12 @@ def _rearrange_events_for_latest_function_response(
183186
break
184187

185188
if function_call_event_idx == -1:
189+
logger.debug(
190+
'No function call event found for function responses ids: %s in'
191+
' event list: %s',
192+
function_responses_ids,
193+
events,
194+
)
186195
raise ValueError(
187196
'No function call event found for function responses ids:'
188197
f' {function_responses_ids}'

0 commit comments

Comments
 (0)