feat: Add new Models to Google Gen AI#8372
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the """ WalkthroughThe Google Generative AI model metadata constants have been updated and reorganized. New "GEMINI 2.5" models and additional variants have been added, some models are now marked as preview or stable, and new categories like "EMBEDDING" and "AQA" are introduced. The list of model names is regenerated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant ConstantsModule
Developer->>ConstantsModule: Access GOOGLE_GENERATIVE_AI_MODELS_DETAILED
ConstantsModule-->>Developer: Provides updated model metadata (2.5, 2.0, 1.5, EMBEDDING, AQA, GEMMA)
Developer->>ConstantsModule: Access GOOGLE_GENERATIVE_AI_MODELS
ConstantsModule-->>Developer: Provides regenerated model names list
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Pull Request Overview
This PR restructures and expands the Google Generative AI model constants by adding the latest Gemini 2.5 variants, reorganizing the existing Gemini 2.0/1.5 entries, and introducing new embedding and AQA preview models.
- Reorder and add Gemini 2.5 preview models with date-suffix naming.
- Group and adjust Gemini 2.0 and 1.5 entries for clarity.
- Add
gemini-embedding-expand a new AQA preview model.
Comments suppressed due to low confidence (2)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:60
- The model identifier "models/aqa" does not match the "gemini-..." naming convention used elsewhere. Consider renaming it to something consistent (e.g., "gemini-aqa" or simply "aqa").
provider="Google Generative AI", name="models/aqa", icon="GoogleGenerativeAI", tool_calling=True, preview=True
src/backend/base/langflow/base/models/google_generative_ai_constants.py:64
- New model entries have been added—ensure any existing tests that validate
GOOGLE_GENERATIVE_AI_MODELSinclude these new variants so they don’t slip through unverified.
GOOGLE_GENERATIVE_AI_MODELS = [metadata["name"] for metadata in GOOGLE_GENERATIVE_AI_MODELS_DETAILED]
| # Unified model metadata - single source of truth | ||
| GOOGLE_GENERATIVE_AI_MODELS_DETAILED = [ | ||
| # GEMINI 1.5 | ||
| # GEMINI 2.5 (latest, most powerful and flash variants) |
There was a problem hiding this comment.
[nitpick] Consider adding blank lines before and after each version group comment (e.g., before # GEMINI 2.5 and before # GEMINI 2.0) to visually separate sections and improve readability.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (2)
7-7: Address line length violations. Multiplecreate_model_metadatacalls exceed the 120-character limit (E501). Consider wrapping parameters across lines or applying an autoformatter to satisfy style rules.Also applies to: 10-10, 13-13, 16-16, 19-19, 22-22, 29-29, 56-56
🧰 Tools
🪛 Ruff (0.11.9)
7-7: Line too long (136 > 120)
(E501)
🪛 Pylint (3.3.7)
[convention] 7-7: Line too long (136/100)
(C0301)
🪛 GitHub Check: Ruff Style Check (3.13)
[failure] 7-7: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:7:121: E501 Line too long (136 > 120)🪛 GitHub Actions: Ruff Style Check
[error] 7-7: Ruff: Line too long (136 > 120) (E501)
65-65: Remove extra blank line at EOF. There appears to be more than one trailing newline; trim to a single newline for consistency.🧰 Tools
🪛 Pylint (3.3.7)
[convention] 65-65: Trailing newlines
(C0305)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/backend/base/langflow/base/models/google_generative_ai_constants.py(2 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
src/backend/base/langflow/base/models/google_generative_ai_constants.py
7-7: Line too long (136 > 120)
(E501)
10-10: Line too long (138 > 120)
(E501)
13-13: Line too long (152 > 120)
(E501)
16-16: Line too long (157 > 120)
(E501)
19-19: Line too long (136 > 120)
(E501)
22-22: Line too long (134 > 120)
(E501)
29-29: Line too long (149 > 120)
(E501)
56-56: Line too long (128 > 120)
(E501)
🪛 Pylint (3.3.7)
src/backend/base/langflow/base/models/google_generative_ai_constants.py
[convention] 7-7: Line too long (136/100)
(C0301)
[convention] 10-10: Line too long (138/100)
(C0301)
[convention] 13-13: Line too long (152/100)
(C0301)
[convention] 16-16: Line too long (157/100)
(C0301)
[convention] 19-19: Line too long (136/100)
(C0301)
[convention] 22-22: Line too long (134/100)
(C0301)
[convention] 26-26: Line too long (110/100)
(C0301)
[convention] 29-29: Line too long (149/100)
(C0301)
[convention] 32-32: Line too long (115/100)
(C0301)
[convention] 36-36: Line too long (108/100)
(C0301)
[convention] 39-39: Line too long (110/100)
(C0301)
[convention] 42-42: Line too long (113/100)
(C0301)
[convention] 56-56: Line too long (128/100)
(C0301)
[convention] 60-60: Line too long (118/100)
(C0301)
[convention] 64-64: Line too long (101/100)
(C0301)
[convention] 65-65: Trailing newlines
(C0305)
🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/base/models/google_generative_ai_constants.py
[failure] 29-29: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:29:121: E501 Line too long (149 > 120)
[failure] 22-22: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:22:121: E501 Line too long (134 > 120)
[failure] 19-19: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:19:121: E501 Line too long (136 > 120)
[failure] 16-16: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:16:121: E501 Line too long (157 > 120)
[failure] 13-13: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:13:121: E501 Line too long (152 > 120)
[failure] 10-10: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:10:121: E501 Line too long (138 > 120)
[failure] 7-7: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:7:121: E501 Line too long (136 > 120)
[failure] 56-56: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:56:121: E501 Line too long (128 > 120)
🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/base/models/google_generative_ai_constants.py
[error] 7-7: Ruff: Line too long (136 > 120) (E501)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Lint Backend / Run Mypy (3.13)
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Optimize new Python code in this PR
- GitHub Check: Update Starter Projects
🔇 Additional comments (5)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (5)
5-23: Approve new Gemini 2.5 model entries. The added Gemini 2.5 variants are correctly grouped, all set withpreview=True, and align with the PR objectives.🧰 Tools
🪛 Ruff (0.11.9)
7-7: Line too long (136 > 120)
(E501)
10-10: Line too long (138 > 120)
(E501)
13-13: Line too long (152 > 120)
(E501)
16-16: Line too long (157 > 120)
(E501)
19-19: Line too long (136 > 120)
(E501)
22-22: Line too long (134 > 120)
(E501)
🪛 Pylint (3.3.7)
[convention] 7-7: Line too long (136/100)
(C0301)
[convention] 10-10: Line too long (138/100)
(C0301)
[convention] 13-13: Line too long (152/100)
(C0301)
[convention] 16-16: Line too long (157/100)
(C0301)
[convention] 19-19: Line too long (136/100)
(C0301)
[convention] 22-22: Line too long (134/100)
(C0301)
🪛 GitHub Check: Ruff Style Check (3.13)
[failure] 22-22: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:22:121: E501 Line too long (134 > 120)
[failure] 19-19: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:19:121: E501 Line too long (136 > 120)
[failure] 16-16: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:16:121: E501 Line too long (157 > 120)
[failure] 13-13: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:13:121: E501 Line too long (152 > 120)
[failure] 10-10: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:10:121: E501 Line too long (138 > 120)
[failure] 7-7: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:7:121: E501 Line too long (136 > 120)🪛 GitHub Actions: Ruff Style Check
[error] 7-7: Ruff: Line too long (136 > 120) (E501)
24-33: Approve Gemini 2.0 reorganized entries. Thegemini-2.0-flash,flash-preview-image-generation, andflash-litevariants use the intended preview flags and are ordered logically.🧰 Tools
🪛 Ruff (0.11.9)
29-29: Line too long (149 > 120)
(E501)
🪛 Pylint (3.3.7)
[convention] 26-26: Line too long (110/100)
(C0301)
[convention] 29-29: Line too long (149/100)
(C0301)
[convention] 32-32: Line too long (115/100)
(C0301)
🪛 GitHub Check: Ruff Style Check (3.13)
[failure] 29-29: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:29:121: E501 Line too long (149 > 120)
34-43: Approve restoration of Gemini 1.5 models. The reintroduced 1.5 variants are correctly positioned without thepreviewflag, matching the PR summary.🧰 Tools
🪛 Pylint (3.3.7)
[convention] 36-36: Line too long (108/100)
(C0301)
[convention] 39-39: Line too long (110/100)
(C0301)
[convention] 42-42: Line too long (113/100)
(C0301)
54-57: Approve new embedding model entry.gemini-embedding-expis properly marked as a preview model and placed under the EMBEDDING category.🧰 Tools
🪛 Ruff (0.11.9)
56-56: Line too long (128 > 120)
(E501)
🪛 Pylint (3.3.7)
[convention] 56-56: Line too long (128/100)
(C0301)
🪛 GitHub Check: Ruff Style Check (3.13)
[failure] 56-56: Ruff (E501)
src/backend/base/langflow/base/models/google_generative_ai_constants.py:56:121: E501 Line too long (128 > 120)
58-61: Verify the AQA model name. The entry usesname="models/aqa", which differs from other model IDs. Please confirm whether themodels/prefix is deliberate and matches the upstream API naming.🧰 Tools
🪛 Pylint (3.3.7)
[convention] 60-60: Line too long (118/100)
(C0301)
…low-ai/langflow into feat-add-new-google-models
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (1)
5-5: Improve section separation for better readability.Consider adding blank lines before and after version group comments to visually separate sections, as suggested in a previous review.
Apply this formatting to improve visual separation:
+ # GEMINI 2.5 (latest, most powerful and flash variants) + create_model_metadata(Apply similar spacing around other section headers (lines 48, 62, 82, 90).
Also applies to: 48-48, 62-62, 82-82, 90-90
🧹 Nitpick comments (1)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (1)
50-50: Format long lines for better readability.Multiple lines exceed the 100-character limit. Consider breaking them into multiple lines for better maintainability.
Apply this formatting to improve readability:
- create_model_metadata( - provider="Google Generative AI", name="gemini-2.0-flash", icon="GoogleGenerativeAI", tool_calling=True - ), + create_model_metadata( + provider="Google Generative AI", + name="gemini-2.0-flash", + icon="GoogleGenerativeAI", + tool_calling=True, + ),Apply similar formatting to lines 60, 64, 67, and 70.
Also applies to: 60-60, 64-64, 67-67, 70-70
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 50-50: Line too long (110/100)
(C0301)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/backend/base/langflow/base/models/google_generative_ai_constants.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (2)
src/backend/base/langflow/base/models/model_metadata.py (1)
create_model_metadata(18-41)src/backend/base/langflow/base/astra_assistants/util.py (1)
name(147-151)
🪛 Pylint (3.3.7)
src/backend/base/langflow/base/models/google_generative_ai_constants.py
[convention] 50-50: Line too long (110/100)
(C0301)
[convention] 60-60: Line too long (115/100)
(C0301)
[convention] 64-64: Line too long (108/100)
(C0301)
[convention] 67-67: Line too long (110/100)
(C0301)
[convention] 70-70: Line too long (113/100)
(C0301)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
🔇 Additional comments (3)
src/backend/base/langflow/base/models/google_generative_ai_constants.py (3)
5-47: LGTM! Well-structured addition of GEMINI 2.5 models.The new GEMINI 2.5 models are correctly configured with appropriate preview flags and consistent metadata. The specialized variants (native audio, TTS, experimental) align with Google's latest offerings.
48-71: Excellent reorganization of GEMINI 2.0 and 1.5 models.The version-based grouping (2.5 → 2.0 → 1.5) improves clarity, and the removal of preview flags from GEMINI 1.5 models correctly reflects their stable status.
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 50-50: Line too long (110/100)
(C0301)
[convention] 60-60: Line too long (115/100)
(C0301)
[convention] 64-64: Line too long (108/100)
(C0301)
[convention] 67-67: Line too long (110/100)
(C0301)
[convention] 70-70: Line too long (113/100)
(C0301)
82-89:Details
❓ Verification inconclusive
Verify tool_calling support for embedding model.
The
gemini-embedding-expmodel is configured withtool_calling=True, which is unusual for embedding models that typically generate vectors rather than text with function calls.Please verify if this embedding model actually supports tool calling or if this should be
tool_calling=False:
🏁 Script executed:
#!/bin/bash # Description: Search for other embedding model configurations to verify the pattern # Expected: Find how other embedding models are configured in the codebase rg -A 5 -B 5 "embedding.*create_model_metadata|create_model_metadata.*embedding" --type pyLength of output: 92
Manual verification needed for
tool_callingin embedding modelI couldn’t locate any other embedding configurations to validate the pattern. Embedding models generally generate vectors and don’t support function calls. Please check if
gemini-embedding-expactually supportstool_callingor change it toFalse.• File:
src/backend/base/langflow/base/models/google_generative_ai_constants.py
Lines: 82–89
| # AQA | ||
| create_model_metadata( | ||
| provider="Google Generative AI", | ||
| name="models/aqa", | ||
| icon="GoogleGenerativeAI", | ||
| tool_calling=True, | ||
| preview=True, | ||
| not_supported=True, | ||
| ), |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Clarify the purpose of the not_supported AQA model.
The AQA model is marked as both preview=True and not_supported=True, which seems contradictory. If the model is not supported, consider whether it should be included in the available models list.
Please clarify the intended behavior for not_supported models and verify this configuration is correct:
🏁 Script executed:
#!/bin/bash
# Description: Check how not_supported flag is used elsewhere in the codebase
# Expected: Find patterns of not_supported usage to understand intended behavior
rg -A 3 -B 3 "not_supported.*True|not_supported=True" --type pyLength of output: 5015
🏁 Script executed:
#!/bin/bash
rg -n "create_model_metadata" --type py src/backend/base/langflow/base/models/google_generative_ai_constants.py -A3 -B3Length of output: 3565
Standardize AQA model metadata
The combination of preview=True and not_supported=True is already used elsewhere to flag API‐preview models that Langflow doesn’t support yet. To keep things consistent:
- Move the AQA entry under a
# Not Supported Modelsheading (as inopenai_constants.pyandgroq_constants.py). - Confirm whether this model should become supported:
- If yes, remove
not_supported=True. - If not, leave the flag and grouping in place.
- If yes, remove
- Verify that
name="models/aqa"is the correct model ID. Most Google models omit the"models/"prefix—update if necessary.
🤖 Prompt for AI Agents
In src/backend/base/langflow/base/models/google_generative_ai_constants.py
around lines 90 to 98, the AQA model is marked with both preview=True and
not_supported=True, which is inconsistent. To fix this, move the AQA model entry
under a dedicated "# Not Supported Models" section to align with other similar
models. Confirm if the model should be supported; if yes, remove the
not_supported=True flag, otherwise keep it. Also, verify and update the model
name by removing the "models/" prefix if that is the standard for Google models
in this file.
ogabrielluiz
left a comment
There was a problem hiding this comment.
Do you confirm that all of these work?
Maybe we should add tests before merging.
If they are meant to work with the Agent Component, you can add tests similar to what we have now for OpenAI and Anthropic
|
@ogabrielluiz can we add tests once we have the CI setup done for time being can we add these new models? |
|
There are new models now, like gemini 2.5 flash lite preview. Would it be possible to add those as well? Regarding only adding models that work, the Agent component already lets me select models that don't have function calling capability (like gemma models) and it actually puts these models as default when you open the flow, breaking the agent automatically and unprompted. Also I think Gemini 1.5 is deprecated now? We had issues in production with a non-langflow service that started having errors, fix was migrating to 2.0. |
|
Let's get this merged please! I can't bother with trying langflow unless I know it supports gemini 2.5 flash. |
|
New models merged in a Different PR hence closing this one. |
This pull request updates the
GOOGLE_GENERATIVE_AI_MODELS_DETAILEDlist ingoogle_generative_ai_constants.pyto include new models and reorganize existing ones. It introduces several new Gemini 2.5 variants, adds models for embedding and AQA, and reorders the list to group models by version and type for better clarity.Updates to model list:
Gemini 2.5 Models:
gemini-2.5-flash-preview-native-audio-dialog,gemini-2.5-flash-exp-native-audio-thinking-dialog, andgemini-2.5-flash-preview-tts. These models are marked as preview versions.Gemini 2.0 Models:
gemini-2.0-flashandgemini-2.0-flash-lite. Added a preview model for image generation (gemini-2.0-flash-preview-image-generation).Gemini 1.5 Models:
gemini-1.5-pro,gemini-1.5-flash, andgemini-1.5-flash-8b. These models are no longer marked as preview.New Model Categories:
gemini-embedding-exp) and an AQA model (models/aqa), both marked as preview versions.Summary by CodeRabbit