Documentation
¶
Overview ¶
Package subagent lets a model delegate tasks to sub-agents, which work on them in contexts of their own and report back. A call of its tool runs one agent, several in parallel, a chain of them, or one in the background.
Index ¶
Constants ¶
View Source
const MaxDepth = 5
MaxDepth caps how deep sub-agents nest: the main agent is at depth 0, an agent it spawns at 1. A host that gives sub-agents the subagent tool relies on it to stop runaway recursion.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶ added in v1.8.5
type Agent struct {
Name string
Description string
// Config configures a run of the agent; an error fails the run. Each run
// gets a configuration of its own, so that its tools keep state of their
// own. The run's events go to its Emit, and to the tool call waiting for
// it as Progress. The runs of a parallel call work at once: the Emits
// of their Configs are called concurrently.
Config func(Spawn) (agentcore.Config, error)
}
Agent is a sub-agent the model may delegate to.
Click to show internal directories.
Click to hide internal directories.