Bug: VertexAIEmbeddingGenerator hardcodes :predict, unusable with gemini-embedding models that only serve :embedContent
Maintainer thường phản hồi trong vòng 1 ngày
@veerjain-1 đang làm issue này rồi.
Từ ngày 13/8/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu trong dotnet/src/Connectors/Connectors.Google/Core/VertexAI/VertexAIEmbeddingClient.cs tại endpoint :predict được hardcode, sau đó chạy bản tái hiện gemini-embedding-2 được cung cấp. Xác định cách model nên chọn :embedContent và kiểm tra rằng GenerateAsync thành công với các chiều được yêu cầu thay vì trả về FAILED_PRECONDITION.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Using VertexAIEmbeddingGenerator with model "gemini-embedding-2" will result in 400 FAILED_PRECONDITION
To Reproduce
Run the VertexAIEmbeddingGenerator generation with the gemini-embedding-2 model:
#:package [email protected]
#:property NoWarn=SKEXP0001;SKEXP0070
using System.Net.Http.Json;
using System.Text.Json;
using Microsoft.Extensions.AI;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.Google;
const string ModelId = "gemini-embedding-2";
const int Dimensions = 768;
var token = Require("GOOGLE_ACCESS_TOKEN");
var projectId = Require("GOOGLE_PROJECT_ID");
var location = Environment.GetEnvironmentVariable("GOOGLE_LOCATION") is { Length: > 0 } l ? l : "us-central1";
Console.WriteLine($"model={ModelId} project={projectId} location={location} dimensions={Dimensions}");
Console.WriteLine($"SK Connectors.Google = {typeof(VertexAIEmbeddingGenerator).Assembly.GetName().Version}");
Console.WriteLine();
try
{
IEmbeddingGenerator<string, Embedding<float>> generator = new VertexAIEmbeddingGenerator(
modelId: ModelId,
bearerKey: token,
location: location,
projectId: projectId,
dimensions: Dimensions);
var embeddings = await generator.GenerateAsync(["test"]);
Console.WriteLine($" UNEXPECTED SUCCESS: {embeddings[0].Vector.Length} floats");
}
catch (HttpOperationException ex)
{
Console.WriteLine($" FAILED status={ex.StatusCode}");
Console.WriteLine($" message={ex.Message}");
Console.WriteLine($" body={Trim(ex.ResponseContent)}");
}
catch (Exception ex)
{
Console.WriteLine($" FAILED {ex.GetType().Name}: {ex.Message}");
}
Expected behavior
VertexAIEmbeddingGenerator should correctly resolve to use the :embedContent endpoint in this case, as the :predict endpoint is no longer supported for gemini-embedding-2
Platform
- Language: C#
- Source: [email protected]
- AI model: gemini-embedding-2
- IDE: JetBrains Rider
- OS: Windows
Additional context
:predict API is hardcoded here:
https://github.com/microsoft/semantic-kernel/blob/383d102346b7b29c929e0257ef672a48898b5f66/dotnet/src/Connectors/Connectors.Google/Core/VertexAI/VertexAIEmbeddingClient.cs#L57
Similar problems raised in other repos:
- Ngôn ngữ chính
- C#
- Star
- 28.7k
- Fork
- 4.8k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/semantic-kernel
-
Python: Rejected system messages leave AgentChat permanently activeCó thể đã có người làm @Michael-Duck đã nhận 4 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/semantic-kernel#14638 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python: Bug: Anthropic, Bedrock, Google AI and Vertex AI tool formatters ignore include_in_function_choices=FalseCó thể đã có người làm @wasim-builds đã nhận 9 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/semantic-kernel#14615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python: Bug: AnnotationContent and StreamingAnnotationContent to_element writes CitationType.X, so annotations in a rendered chat history fail to parseCó thể đã có người làm @CRYPTONIKAV đã nhận 12 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/semantic-kernel#14590 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python: Bug: TimePlugin timeZoneOffset and timeZoneName always return an empty stringCó thể đã có người làm @jeevan1098 đã nhận 11 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
microsoft/semantic-kernel#14583 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Có thể đã có người làm @nightcityblade đã nhận 23 ngày trước. Đang mở.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/semantic-kernel#14526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/semantic-kernel
Issue tương tự
-
is:bug is:FQNIssue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nunit/nunit3-vs-adapter#1527 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug effort:S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightscout/nocturne#2840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI: миграции на пустой PostgresĐang mởtrack:release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusCó thể đã có người làm @leizhiyuan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/rocketmq-clients#1465 ·
Maintainer thường phản hồi trong vòng 2 ngày