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

fix: skip automatic function calling code path and warning when tools are absent by adi-IL · Pull Request #2934 · googleapis/python-genai · GitHub

fix: skip automatic function calling code path and warning when tools are absent - #2934

Open
adi-IL wants to merge 3 commits into
googleapis:mainfrom
adi-IL:fix/afc-skip-when-no-callables
Open

adi-IL wants to merge 3 commits into
googleapis:mainfrom
adi-IL:fix/afc-skip-when-no-callables

Conversation

adi-IL commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #2902

Description

Direct calls to Models.generate_content, Models.generate_content_stream, and their async equivalents entered the automatic function calling loop and logged the AFC recommendation warning even when config was None or contained no callable tools.

Checking whether function_map is populated before entering the AFC routine in generate_content and generate_content_stream ensures that when no callables or MCP adapters are present, AFC is bypassed and _generate_content is invoked directly.

Verification

… are absent

Direct calls to Models.generate_content, generate_content_stream, and
their async equivalents entered the automatic function calling loop
and logged the AFC recommendation warning even when config was None
or contained no callable tools.

Check whether function_map is populated before entering the AFC
routine in generate_content and generate_content_stream. If no
callables or MCP adapters are present, bypass AFC and invoke
_generate_content directly.

Fixes googleapis#2902
Venkaiahbabuneelam self-assigned this Sep 3, 2026
Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Sep 3, 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.

generate_content and generate_content_stream show afc warning for empty config or config with empty tools

2 participants


Back | FazBrowse Home | New Git URL