fix: Adjust temperature validation to allow zero as a valid setting and default only for negative values.
This commit is contained in:
@@ -118,7 +118,7 @@ func (s *sessionService) applyAgentOverridesToChatManage(
|
|||||||
cm.SummaryConfig.ContextTemplate = customAgent.Config.ContextTemplate
|
cm.SummaryConfig.ContextTemplate = customAgent.Config.ContextTemplate
|
||||||
logger.Infof(ctx, "Using custom agent's context_template")
|
logger.Infof(ctx, "Using custom agent's context_template")
|
||||||
}
|
}
|
||||||
if customAgent.Config.Temperature > 0 {
|
if customAgent.Config.Temperature >= 0 {
|
||||||
cm.SummaryConfig.Temperature = customAgent.Config.Temperature
|
cm.SummaryConfig.Temperature = customAgent.Config.Temperature
|
||||||
logger.Infof(ctx, "Using custom agent's temperature: %f", customAgent.Config.Temperature)
|
logger.Infof(ctx, "Using custom agent's temperature: %f", customAgent.Config.Temperature)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ func (h *Handler) createDefaultSummaryConfig(ctx context.Context) *types.Summary
|
|||||||
if tenant.ConversationConfig.ContextTemplate != "" {
|
if tenant.ConversationConfig.ContextTemplate != "" {
|
||||||
cfg.ContextTemplate = tenant.ConversationConfig.ContextTemplate
|
cfg.ContextTemplate = tenant.ConversationConfig.ContextTemplate
|
||||||
}
|
}
|
||||||
if tenant.ConversationConfig.Temperature > 0 {
|
if tenant.ConversationConfig.Temperature >= 0 {
|
||||||
cfg.Temperature = tenant.ConversationConfig.Temperature
|
cfg.Temperature = tenant.ConversationConfig.Temperature
|
||||||
}
|
}
|
||||||
if tenant.ConversationConfig.MaxCompletionTokens > 0 {
|
if tenant.ConversationConfig.MaxCompletionTokens > 0 {
|
||||||
@@ -344,7 +344,7 @@ func (h *Handler) fillSummaryConfigDefaults(ctx context.Context, config *types.S
|
|||||||
if config.ContextTemplate == "" {
|
if config.ContextTemplate == "" {
|
||||||
config.ContextTemplate = defaultContextTemplate
|
config.ContextTemplate = defaultContextTemplate
|
||||||
}
|
}
|
||||||
if config.Temperature == 0 {
|
if config.Temperature < 0 {
|
||||||
config.Temperature = defaultTemperature
|
config.Temperature = defaultTemperature
|
||||||
}
|
}
|
||||||
if config.MaxCompletionTokens == 0 {
|
if config.MaxCompletionTokens == 0 {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ func (a *CustomAgent) EnsureDefaults() {
|
|||||||
if a == nil {
|
if a == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if a.Config.Temperature == 0 {
|
if a.Config.Temperature < 0 {
|
||||||
a.Config.Temperature = 0.7
|
a.Config.Temperature = 0.7
|
||||||
}
|
}
|
||||||
if a.Config.MaxIterations == 0 {
|
if a.Config.MaxIterations == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user