Skip to content

Commit a52aba8

Browse files
committed
fix: use 'user' as author for synthetic function response event
Address code review feedback: synthetic error responses for orphaned function calls should consistently use 'user' as the author field, matching the role='user' already set in the content.
1 parent f68c225 commit a52aba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ async def run_async(
7979
request_processor = _ContentLlmRequestProcessor()
8080

8181

82-
8382
def _create_synthetic_response_for_orphaned_calls(
8483
event: Event,
8584
orphaned_calls: list[types.FunctionCall],
@@ -104,11 +103,12 @@ def _create_synthetic_response_for_orphaned_calls(
104103

105104
return Event(
106105
invocation_id=event.invocation_id,
107-
author=event.author,
106+
author='user',
108107
content=types.Content(role='user', parts=parts),
109108
branch=event.branch,
110109
)
111110

111+
112112
def _rearrange_events_for_async_function_responses_in_history(
113113
events: list[Event],
114114
heal_orphaned_calls: bool = False,

0 commit comments

Comments
 (0)