File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/google/adk/flows/llm_flows
tests/unittests/flows/llm_flows Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,11 @@ def create_final_model_response_event(
7878 from google .genai import types
7979
8080 # Create a proper model response event
81- final_event = Event (author = invocation_context .agent .name )
81+ final_event = Event (
82+ author = invocation_context .agent .name ,
83+ invocation_id = invocation_context .invocation_id ,
84+ branch = invocation_context .branch ,
85+ )
8286 final_event .content = types .Content (
8387 role = 'model' , parts = [types .Part (text = json_response )]
8488 )
Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ async def test_output_schema_helper_functions():
230230 # Test create_final_model_response_event function
231231 final_event = create_final_model_response_event (invocation_context , test_json )
232232 assert final_event .author == 'test_agent'
233+ assert final_event .invocation_id == invocation_context .invocation_id
234+ assert final_event .branch == invocation_context .branch
233235 assert final_event .content .role == 'model'
234236 assert final_event .content .parts [0 ].text == test_json
235237
@@ -348,6 +350,8 @@ async def test_flow_yields_both_events_for_set_model_response():
348350 # Second event should be the final model response with JSON
349351 second_event = events [1 ]
350352 assert second_event .author == 'test_agent'
353+ assert second_event .invocation_id == invocation_context .invocation_id
354+ assert second_event .branch == invocation_context .branch
351355 assert second_event .content .role == 'model'
352356 assert (
353357 second_event .content .parts [0 ].text
You can’t perform that action at this time.
0 commit comments