feat: 添加思考模式配置支持
在SummaryConfig结构体中新增Thinking字段,支持启用思考模式功能。更新相关配置文件、类型定义和客户端代码以支持该功能。
This commit is contained in:
@@ -47,6 +47,7 @@ type SummaryConfig struct {
|
|||||||
Temperature float64 `json:"temperature"`
|
Temperature float64 `json:"temperature"`
|
||||||
Seed int `json:"seed"`
|
Seed int `json:"seed"`
|
||||||
MaxCompletionTokens int `json:"max_completion_tokens"`
|
MaxCompletionTokens int `json:"max_completion_tokens"`
|
||||||
|
Thinking *bool `json:"thinking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SessionAgentConfig defines session-level agent configuration (matches server struct).
|
// SessionAgentConfig defines session-level agent configuration (matches server struct).
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ func prepareChatModel(ctx context.Context, modelService interfaces.ModelService,
|
|||||||
MaxCompletionTokens: chatManage.SummaryConfig.MaxCompletionTokens,
|
MaxCompletionTokens: chatManage.SummaryConfig.MaxCompletionTokens,
|
||||||
FrequencyPenalty: chatManage.SummaryConfig.FrequencyPenalty,
|
FrequencyPenalty: chatManage.SummaryConfig.FrequencyPenalty,
|
||||||
PresencePenalty: chatManage.SummaryConfig.PresencePenalty,
|
PresencePenalty: chatManage.SummaryConfig.PresencePenalty,
|
||||||
|
Thinking: chatManage.SummaryConfig.Thinking,
|
||||||
}
|
}
|
||||||
|
|
||||||
return chatModel, opt, nil
|
return chatModel, opt, nil
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ type SummaryConfig struct {
|
|||||||
Seed int `yaml:"seed" json:"seed"`
|
Seed int `yaml:"seed" json:"seed"`
|
||||||
MaxCompletionTokens int `yaml:"max_completion_tokens" json:"max_completion_tokens"`
|
MaxCompletionTokens int `yaml:"max_completion_tokens" json:"max_completion_tokens"`
|
||||||
NoMatchPrefix string `yaml:"no_match_prefix" json:"no_match_prefix"`
|
NoMatchPrefix string `yaml:"no_match_prefix" json:"no_match_prefix"`
|
||||||
|
Thinking *bool `yaml:"thinking" json:"thinking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerConfig 服务器配置
|
// ServerConfig 服务器配置
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ func (c *ChatManage) Clone() *ChatManage {
|
|||||||
Temperature: c.SummaryConfig.Temperature,
|
Temperature: c.SummaryConfig.Temperature,
|
||||||
Seed: c.SummaryConfig.Seed,
|
Seed: c.SummaryConfig.Seed,
|
||||||
MaxCompletionTokens: c.SummaryConfig.MaxCompletionTokens,
|
MaxCompletionTokens: c.SummaryConfig.MaxCompletionTokens,
|
||||||
|
Thinking: c.SummaryConfig.Thinking,
|
||||||
},
|
},
|
||||||
FallbackStrategy: c.FallbackStrategy,
|
FallbackStrategy: c.FallbackStrategy,
|
||||||
FallbackResponse: c.FallbackResponse,
|
FallbackResponse: c.FallbackResponse,
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ type SummaryConfig struct {
|
|||||||
Seed int `json:"seed"`
|
Seed int `json:"seed"`
|
||||||
// Max completion tokens
|
// Max completion tokens
|
||||||
MaxCompletionTokens int `json:"max_completion_tokens"`
|
MaxCompletionTokens int `json:"max_completion_tokens"`
|
||||||
|
// Thinking - whether to enable thinking mode
|
||||||
|
Thinking *bool `json:"thinking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextCompressionStrategy represents the strategy for context compression
|
// ContextCompressionStrategy represents the strategy for context compression
|
||||||
|
|||||||
Reference in New Issue
Block a user