Skip to content

fix: reject json response mime with function calling#5749

Open
he-yufeng wants to merge 2 commits into
google:mainfrom
he-yufeng:fix/reject-json-mime-function-calling
Open

fix: reject json response mime with function calling#5749
he-yufeng wants to merge 2 commits into
google:mainfrom
he-yufeng:fix/reject-json-mime-function-calling

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • reject response_mime_type="application/json" when an agent has tools and function calling is enabled
  • keep the reported working path (function_calling_config.mode="NONE") allowed
  • add regression coverage for AUTO, ANY, implicit function calling, and NONE

Fixes #5735.

Validation

  • .\.venv\Scripts\python.exe -m pytest tests\unittests\agents\test_llm_agent_fields.py -q -k "json_response_with_function_calling or validate_generate_content_config"
  • .\.venv\Scripts\python.exe -m pytest tests\unittests\flows\llm_flows\test_basic_processor.py tests\unittests\flows\llm_flows\test_output_schema_processor.py -q
  • .\.venv\Scripts\pyink.exe --check src\google\adk\agents\llm_agent.py tests\unittests\agents\test_llm_agent_fields.py
  • git diff --check

Note: direct single-file mypy src/google/adk/agents/llm_agent.py still reports existing strict typing issues elsewhere in that file, outside this change.

@rohityan rohityan self-assigned this May 19, 2026
@he-yufeng he-yufeng force-pushed the fix/reject-json-mime-function-calling branch from 51bd3da to 79ac418 Compare May 20, 2026 05:16
@he-yufeng
Copy link
Copy Markdown
Author

Refreshed on current main. Local validation after the refresh: targeted agent-field tests passed (8 passed / 37 deselected), the related llm_flow processor tests passed (19 passed), pyink --check, py_compile, and git diff --check all passed. I installed the missing local �nthropic test dependency in the clean-clone venv; no project files changed for that.

@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label May 20, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @he-yufeng , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing tests before we can proceed with the review.

@rohityan rohityan added the core [Component] This issue is related to the core interface and implementation label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

responseMimeType.application/json is incompatible with function-calling modes in ADK agent config

2 participants