mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-11 02:43:44 +08:00
feat: add tool choice configuration and update steam handling in Gemini
update ToolConfig to use pointer type in ChatRequest
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package gemini
|
||||
|
||||
type ChatRequest struct {
|
||||
Contents []ChatContent `json:"contents"`
|
||||
SafetySettings []ChatSafetySettings `json:"safety_settings,omitempty"`
|
||||
GenerationConfig ChatGenerationConfig `json:"generation_config,omitempty"`
|
||||
Tools []ChatTools `json:"tools,omitempty"`
|
||||
Contents []ChatContent `json:"contents"`
|
||||
SystemInstruction *ChatContent `json:"system_instruction,omitempty"`
|
||||
SafetySettings []ChatSafetySettings `json:"safety_settings,omitempty"`
|
||||
GenerationConfig ChatGenerationConfig `json:"generation_config,omitempty"`
|
||||
Tools []ChatTools `json:"tools,omitempty"`
|
||||
ToolConfig *ToolConfig `json:"tool_config,omitempty"`
|
||||
}
|
||||
|
||||
type EmbeddingRequest struct {
|
||||
@@ -74,3 +76,12 @@ type ChatGenerationConfig struct {
|
||||
CandidateCount int `json:"candidateCount,omitempty"`
|
||||
StopSequences []string `json:"stopSequences,omitempty"`
|
||||
}
|
||||
|
||||
type FunctionCallingConfig struct {
|
||||
Mode string `json:"mode,omitempty"`
|
||||
AllowedFunctionNames []string `json:"allowed_function_names,omitempty"`
|
||||
}
|
||||
|
||||
type ToolConfig struct {
|
||||
FunctionCallingConfig FunctionCallingConfig `json:"function_calling_config"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user