Skip to content

fix(gemini): update default model to gemini-3.7-flash and function response role to user - #51

Merged
getdownandcode merged 2 commits into
mainfrom
fix/gemini-role-user-and-model-update
Oct 1, 2026
Merged

getdownandcode merged 2 commits into
mainfrom
fix/gemini-role-user-and-model-update

Conversation

@getdownandcode

Copy link
Copy Markdown
Owner

Summary

  • Upstream Google Gemini API in 2026 returns 404 for deprecated gemini-2.0-flash / gemini-2.5-flash models and rejects multi-turn function response content when role='tool' (returning 400 Invalid Argument: Role 'tool' is not supported. Please use a valid role: USER, MODEL).
  • Updates default model to gemini-3.7-flash across configuration, factory, adapter, docker compose, and .env.example.
  • Fixes Gemini function execution response content packaging to use role="user" with types.Part.from_function_response(...).
  • Updates unit tests to assert role and default model behavior.

Verification

  • ruff check . -> Passed
  • ruff format --check . -> Passed
  • mypy agentkit tests -> Passed
  • pytest -q -> 100% Passed (all unit and real infra tests pass)

Checklist

  • Type hints on all functions
  • Zero mock regressions
  • Pydantic models preserved
  • Tests pass

…esponse role to user

- Update default model to gemini-3.7-flash across settings, factory, adapter, and compose
- Change Gemini function response content role from 'tool' to 'user' per Gemini API specification
- Update unit tests for config, factory, and adapter to verify model and role

@getdownandcode getdownandcode left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Strict Peer Review:

  1. Correctness: Upstream Google Gemini API requires function response content in subsequent turns to be sent as role="user" with types.Part.from_function_response(...). The update matches this requirement cleanly.
  2. Model Availability: Upstream Gemini returns 404 for deprecated 2.0-flash / 2.5-flash endpoints; updated default model to gemini-3.7-flash across all config, factory, adapter, and compose files.
  3. Tests: Both mocked adapter unit tests and live real infrastructure integration tests pass cleanly.
  4. Code Quality: Types are strictly preserved, linting and formatting pass with 0 errors.

Approved for rebase-merge.

@getdownandcode
getdownandcode merged commit ac878b5 into main Oct 1, 2026
1 check passed
@getdownandcode
getdownandcode deleted the fix/gemini-role-user-and-model-update branch October 1, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant