Merge branch 'fix/default-model-should-use-model-list' into dev
# Conflicts: # pkg/providers/legacy_provider.go
This commit is contained in:
commit
3b66929f7d
2 changed files with 10 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ func DefaultConfig() *Config {
|
||||||
Workspace: "~/.picoclaw/workspace",
|
Workspace: "~/.picoclaw/workspace",
|
||||||
RestrictToWorkspace: true,
|
RestrictToWorkspace: true,
|
||||||
Provider: "",
|
Provider: "",
|
||||||
Model: "glm-4.7",
|
Model: "", // Require explicit model specification
|
||||||
MaxTokens: 8192,
|
MaxTokens: 8192,
|
||||||
Temperature: nil, // nil means use provider default
|
Temperature: nil, // nil means use provider default
|
||||||
MaxToolIterations: 20,
|
MaxToolIterations: 20,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, string, error) {
|
||||||
return nil, "", fmt.Errorf("no providers configured. Please add entries to model_list in your config")
|
return nil, "", fmt.Errorf("no providers configured. Please add entries to model_list in your config")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no model is specified, use the first model from model_list
|
||||||
|
if model == "" {
|
||||||
|
if len(cfg.ModelList) > 0 {
|
||||||
|
model = cfg.ModelList[0].ModelName
|
||||||
|
} else {
|
||||||
|
return nil, "", fmt.Errorf("no model specified and no models in model_list. Please set model_name in agents.defaults or add models to model_list")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Collect models to try: primary first, then fallbacks
|
// Collect models to try: primary first, then fallbacks
|
||||||
modelsToTry := []string{model}
|
modelsToTry := []string{model}
|
||||||
modelsToTry = append(modelsToTry, cfg.Agents.Defaults.ModelFallbacks...)
|
modelsToTry = append(modelsToTry, cfg.Agents.Defaults.ModelFallbacks...)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue