fix: Adjust temperature validation to allow zero as a valid setting and default only for negative values.

This commit is contained in:
Andy Yang
2026-03-19 18:50:32 +08:00
committed by lyingbug
parent a4d3d69843
commit 5c31a9123f
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -286,7 +286,7 @@ func (h *Handler) createDefaultSummaryConfig(ctx context.Context) *types.Summary
if tenant.ConversationConfig.ContextTemplate != "" {
cfg.ContextTemplate = tenant.ConversationConfig.ContextTemplate
}
if tenant.ConversationConfig.Temperature > 0 {
if tenant.ConversationConfig.Temperature >= 0 {
cfg.Temperature = tenant.ConversationConfig.Temperature
}
if tenant.ConversationConfig.MaxCompletionTokens > 0 {
@@ -344,7 +344,7 @@ func (h *Handler) fillSummaryConfigDefaults(ctx context.Context, config *types.S
if config.ContextTemplate == "" {
config.ContextTemplate = defaultContextTemplate
}
if config.Temperature == 0 {
if config.Temperature < 0 {
config.Temperature = defaultTemperature
}
if config.MaxCompletionTokens == 0 {