Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughGemini capability detection now resolves three version-less latest aliases to generation 2.5. This enables the corresponding tool, function-calling, Gemini 2.0, and automatic-thinking behavior. Tests cover these aliases and preserve Gemma behavior. ChangesGemini alias capabilities
Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
81eaf2e to
8fee803
Compare
The version-less aliases listed in GEMINI_MODELS (gemini-flash-latest, gemini-flash-lite-latest, gemini-pro-latest) never match the gemini-<version> regex in _normalize_gemini_fields, so they fell back to pre-1.5 defaults: supports_tools=False dropped tools from GenerateContentConfig entirely, supports_function_calling() returned False (silently downgrading agents to the ReAct protocol), structured output took the legacy path, and thinking was not auto-enabled. Resolve them through an explicit alias map in constants.py — same shape as the Anthropic fix in crewAIInc#4009 — instead of loosening the regex, which would mis-detect ids like gemini-gemma-2-27b-it (no function calling) by the digits in their names. Fixes crewAIInc#7636 Signed-off-by: Weijian He <230282609+Madin-H23@users.noreply.github.com>
8fee803 to
8f96fdb
Compare
|
CodeRabbit's out-of-scope warning was correct: this branch was cut from the working branch of #7587 and carried that commit. The branch is now rebased onto current |
Related issue
Fixes #7636
Summary
The version-less aliases listed in
GEMINI_MODELS(gemini-flash-latest,gemini-flash-lite-latest,gemini-pro-latest) never match thegemini-<version>regex in_normalize_gemini_fields, so they fell back to pre-1.5 defaults:supports_tools=Falsedropped tools fromGenerateContentConfigentirely,supports_function_calling()returnedFalse(silently downgrading agents to the ReAct protocol), structured output took the legacyresponse_schemapath, and thinking was not auto-enabled.Following the approach sketched in the issue (same shape as the Anthropic fix in #4009): a new
GEMINI_LATEST_ALIASESmap inllms/constants.py(next toGEMINI_MODELS) resolves the three aliases to the 2.5 generation when the version regex misses. The regex itself is untouched, so ids likegemini-gemma-2-27b-it— which carry a version but no function calling — keep the pre-1.5 defaults.Verification
pytest lib/crewai/tests/llms/google/test_google.py -n0→ all previously-passing tests still pass (the 9 pre-existing cassette-based failures reproduce identically on unpatchedmain); the new tests add 4 passes:supports_toolsisTrueandsupports_function_calling()isTruegemini-gemma-2-27b-itguard: stillsupports_tools == False— pins that the alias map doesn't loosen the regexmain(verified viagit stash)ruff check/ruff format --checkclean on all three files.Additional context
Out of scope per the issue:
gemini-robotics-er-1.5-previewand thegemini-live-*ids.