From 5657eca8ce4ec296cb5a57a9ff9500d806053722 Mon Sep 17 00:00:00 2001 From: wclssdn Date: Thu, 17 Jul 2025 18:56:19 +0800 Subject: [PATCH 1/2] Support Google VertexAI Gemini-specific parameters --- chat.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chat.go b/chat.go index 0f0c5b5d5..d1483e7d1 100644 --- a/chat.go +++ b/chat.go @@ -309,6 +309,10 @@ type ChatCompletionRequest struct { ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"` // Specifies the latency tier to use for processing the request. ServiceTier ServiceTier `json:"service_tier,omitempty"` + // Support Google VertexAI Gemini-specific parameters + // https://cloud.google.com/vertex-ai/generative-ai/docs/migrate/openai/overview#extra_body_features + ExtraBody map[string]any `json:"extra_body,omitempty"` + ExtraPart map[string]any `json:"extra_part,omitempty"` } type StreamOptions struct { From 5622952b74231b47ba14e4315b2d8c8267aed47e Mon Sep 17 00:00:00 2001 From: wclssdn Date: Thu, 17 Jul 2025 19:03:01 +0800 Subject: [PATCH 2/2] Update chat.go --- chat.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat.go b/chat.go index d1483e7d1..2701e665f 100644 --- a/chat.go +++ b/chat.go @@ -311,8 +311,8 @@ type ChatCompletionRequest struct { ServiceTier ServiceTier `json:"service_tier,omitempty"` // Support Google VertexAI Gemini-specific parameters // https://cloud.google.com/vertex-ai/generative-ai/docs/migrate/openai/overview#extra_body_features - ExtraBody map[string]any `json:"extra_body,omitempty"` - ExtraPart map[string]any `json:"extra_part,omitempty"` + ExtraBody map[string]any `json:"extra_body,omitempty"` + ExtraPart map[string]any `json:"extra_part,omitempty"` } type StreamOptions struct {