FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: warn about AFC with forced function calls by uuzzrm · Pull Request #2853 · googleapis/python-genai · GitHub

fix: warn about AFC with forced function calls - #2853

Open
uuzzrm wants to merge 3 commits into
googleapis:mainfrom
uuzzrm:codex/fix-afc-any-mode-warning
Open

uuzzrm wants to merge 3 commits into
googleapis:mainfrom
uuzzrm:codex/fix-afc-any-mode-warning

Conversation

uuzzrm commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • warn when FunctionCallingConfig.mode=ANY is used while automatic function calling is enabled
  • cover enabled, disabled, AUTO, and default AFC configuration paths

Why

ANY forces every model turn to produce a function call. When automatic function calling is also enabled, the SDK can consume the configured remote-call budget without producing a natural-language response. This remains a valid configuration for callers managing the loop themselves, so the SDK reports the interaction with a warning rather than rejecting the request.

Testing

  • uv run --no-project --with-requirements requirements.txt python -m pytest google/genai/tests/afc/test_raise_error_for_afc_incompatible_config.py -q
  • uv run --no-project --with-requirements requirements.txt python -m pytest google/genai/tests/afc -q --ignore=google/genai/tests/afc/test_generate_content_stream_afc_thoughts.py
  • python -m compileall on the changed modules
  • git diff --check

The full AFC directory also reached 116 passing tests; four existing replay-based streaming cases require Google credentials that are not available in this environment.

Fixes #2839

Venkaiahbabuneelam self-assigned this Aug 12, 2026
Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Aug 12, 2026

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool_config mode="ANY" with automatic function calling exhausts maximum_remote_calls and returns empty text, with no warning

2 participants


Back | FazBrowse Home | New Git URL