Documentation
¶
Index ¶
- Constants
- func CreateScriptToolSet(ctx context.Context, toolset latest.Toolset, runConfig *config.RuntimeConfig) (tools.ToolSet, error)
- func CreateToolSet(ctx context.Context, toolset latest.Toolset, runConfig *config.RuntimeConfig) (tools.ToolSet, error)
- type RunShellArgs
- type RunShellBackgroundArgs
- type ScriptToolSet
- type StopBackgroundJobArgs
- type ToolSet
- type ViewBackgroundJobArgs
Constants ¶
const ( ToolNameShell = "shell" ToolNameRunShellBackground = "run_background_job" ToolNameListBackgroundJobs = "list_background_jobs" ToolNameViewBackgroundJob = "view_background_job" ToolNameStopBackgroundJob = "stop_background_job" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunShellArgs ¶
type RunShellArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
Timeout int `json:"timeout,omitempty" jsonschema:"Timeout in seconds (default 30)"`
}
func (*RunShellArgs) UnmarshalJSON ¶
func (a *RunShellArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both the canonical "cmd" key and the common alias "command" for the shell command parameter.
The advertised schema still declares "cmd" as the canonical name, but many models (particularly ones biased by Anthropic's built-in bash tool and other ecosystems that use "command") occasionally emit "command" instead. Accepting both prevents a wasted turn on an empty-command error while keeping the canonical contract unchanged. When "cmd" is present with a non-blank value it wins; a blank (empty or whitespace-only) "cmd" falls back to "command" so a valid alias is not silently shadowed.
type RunShellBackgroundArgs ¶
type RunShellBackgroundArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command to run in background"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
}
func (*RunShellBackgroundArgs) UnmarshalJSON ¶
func (a *RunShellBackgroundArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both "cmd" (canonical) and "command" (common alias), mirroring RunShellArgs.UnmarshalJSON. See its comment for rationale.
type ScriptToolSet ¶ added in v1.60.0
type ScriptToolSet struct {
// contains filtered or unexported fields
}
func NewScript ¶ added in v1.60.0
func NewScript(shellTools map[string]latest.ScriptShellToolConfig, env []string) (*ScriptToolSet, error)
func (*ScriptToolSet) Instructions ¶ added in v1.60.0
func (t *ScriptToolSet) Instructions() string
type StopBackgroundJobArgs ¶
type StopBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}
type ToolSet ¶ added in v1.60.0
type ToolSet struct {
// contains filtered or unexported fields
}
ToolSet provides shell command execution capabilities.
func New ¶ added in v1.60.0
func New(env []string, runConfig *config.RuntimeConfig) *ToolSet
New creates a new shell toolset.
func (*ToolSet) Instructions ¶ added in v1.60.0
type ViewBackgroundJobArgs ¶
type ViewBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}