feat(api-nodes): add Gemini 3.1 Flash-Lite model to LLM node#12803
feat(api-nodes): add Gemini 3.1 Flash-Lite model to LLM node#12803Kosinkadink merged 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughThis PR modifies the Gemini model configuration in 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
comfy_api_nodes/nodes_gemini.py (1)
433-451:⚠️ Potential issue | 🟠 MajorRe-add local prompt validation before building the request.
This method now goes straight from model normalization to
GeminiPart(text=prompt), so empty or whitespace-only prompts reach the remote API instead of failing fast in-node. That is a behavior regression unrelated to the model addition and makes API failures harder to diagnose.Suggested change
) -> IO.NodeOutput: + validate_string(prompt, strip_whitespace=True, min_length=1) if model == "gemini-3-pro-preview": model = "gemini-3.1-pro-preview" # model "gemini-3-pro-preview" will be soon deprecated by Google elif model == "gemini-3-1-pro": model = "gemini-3.1-pro-preview" elif model == "gemini-3-1-flash-lite": model = "gemini-3.1-flash-lite-preview"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@comfy_api_nodes/nodes_gemini.py` around lines 433 - 451, In execute, re-add local validation for the prompt before constructing parts/GeminiPart: trim prompt (and optionally system_prompt) and if it's empty or only whitespace, fail fast by raising a clear exception or returning an error NodeOutput instead of calling the remote API; insert this check immediately before the line that creates parts: list[GeminiPart] = [GeminiPart(text=prompt)] so empty/whitespace prompts are caught in-node.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@comfy_api_nodes/nodes_gemini.py`:
- Around line 287-295: The dropdown options list should not advertise
"gemini-3-pro-preview" since execute() always remaps that value to
"gemini-3.1-pro-preview"; remove "gemini-3-pro-preview" from the options array
metadata so users can't select it, and keep the legacy ID only in the
compatibility/remapping logic inside the execute() method (where you detect and
upgrade the old ID) to preserve backwards compatibility.
---
Outside diff comments:
In `@comfy_api_nodes/nodes_gemini.py`:
- Around line 433-451: In execute, re-add local validation for the prompt before
constructing parts/GeminiPart: trim prompt (and optionally system_prompt) and if
it's empty or only whitespace, fail fast by raising a clear exception or
returning an error NodeOutput instead of calling the remote API; insert this
check immediately before the line that creates parts: list[GeminiPart] =
[GeminiPart(text=prompt)] so empty/whitespace prompts are caught in-node.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 14defb14-050c-4baa-abc5-bf17ab4f8074
📒 Files selected for processing (1)
comfy_api_nodes/nodes_gemini.py
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms