fix(embedding): support native Gemini embeddings

This commit is contained in:
Yeongpil Yoon
2026-06-02 17:32:29 +09:00
committed by lyingbug
parent 482686d17e
commit 8f8a276120
8 changed files with 364 additions and 6 deletions
+10 -5
View File
@@ -12,13 +12,15 @@ func TestApplyCustomHeaders_SkipReserved(t *testing.T) {
req, _ := http.NewRequest("GET", "https://example.com", nil)
req.Header.Set("Authorization", "Bearer original")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-goog-api-key", "google-original")
ApplyCustomHeaders(req, map[string]string{
"Authorization": "Bearer injected",
"Content-Type": "text/plain",
"X-Trace-Id": "trace-123",
"X-Route": "edge",
"": "empty-key-should-be-skipped",
"Authorization": "Bearer injected",
"Content-Type": "text/plain",
"x-goog-api-key": "google-injected",
"X-Trace-Id": "trace-123",
"X-Route": "edge",
"": "empty-key-should-be-skipped",
})
if got := req.Header.Get("Authorization"); got != "Bearer original" {
@@ -27,6 +29,9 @@ func TestApplyCustomHeaders_SkipReserved(t *testing.T) {
if got := req.Header.Get("Content-Type"); got != "application/json" {
t.Fatalf("content-type overwritten: %q", got)
}
if got := req.Header.Get("x-goog-api-key"); got != "google-original" {
t.Fatalf("x-goog-api-key overwritten: %q", got)
}
if got := req.Header.Get("X-Trace-Id"); got != "trace-123" {
t.Fatalf("X-Trace-Id not injected: %q", got)
}