-
Notifications
You must be signed in to change notification settings - Fork 28
Update the current Gemini Models #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded new Google model constants (Gemini 2.5 Flash/Pro and Gemini Embedding), marked the experimental embedding constant as obsolete, and included the new embedding model in the supported embeddings list. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ 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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/GenerativeAI/Constants/GoogleAIModels.cs (2)
17-21: Fix XML doc tag spacing; optionally consider updating the default model.
- The XML doc tag on Line 17 is missing a space after the triple slashes, unlike the rest of the file.
- Optional: Given stable 2.5 models are now introduced, consider bumping DefaultGeminiModel to Gemini25Flash if backward compatibility allows.
Apply this diff for the doc tag:
- ///<summary> + /// <summary>
94-98: Typo in XML summary: “Emedding” → “Embedding”.Correct the spelling in the summary to avoid leaking typos into generated docs.
- /// The current Gemini Emedding model name. + /// The current Gemini Embedding model identifier.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/GenerativeAI/Constants/GoogleAIModels.cs(2 hunks)src/GenerativeAI/Constants/SupportedEmbedingModels.cs(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/GenerativeAI/Constants/SupportedEmbedingModels.cs (1)
src/GenerativeAI/Constants/GoogleAIModels.cs (1)
GoogleAIModels(10-281)
🔇 Additional comments (2)
src/GenerativeAI/Constants/GoogleAIModels.cs (1)
27-31: Addition of Gemini 2.5 Pro constant looks good.Naming and prefix ("models/") are consistent with recent constants.
src/GenerativeAI/Constants/SupportedEmbedingModels.cs (1)
30-31: Good inclusion of the new Gemini embedding model.Adding GoogleAIModels.GeminiEmbedding keeps SupportedEmbedingModels up to date with current releases and avoids the deprecated experimental variant.
| /// <summary> | ||
| /// Gemini 2.0 Flash Exp model name. | ||
| /// </summary> | ||
| [Obsolete("Gemini-embedding-exp is deprecated. Use GeminiEmedding (gemini-embedding-001) instead.", false)] | ||
| public const string GeminiEmbeddingExp = "gemini-embedding-exp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Mismatched XML summary and typos in Obsolete message; consider qualifying Obsolete.
- The XML summary (“Gemini 2.0 Flash Exp model name.”) doesn’t describe GeminiEmbeddingExp.
- The Obsolete message has a typo (“GeminiEmedding”) and should reference the constant name accurately. Including the fully qualified model id is clearer.
- To avoid depending on global usings, prefer [System.Obsolete(...)] (safe even if implicit usings are disabled).
Apply this diff:
-/// <summary>
-/// Gemini 2.0 Flash Exp model name.
-/// </summary>
-[Obsolete("Gemini-embedding-exp is deprecated. Use GeminiEmedding (gemini-embedding-001) instead.", false)]
+/// <summary>
+/// Gemini embedding experimental model (deprecated).
+/// </summary>
+[System.Obsolete("gemini-embedding-exp is deprecated. Use GeminiEmbedding (models/gemini-embedding-001) instead.", false)]
public const string GeminiEmbeddingExp = "gemini-embedding-exp";To verify and plan follow-ups, run this repo-wide search to find any remaining usages of the deprecated constant or literal and queue fixes:
I can prepare a follow-up PR to replace remaining usages (if any) with GoogleAIModels.GeminiEmbedding or route callers through SupportedEmbedingModels.All.
🏁 Script executed:
#!/bin/bash
# Find references to the constant and raw literal
rg -n -C2 --glob '!*bin*' --glob '!*obj*' '\bGeminiEmbeddingExp\b|gemini-embedding-exp'Length of output: 1030
Update GeminiEmbeddingExp constants in both VertexAIModels.cs and GoogleAIModels.cs
The same constant and incorrect XML/Obsolete metadata exists in two places. Please apply these fixes to both files:
- Change the XML summary to accurately describe the deprecated model.
- Correct the typo in the Obsolete message (use “GeminiEmbedding”).
- Fully qualify the attribute as
[System.Obsolete(...)]. - Reference the exact model ID (
models/gemini-embedding-001) rather than an ambiguous string.
Proposed diffs:
--- a/src/GenerativeAI/Constants/VertexAIModels.cs
+++ b/src/GenerativeAI/Constants/VertexAIModels.cs
@@ -88,8 +88,8 @@
- /// <summary>
- /// Gemini 2.0 Flash Exp model name.
- /// </summary>
- [Obsolete("Gemini-embedding-exp is deprecated. Use GeminiEmedding (gemini-embedding-001) instead.", false)]
+ /// <summary>
+ /// Gemini embedding experimental model (deprecated).
+ /// </summary>
+ [System.Obsolete("gemini-embedding-exp is deprecated. Use GeminiEmbedding (models/gemini-embedding-001) instead.", false)]
public const string GeminiEmbeddingExp = "gemini-embedding-exp";--- a/src/GenerativeAI/Constants/GoogleAIModels.cs
+++ b/src/GenerativeAI/Constants/GoogleAIModels.cs
@@ -99,8 +99,8 @@
- /// <summary>
- /// Gemini 2.0 Flash Exp model name.
- /// </summary>
- [Obsolete("Gemini-embedding-exp is deprecated. Use GeminiEmedding (gemini-embedding-001) instead.", false)]
+ /// <summary>
+ /// Gemini embedding experimental model (deprecated).
+ /// </summary>
+ [System.Obsolete("gemini-embedding-exp is deprecated. Use GeminiEmbedding (models/gemini-embedding-001) instead.", false)]
public const string GeminiEmbeddingExp = "gemini-embedding-exp";After updating, re-run the search to catch any remaining references:
#!/bin/bash
rg -n -C2 --glob '!*bin*' --glob '!*obj*' '\bGeminiEmbeddingExp\b|gemini-embedding-exp'I can help prepare a follow-up PR to replace all usages with GoogleAIModels.GeminiEmbedding or route through SupportedEmbeddingModels.All.
🤖 Prompt for AI Agents
In src/GenerativeAI/Constants/GoogleAIModels.cs around lines 99 to 103 (and
apply the same edits to src/GenerativeAI/Constants/VertexAIModels.cs), the
GeminiEmbeddingExp constant's XML summary and Obsolete attribute are incorrect:
update the XML summary to describe that this constant refers to the deprecated
Gemini embedding model, fix the typo in the Obsolete message to
"GeminiEmbedding", fully qualify the attribute as [System.Obsolete(...)] and
change the referenced model ID to the exact value "models/gemini-embedding-001";
make the same precise edits in the VertexAIModels file and then run the provided
ripgrep command to find any remaining references for follow-up replacement.
Just added a few of the newer models so embedding works with new releases, the pattern could be improved, if you want i will work on it.
Summary by CodeRabbit