Skip to content

fix: Echo function_call.id into AFC function responses - #3201

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1005076557
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1005076557

Conversation

@copybara-service

Copy link
Copy Markdown

fix: Echo function_call.id into AFC function responses

fixes #3192

@chrikrah chrikrah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closes #3192 as I reported it: the #3192 probe now sends call_1 and call_2 back on both paths. From my side it's ready to merge.

$ python -I afc_id_probe.py   # the #3192 script, google/genai/__init__.py from a 634d88f export, google-genai 2.32.0, CPython 3.12
generate_content [{"id": "call_1", "name": "get_weather", ...}, {"id": "call_2", "name": "get_weather", ...}]
generate_content_stream [{"id": "call_1", ...}, {"id": "call_2", ...}]
# _extra_utils.py from the parent adbc79c: both lines lose their "id" again
$ python -m pytest -q google/genai/tests/afc
125 passed, 4 errors   # 634d88f; the 4 are replay tests that need credentials
120 passed, 4 errors   # adbc79c
# _extra_utils.py from adbc79c, the new tests kept: 4 failed, 6 passed

Swapping Part.from_function_response for the constructor loses nothing, since the helper only forwards name, response and parts. Is the live API meant to pair responses by id from here on, as live.py:725 already requires?

@copybara-service
copybara-service Bot force-pushed the copybara/1005076557 branch 2 times, most recently from 18e3706 to f7b181c Compare November 5, 2026 10:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic function calling sends FunctionResponse without the function_call id, so parallel calls to one tool cannot be paired

2 participants