From bc1f747418ba103f6866ab913635b8d8548da8c3 Mon Sep 17 00:00:00 2001 From: Seefs Date: Wed, 19 Nov 2025 01:46:51 +0800 Subject: [PATCH 1/2] feat: gemini-3-pro --- dto/gemini.go | 9 +++++++-- relay/channel/gemini/constant.go | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dto/gemini.go b/dto/gemini.go index d9d153374..03e0671fd 100644 --- a/dto/gemini.go +++ b/dto/gemini.go @@ -182,8 +182,12 @@ type FunctionCall struct { } type GeminiFunctionResponse struct { - Name string `json:"name"` - Response map[string]interface{} `json:"response"` + Name string `json:"name"` + Response map[string]interface{} `json:"response"` + WillContinue json.RawMessage `json:"willContinue,omitempty"` + Scheduling json.RawMessage `json:"scheduling,omitempty"` + Parts json.RawMessage `json:"parts,omitempty"` + ID json.RawMessage `json:"id,omitempty"` } type GeminiPartExecutableCode struct { @@ -206,6 +210,7 @@ type GeminiPart struct { Thought bool `json:"thought,omitempty"` InlineData *GeminiInlineData `json:"inlineData,omitempty"` FunctionCall *FunctionCall `json:"functionCall,omitempty"` + ThoughtSignature json.RawMessage `json:"thoughtSignature,omitempty"` FunctionResponse *GeminiFunctionResponse `json:"functionResponse,omitempty"` FileData *GeminiFileData `json:"fileData,omitempty"` ExecutableCode *GeminiPartExecutableCode `json:"executableCode,omitempty"` diff --git a/relay/channel/gemini/constant.go b/relay/channel/gemini/constant.go index 2c972e37d..4bddc7ba3 100644 --- a/relay/channel/gemini/constant.go +++ b/relay/channel/gemini/constant.go @@ -8,6 +8,7 @@ var ModelList = []string{ "gemini-1.5-pro-latest", "gemini-1.5-flash-latest", // preview version "gemini-2.0-flash-lite-preview", + "gemini-3-pro-preview", // gemini exp "gemini-exp-1206", // flash exp From 77c4c3e804af1c276c8512d949cc39bc0fa77f52 Mon Sep 17 00:00:00 2001 From: Seefs Date: Wed, 19 Nov 2025 13:42:32 +0800 Subject: [PATCH 2/2] feat: MediaResolution && VideoMetadata --- dto/gemini.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dto/gemini.go b/dto/gemini.go index 03e0671fd..d7e598db3 100644 --- a/dto/gemini.go +++ b/dto/gemini.go @@ -141,6 +141,8 @@ func (r *GeminiChatRequest) SetTools(tools []GeminiChatTool) { type GeminiThinkingConfig struct { IncludeThoughts bool `json:"includeThoughts,omitempty"` ThinkingBudget *int `json:"thinkingBudget,omitempty"` + // TODO Conflict with thinkingbudget. + // ThinkingLevel json.RawMessage `json:"thinkingLevel,omitempty"` } func (c *GeminiThinkingConfig) SetThinkingBudget(budget int) { @@ -206,12 +208,15 @@ type GeminiFileData struct { } type GeminiPart struct { - Text string `json:"text,omitempty"` - Thought bool `json:"thought,omitempty"` - InlineData *GeminiInlineData `json:"inlineData,omitempty"` - FunctionCall *FunctionCall `json:"functionCall,omitempty"` - ThoughtSignature json.RawMessage `json:"thoughtSignature,omitempty"` - FunctionResponse *GeminiFunctionResponse `json:"functionResponse,omitempty"` + Text string `json:"text,omitempty"` + Thought bool `json:"thought,omitempty"` + InlineData *GeminiInlineData `json:"inlineData,omitempty"` + FunctionCall *FunctionCall `json:"functionCall,omitempty"` + ThoughtSignature json.RawMessage `json:"thoughtSignature,omitempty"` + FunctionResponse *GeminiFunctionResponse `json:"functionResponse,omitempty"` + // Optional. Media resolution for the input media. + MediaResolution json.RawMessage `json:"mediaResolution,omitempty"` + VideoMetadata json.RawMessage `json:"videoMetadata,omitempty"` FileData *GeminiFileData `json:"fileData,omitempty"` ExecutableCode *GeminiPartExecutableCode `json:"executableCode,omitempty"` CodeExecutionResult *GeminiPartCodeExecutionResult `json:"codeExecutionResult,omitempty"`