Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/GenerativeAI/Constants/GoogleAIModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ public static class GoogleAIModels
/// Represents the default Gemini AI model identifier used by the Generative AI services.
/// </summary>
public const string DefaultGeminiModel = Gemini15Flash;


///<summary>
/// Gemini 2.5 Flash
/// </summary>
public const string Gemini25Flash = "models/gemini-2.5-flash";

/// <summary>
/// Gemini 2.0 Flash model name.
/// </summary>
public const string Gemini2Flash = "models/gemini-2.0-flash";

/// <summary>
/// Gemini 2.5 Pro
/// </summary>
public const string Gemini25Pro = "models/gemini-2.5-pro";

/// <summary>
/// Gemini 2.5 Pro Exp 03-25 model name.
/// </summary>
Expand Down Expand Up @@ -81,10 +91,15 @@ public static class GoogleAIModels
/// </summary>
public const string Gemini2FlashExpImageGeneration = "gemini-2.0-flash-exp-image-generation";

/// <summary>
/// The current Gemini Emedding model name.
/// </summary>
public const string GeminiEmbedding = "models/gemini-embedding-001";

/// <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";
Comment on lines 99 to 103

Copy link
Copy Markdown

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.

/// <summary>
/// Gemma 3.0 27B model name.
Expand Down
1 change: 1 addition & 0 deletions src/GenerativeAI/Constants/SupportedEmbedingModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class SupportedEmbedingModels
{
// From GeminiConstants
GoogleAIModels.TextEmbedding,
GoogleAIModels.GeminiEmbedding,

// From VertexAIModels.Embeddings
VertexAIModels.Embeddings.TextEmbeddingGecko001,
Expand Down