removed duplicated parameters

This commit is contained in:
afjcjsbx 2026-02-20 00:41:16 +01:00
parent 81d5da3a81
commit 198d5f7b7d
3 changed files with 11 additions and 15 deletions

View file

@ -107,7 +107,7 @@ func registerSharedTools(cfg *config.Config, msgBus *bus.MessageBus, registry *A
// Vision tool // Vision tool
if cfg.Tools.Vision.Enabled { if cfg.Tools.Vision.Enabled {
agent.Tools.Register(tools.NewAnalyzeImageTool(cfg.Tools.Vision)) agent.Tools.Register(tools.NewAnalyzeImageTool(cfg.Tools.Vision, cfg.WorkspacePath(), cfg.Agents.Defaults.RestrictToWorkspace))
} }
// Message tool // Message tool

View file

@ -316,12 +316,10 @@ type ExecConfig struct {
} }
type VisionToolConfig struct { type VisionToolConfig struct {
Enabled bool `json:"enabled" env:"PICOCLAW_TOOLS_VISION_ENABLED"` Enabled bool `json:"enabled" env:"PICOCLAW_TOOLS_VISION_ENABLED"`
ApiKey string `json:"api_key" env:"PICOCLAW_TOOLS_VISION_API_KEY"` ApiKey string `json:"api_key" env:"PICOCLAW_TOOLS_VISION_API_KEY"`
ApiURL string `json:"api_url" env:"PICOCLAW_TOOLS_VISION_API_URL"` ApiURL string `json:"api_url" env:"PICOCLAW_TOOLS_VISION_API_URL"`
Model string `json:"model" env:"PICOCLAW_TOOLS_VISION_MODEL"` Model string `json:"model" env:"PICOCLAW_TOOLS_VISION_MODEL"`
Workspace string `json:"workspace" env:"PICOCLAW_TOOLS_VISION_WORKSPACE"`
Restrict bool `json:"restrict" env:"PICOCLAW_TOOLS_VISION_RESTRICT"`
} }
type ToolsConfig struct { type ToolsConfig struct {
@ -450,11 +448,9 @@ func DefaultConfig() *Config {
EnableDenyPatterns: true, EnableDenyPatterns: true,
}, },
Vision: VisionToolConfig{ Vision: VisionToolConfig{
Enabled: false, Enabled: false,
ApiURL: "", ApiURL: "",
Model: "gpt-4o-mini", Model: "gpt-4o-mini",
Restrict: true,
Workspace: "",
}, },
}, },
Heartbeat: HeartbeatConfig{ Heartbeat: HeartbeatConfig{

View file

@ -31,10 +31,10 @@ type AnalyzeImageTool struct {
restrict bool restrict bool
} }
func NewAnalyzeImageTool(opts config.VisionToolConfig) *AnalyzeImageTool { func NewAnalyzeImageTool(opts config.VisionToolConfig, workspace string, restrict bool) *AnalyzeImageTool {
return &AnalyzeImageTool{ return &AnalyzeImageTool{
workspace: opts.Workspace, workspace: workspace,
restrict: opts.Restrict, restrict: restrict,
apiKey: opts.ApiKey, apiKey: opts.ApiKey,
apiURL: opts.ApiURL, apiURL: opts.ApiURL,
model: opts.Model, model: opts.Model,