mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge branch 'main' into fix-formatting
# Conflicts: # pkg/agent/loop.go # pkg/agent/loop_test.go # pkg/channels/discord.go # pkg/channels/onebot.go # pkg/config/config.go # pkg/tools/subagent_tool_test.go
This commit is contained in:
@@ -76,7 +76,7 @@ func ConvertConfig(data map[string]any) (*config.Config, []string, error) {
|
||||
cfg.Agents.Defaults.MaxTokens = int(v)
|
||||
}
|
||||
if v, ok := getFloat(defaults, "temperature"); ok {
|
||||
cfg.Agents.Defaults.Temperature = v
|
||||
cfg.Agents.Defaults.Temperature = &v
|
||||
}
|
||||
if v, ok := getFloat(defaults, "max_tool_iterations"); ok {
|
||||
cfg.Agents.Defaults.MaxToolIterations = int(v)
|
||||
|
||||
@@ -275,8 +275,11 @@ func TestConvertConfig(t *testing.T) {
|
||||
if cfg.Agents.Defaults.MaxTokens != 4096 {
|
||||
t.Errorf("MaxTokens = %d, want %d", cfg.Agents.Defaults.MaxTokens, 4096)
|
||||
}
|
||||
if cfg.Agents.Defaults.Temperature != 0.5 {
|
||||
t.Errorf("Temperature = %f, want %f", cfg.Agents.Defaults.Temperature, 0.5)
|
||||
if cfg.Agents.Defaults.Temperature == nil {
|
||||
t.Fatalf("Temperature is nil, want %f", 0.5)
|
||||
}
|
||||
if *cfg.Agents.Defaults.Temperature != 0.5 {
|
||||
t.Errorf("Temperature = %f, want %f", *cfg.Agents.Defaults.Temperature, 0.5)
|
||||
}
|
||||
if cfg.Agents.Defaults.Workspace != "~/.picoclaw/workspace" {
|
||||
t.Errorf("Workspace = %q, want %q", cfg.Agents.Defaults.Workspace, "~/.picoclaw/workspace")
|
||||
|
||||
Reference in New Issue
Block a user