fix: resolve OpenRouter migration error and reduce bot rambling by tuning temperature and tool iterations
This commit is contained in:
parent
b89f6445d1
commit
985289a3b7
3 changed files with 5 additions and 5 deletions
|
|
@ -125,7 +125,7 @@ func NewAgentInstance(
|
||||||
maxTokens = 8192
|
maxTokens = 8192
|
||||||
}
|
}
|
||||||
|
|
||||||
temperature := 0.7
|
temperature := 0.1
|
||||||
if defaults.Temperature != nil {
|
if defaults.Temperature != nil {
|
||||||
temperature = *defaults.Temperature
|
temperature = *defaults.Temperature
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ func DefaultConfig() *Config {
|
||||||
Model: "",
|
Model: "",
|
||||||
MaxTokens: 32768,
|
MaxTokens: 32768,
|
||||||
Temperature: nil, // nil means use provider default
|
Temperature: nil, // nil means use provider default
|
||||||
MaxToolIterations: 50,
|
MaxToolIterations: 10,
|
||||||
SummarizeMessageThreshold: 20,
|
SummarizeMessageThreshold: 20,
|
||||||
SummarizeTokenPercent: 75,
|
SummarizeTokenPercent: 75,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ import (
|
||||||
// If the model already contains a "/" (indicating it has a protocol prefix), it is returned as-is.
|
// If the model already contains a "/" (indicating it has a protocol prefix), it is returned as-is.
|
||||||
// Otherwise, the protocol prefix is added.
|
// Otherwise, the protocol prefix is added.
|
||||||
func buildModelWithProtocol(protocol, model string) string {
|
func buildModelWithProtocol(protocol, model string) string {
|
||||||
if strings.Contains(model, "/") {
|
prefix := protocol + "/"
|
||||||
// Model already has a protocol prefix, return as-is
|
if strings.HasPrefix(model, prefix) {
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
return protocol + "/" + model
|
return prefix + model
|
||||||
}
|
}
|
||||||
|
|
||||||
// providerMigrationConfig defines how to migrate a provider from old config to new format.
|
// providerMigrationConfig defines how to migrate a provider from old config to new format.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue