Просмотр исходного кода

Merge pull request #2243 from seefs001/feature/gemini-3

feat: gemini-3-pro
Calcium-Ion 3 месяцев назад
Родитель
Сommit
75fced3d9c
2 измененных файлов с 18 добавлено и 7 удалено
  1. 17 7
      dto/gemini.go
  2. 1 0
      relay/channel/gemini/constant.go

+ 17 - 7
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) {
@@ -182,8 +184,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 {
@@ -202,11 +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"`
-	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"`

+ 1 - 0
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