Documentation
¶
Index ¶
- Constants
- func ConvertYAMLSchemaToResponseFormat(config *ResponseFormatConfig) (*interfaces.ResponseFormat, error)
- func CreateMemoryFromConfig(memoryConfig map[string]interface{}, llmClient interfaces.LLM) (interfaces.Memory, error)
- func ExpandEnv(s string) string
- func FormatSystemPromptFromConfig(config AgentConfig, variables map[string]string) string
- func ForwardOptionalToolInterfaces(inner interfaces.Tool) (displayName string, internal bool)
- func GenerateConfigFromSystemPrompt(ctx context.Context, llm interfaces.LLM, systemPrompt string) (AgentConfig, []TaskConfig, error)
- func GetAgentForTask(taskConfigs TaskConfigs, taskName string) (string, error)
- func GetEnvValue(key string) string
- func GetInvocationID(ctx context.Context) string
- func GetParentAgent(ctx context.Context) string
- func GetRecursionDepth(ctx context.Context) int
- func GetSubAgentName(ctx context.Context) string
- func IsSubAgentCall(ctx context.Context) bool
- func LoadEnvFile(path string) error
- func NewAgentCreationError(agentName, source string, err error) error
- func SaveAgentConfigsToFile(configs AgentConfigs, file *os.File) error
- func SaveMCPConfigToJSON(config *MCPConfiguration, filePath string) error
- func SaveMCPConfigToYAML(config *MCPConfiguration, filePath string) error
- func SaveTaskConfigsToFile(configs TaskConfigs, file *os.File) error
- func UnwrapTool(t interfaces.Tool) interfaces.Tool
- func ValidateConfigPath(path string) error
- func ValidateMCPConfig(config *MCPConfiguration) error
- func ValidateRecursionDepth(ctx context.Context) error
- func WithSubAgentContext(ctx context.Context, parentAgent, subAgentName string) context.Context
- func WithTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- type Agent
- func CreateAgentForTask(taskName string, agentConfigs AgentConfigs, taskConfigs TaskConfigs, ...) (*Agent, error)
- func NewAgent(options ...Option) (*Agent, error)
- func NewAgentFromConfig(agentName string, configs AgentConfigs, variables map[string]string, ...) (*Agent, error)
- func NewAgentFromConfigObject(ctx context.Context, config *AgentConfig, variables map[string]string, ...) (*Agent, error)
- func NewAgentFromCreateConfig(ctx context.Context, config CreateAgentConfig) (*Agent, error)
- func NewAgentFromFile(ctx context.Context, configPath string, options ...Option) (*Agent, error)
- func NewAgentFromFileWithName(ctx context.Context, configPath, agentName string, options ...Option) (*Agent, error)
- func NewAgentFromLocalConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
- func NewAgentFromRemoteConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
- func NewAgentWithAutoConfig(ctx context.Context, options ...Option) (*Agent, error)
- func NewAgentWithDualConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
- func (a *Agent) ApproveExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan) (string, error)
- func (a *Agent) Disconnect() error
- func (a *Agent) ExecuteTaskFromConfig(ctx context.Context, taskName string, taskConfigs TaskConfigs, ...) (string, error)
- func (a *Agent) GenerateExecutionPlan(ctx context.Context, input string) (*executionplan.ExecutionPlan, error)
- func (a *Agent) GetAllConversations(ctx context.Context) ([]string, error)
- func (a *Agent) GetCapabilities() string
- func (a *Agent) GetConfig() *AgentConfig
- func (a *Agent) GetConversationMessages(ctx context.Context, conversationID string) ([]interfaces.Message, error)
- func (a *Agent) GetDataStore() interfaces.DataStore
- func (a *Agent) GetDescription() string
- func (a *Agent) GetGeneratedAgentConfig() *AgentConfig
- func (a *Agent) GetGeneratedTaskConfigs() TaskConfigs
- func (a *Agent) GetGraphRAGStore() interfaces.GraphRAGStore
- func (a *Agent) GetLLM() interfaces.LLM
- func (a *Agent) GetLogger() logging.Logger
- func (a *Agent) GetMemory() interfaces.Memory
- func (a *Agent) GetMemoryConfig() map[string]interface{}
- func (a *Agent) GetMemoryStatistics(ctx context.Context) (totalConversations, totalMessages int, err error)
- func (a *Agent) GetName() string
- func (a *Agent) GetRemoteMetadata() (map[string]string, error)
- func (a *Agent) GetRemoteURL() string
- func (a *Agent) GetSubAgent(name string) (*Agent, bool)
- func (a *Agent) GetSubAgents() []*Agent
- func (a *Agent) GetSystemPrompt() string
- func (a *Agent) GetTaskByID(taskID string) (*executionplan.ExecutionPlan, bool)
- func (a *Agent) GetTools() []interfaces.Tool
- func (a *Agent) GetTracer() interfaces.Tracer
- func (a *Agent) HasGraphRAG() bool
- func (a *Agent) HasSubAgent(name string) bool
- func (a *Agent) IsRemote() bool
- func (a *Agent) ListTasks() []*executionplan.ExecutionPlan
- func (a *Agent) ModifyExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan, modifications string) (*executionplan.ExecutionPlan, error)
- func (a *Agent) Run(ctx context.Context, input string) (string, error)
- func (a *Agent) RunDetailed(ctx context.Context, input string) (*interfaces.AgentResponse, error)
- func (a *Agent) RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)
- func (a *Agent) RunStreamWithAuth(ctx context.Context, input string, authToken string) (<-chan interfaces.AgentStreamEvent, error)
- func (a *Agent) RunWithAuth(ctx context.Context, input string, authToken string) (string, error)
- func (a *Agent) RunWithAuthDetailed(ctx context.Context, input string, authToken string) (*interfaces.AgentResponse, error)
- func (a *Agent) RunWithContent(ctx context.Context, content *interfaces.Content) (string, error)
- func (a *Agent) RunWithContentDetailed(ctx context.Context, content *interfaces.Content) (*interfaces.AgentResponse, error)
- func (a *Agent) RunWithContentStream(ctx context.Context, content *interfaces.Content) (<-chan interfaces.AgentStreamEvent, error)
- func (a *Agent) SetDataStore(datastore interfaces.DataStore)
- type AgentConfig
- type AgentConfigs
- type AgentCreationError
- type AgentToolWrapper
- func (atw *AgentToolWrapper) Description() string
- func (atw *AgentToolWrapper) Execute(ctx context.Context, args string) (string, error)
- func (atw *AgentToolWrapper) Name() string
- func (atw *AgentToolWrapper) Parameters() map[string]interfaces.ParameterSpec
- func (atw *AgentToolWrapper) Run(ctx context.Context, input string) (string, error)
- type CacheConfigYAML
- type ConfigSourceMetadata
- type CreateAgentConfig
- type CreateOption
- type CustomRunFunction
- type CustomRunStreamFunction
- type GCSStorageYAML
- type ImageGenerationYAML
- type ImageStorageYAML
- type LLMConfigYAML
- type LLMProviderYAML
- type LazyMCPConfig
- type LazyMCPToolConfig
- type LocalStorageYAML
- type MCPConfiguration
- type MCPDiscoveredCapabilities
- type MCPDiscoveredServerInfo
- type MCPGlobalConfig
- type MCPServerConfig
- type MemoryConfigYAML
- type MultiTurnEditingYAML
- type Option
- func WithAgentConfig(config AgentConfig, variables map[string]string) Option
- func WithAgents(subAgents ...*Agent) Option
- func WithCacheConfig(config interfaces.CacheConfig) Option
- func WithConfigFile(filePath, agentName string) Option
- func WithCustomRunFunction(fn CustomRunFunction) Option
- func WithCustomRunStreamFunction(fn CustomRunStreamFunction) Option
- func WithDataStore(datastore interfaces.DataStore) Option
- func WithDescription(description string) Option
- func WithDisableFinalSummary(disable bool) Option
- func WithGraphRAG(store interfaces.GraphRAGStore) Option
- func WithGuardrails(guardrails interfaces.Guardrails) Option
- func WithLLM(llm interfaces.LLM) Option
- func WithLLMConfig(config interfaces.LLMConfig) Option
- func WithLazyMCPConfigs(configs []LazyMCPConfig) Option
- func WithLogger(logger logging.Logger) Option
- func WithMCPCommandExecutor(executor mcp.CommandExecutor) Option
- func WithMCPConfig(config *MCPConfiguration) Option
- func WithMCPConfigFromJSON(filePath string) Option
- func WithMCPConfigFromYAML(filePath string) Option
- func WithMCPPresets(presetNames ...string) Option
- func WithMCPServers(mcpServers []interfaces.MCPServer) Option
- func WithMCPURLs(urls ...string) Option
- func WithMaxIterations(maxIterations int) Option
- func WithMemory(memory interfaces.Memory) Option
- func WithName(name string) Option
- func WithOrgID(orgID string) Option
- func WithRemoteTimeout(timeout time.Duration) Option
- func WithRequirePlanApproval(require bool) Option
- func WithResponseFormat(formatType interfaces.ResponseFormat) Option
- func WithStreamConfig(config *interfaces.StreamConfig) Option
- func WithSystemPrompt(prompt string) Option
- func WithToolDecorator(decorate ToolDecorator) Option
- func WithTools(tools ...interfaces.Tool) Option
- func WithTracer(tracer interfaces.Tracer) Option
- func WithURL(url string) Option
- type ResponseFormatConfig
- type RuntimeConfigYAML
- type StreamConfigYAML
- type SubAgentContext
- type TaskConfig
- type TaskConfigs
- type ToolConfigYAML
- type ToolDecorator
- type ToolFactory
- func (tf *ToolFactory) CreateTool(config ToolConfigYAML) (interfaces.Tool, error)
- func (tf *ToolFactory) CreateToolWithParentConfig(config ToolConfigYAML, parentConfig *AgentConfig) (interfaces.Tool, error)
- func (tf *ToolFactory) RegisterCustomTool(name string, factory func(map[string]interface{}) (interfaces.Tool, error))
- type ToolUnwrapper
Constants ¶
const ( // MaxRecursionDepth is the maximum allowed sub-agent recursion depth. MaxRecursionDepth = tools.MaxRecursionDepth // DefaultSubAgentTimeout is the default timeout for sub-agent calls. DefaultSubAgentTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ConvertYAMLSchemaToResponseFormat ¶ added in v0.0.24
func ConvertYAMLSchemaToResponseFormat(config *ResponseFormatConfig) (*interfaces.ResponseFormat, error)
ConvertYAMLSchemaToResponseFormat converts a ResponseFormatConfig to interfaces.ResponseFormat
func CreateMemoryFromConfig ¶ added in v0.2.4
func CreateMemoryFromConfig(memoryConfig map[string]interface{}, llmClient interfaces.LLM) (interfaces.Memory, error)
CreateMemoryFromConfig creates a memory instance from YAML configuration This function is intended to be used by agent-blueprint applications that need to instantiate memory from YAML config stored in the agent
func ExpandEnv ¶ added in v0.2.4
ExpandEnv expands environment variables, checking both actual env vars and .env file This replaces os.ExpandEnv to support .env files
func FormatSystemPromptFromConfig ¶ added in v0.0.3
func FormatSystemPromptFromConfig(config AgentConfig, variables map[string]string) string
FormatSystemPromptFromConfig formats a system prompt based on the agent configuration
func ForwardOptionalToolInterfaces ¶ added in v0.2.71
func ForwardOptionalToolInterfaces(inner interfaces.Tool) (displayName string, internal bool)
ForwardOptionalToolInterfaces reports the optional-interface values a decorator should expose on behalf of the tool it wraps.
interfaces.Tool is four methods, but tools may additionally implement ToolWithDisplayName and InternalTool, and those are discovered by type assertion. A decorator that does not forward them silently changes how the tool is presented. Each decorator previously hand-rolled this; doing it once means a newly added optional interface is handled in one place.
func GenerateConfigFromSystemPrompt ¶ added in v0.0.3
func GenerateConfigFromSystemPrompt(ctx context.Context, llm interfaces.LLM, systemPrompt string) (AgentConfig, []TaskConfig, error)
GenerateConfigFromSystemPrompt uses the LLM to generate agent and task configurations from a system prompt
func GetAgentForTask ¶ added in v0.0.3
func GetAgentForTask(taskConfigs TaskConfigs, taskName string) (string, error)
GetAgentForTask returns the agent name for a given task
func GetEnvValue ¶ added in v0.2.4
GetEnvValue gets an environment variable value from either env or .env cache
func GetInvocationID ¶ added in v0.0.26
GetInvocationID retrieves the invocation ID from context.
func GetParentAgent ¶ added in v0.0.26
GetParentAgent retrieves the parent agent from context.
func GetRecursionDepth ¶ added in v0.0.26
GetRecursionDepth retrieves the current recursion depth from context.
func GetSubAgentName ¶ added in v0.0.26
GetSubAgentName retrieves the sub-agent name from context.
func IsSubAgentCall ¶ added in v0.0.26
IsSubAgentCall checks if the current context is a sub-agent call.
func LoadEnvFile ¶ added in v0.2.4
LoadEnvFile explicitly loads a .env file into the cache This can be called by applications to ensure a specific .env file is loaded
func NewAgentCreationError ¶ added in v0.2.10
NewAgentCreationError creates a new agent creation error
func SaveAgentConfigsToFile ¶ added in v0.0.3
func SaveAgentConfigsToFile(configs AgentConfigs, file *os.File) error
SaveAgentConfigsToFile saves agent configurations to a YAML file
func SaveMCPConfigToJSON ¶ added in v0.1.14
func SaveMCPConfigToJSON(config *MCPConfiguration, filePath string) error
SaveMCPConfigToJSON saves MCP configuration to a JSON file
func SaveMCPConfigToYAML ¶ added in v0.1.14
func SaveMCPConfigToYAML(config *MCPConfiguration, filePath string) error
SaveMCPConfigToYAML saves MCP configuration to a YAML file
func SaveTaskConfigsToFile ¶ added in v0.0.3
func SaveTaskConfigsToFile(configs TaskConfigs, file *os.File) error
SaveTaskConfigsToFile saves task configurations to a YAML file
func UnwrapTool ¶ added in v0.2.71
func UnwrapTool(t interfaces.Tool) interfaces.Tool
UnwrapTool walks a chain of ToolUnwrapper decorators and returns the innermost tool.
func ValidateConfigPath ¶ added in v0.2.10
ValidateConfigPath validates that a configuration file path is safe
func ValidateMCPConfig ¶ added in v0.1.14
func ValidateMCPConfig(config *MCPConfiguration) error
ValidateMCPConfig validates an MCP configuration
func ValidateRecursionDepth ¶ added in v0.0.26
ValidateRecursionDepth checks if the recursion depth is within limits.
func WithSubAgentContext ¶ added in v0.0.26
WithSubAgentContext adds sub-agent context to the context, incrementing the recursion depth that AgentTool.Execute enforces.
func WithTimeout ¶ added in v0.0.26
WithTimeout adds a timeout to the context for sub-agent calls.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent represents an AI agent
func CreateAgentForTask ¶ added in v0.0.3
func CreateAgentForTask(taskName string, agentConfigs AgentConfigs, taskConfigs TaskConfigs, variables map[string]string, options ...Option) (*Agent, error)
CreateAgentForTask creates a new agent for a specific task
func NewAgentFromConfig ¶ added in v0.0.3
func NewAgentFromConfig(agentName string, configs AgentConfigs, variables map[string]string, options ...Option) (*Agent, error)
NewAgentFromConfig creates a new agent from a YAML configuration
func NewAgentFromConfigObject ¶ added in v0.2.10
func NewAgentFromConfigObject(ctx context.Context, config *AgentConfig, variables map[string]string, options ...Option) (*Agent, error)
NewAgentFromConfigObject creates an agent from a pre-loaded AgentConfig object This is useful when you already have a loaded configuration from any source
func NewAgentFromCreateConfig ¶ added in v0.2.10
func NewAgentFromCreateConfig(ctx context.Context, config CreateAgentConfig) (*Agent, error)
NewAgentFromCreateConfig creates an agent using a structured configuration This provides a single entry point with all options
func NewAgentFromFile ¶ added in v0.2.10
NewAgentFromFile creates an agent from a specific local YAML file This is backward compatible with existing usage
func NewAgentFromFileWithName ¶ added in v0.2.10
func NewAgentFromFileWithName(ctx context.Context, configPath, agentName string, options ...Option) (*Agent, error)
NewAgentFromFileWithName creates an agent from a specific local YAML file with agent name
func NewAgentFromLocalConfig ¶ added in v0.2.10
func NewAgentFromLocalConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
NewAgentFromLocalConfig creates an agent using only local YAML files
func NewAgentFromRemoteConfig ¶ added in v0.2.10
func NewAgentFromRemoteConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
NewAgentFromRemoteConfig creates an agent using only remote configuration
func NewAgentWithAutoConfig ¶ added in v0.0.3
NewAgentWithAutoConfig creates a new agent with automatic configuration generation based on the system prompt if explicit configuration is not provided
func NewAgentWithDualConfig ¶ added in v0.2.10
func NewAgentWithDualConfig(ctx context.Context, agentName, environment string, options ...Option) (*Agent, error)
NewAgentWithDualConfig creates an agent with automatic configuration source detection This is the recommended entry point for new applications using centralized config management
func (*Agent) ApproveExecutionPlan ¶ added in v0.0.2
func (a *Agent) ApproveExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan) (string, error)
ApproveExecutionPlan approves an execution plan for execution
func (*Agent) Disconnect ¶ added in v0.0.26
Disconnect closes the connection to a remote agent
func (*Agent) ExecuteTaskFromConfig ¶ added in v0.0.3
func (a *Agent) ExecuteTaskFromConfig(ctx context.Context, taskName string, taskConfigs TaskConfigs, variables map[string]string) (string, error)
ExecuteTaskFromConfig executes a task using its YAML configuration
func (*Agent) GenerateExecutionPlan ¶ added in v0.0.2
func (a *Agent) GenerateExecutionPlan(ctx context.Context, input string) (*executionplan.ExecutionPlan, error)
GenerateExecutionPlan generates an execution plan
func (*Agent) GetAllConversations ¶ added in v0.1.7
GetAllConversations returns all conversation IDs from memory
func (*Agent) GetCapabilities ¶ added in v0.0.20
GetCapabilities returns a description of what the agent can do
func (*Agent) GetConfig ¶ added in v0.2.10
func (a *Agent) GetConfig() *AgentConfig
GetConfig returns the agent's configuration for inspection
func (*Agent) GetConversationMessages ¶ added in v0.1.7
func (a *Agent) GetConversationMessages(ctx context.Context, conversationID string) ([]interfaces.Message, error)
GetConversationMessages gets all messages for a specific conversation
func (*Agent) GetDataStore ¶ added in v0.2.23
func (a *Agent) GetDataStore() interfaces.DataStore
GetDataStore returns the datastore instance
func (*Agent) GetDescription ¶ added in v0.0.20
GetDescription returns the description of the agent
func (*Agent) GetGeneratedAgentConfig ¶ added in v0.0.3
func (a *Agent) GetGeneratedAgentConfig() *AgentConfig
GetGeneratedAgentConfig returns the automatically generated agent configuration, if any
func (*Agent) GetGeneratedTaskConfigs ¶ added in v0.0.3
func (a *Agent) GetGeneratedTaskConfigs() TaskConfigs
GetGeneratedTaskConfigs returns the automatically generated task configurations, if any
func (*Agent) GetGraphRAGStore ¶ added in v0.2.28
func (a *Agent) GetGraphRAGStore() interfaces.GraphRAGStore
GetGraphRAGStore returns the GraphRAG store if configured. Returns nil if GraphRAG is not enabled.
func (*Agent) GetLLM ¶ added in v0.0.43
func (a *Agent) GetLLM() interfaces.LLM
GetLLM returns the LLM instance (for use in custom functions)
func (*Agent) GetLogger ¶ added in v0.0.43
GetLogger returns the logger instance (for use in custom functions)
func (*Agent) GetMemory ¶ added in v0.0.43
func (a *Agent) GetMemory() interfaces.Memory
GetMemory returns the memory instance (for use in custom functions)
func (*Agent) GetMemoryConfig ¶ added in v0.2.4
GetMemoryConfig returns the stored memory configuration from YAML This allows agent-blueprint to access the memory config for instantiation
func (*Agent) GetMemoryStatistics ¶ added in v0.1.7
func (a *Agent) GetMemoryStatistics(ctx context.Context) (totalConversations, totalMessages int, err error)
GetMemoryStatistics returns basic memory statistics
func (*Agent) GetRemoteMetadata ¶ added in v0.1.7
GetRemoteMetadata returns metadata for remote agents, nil for local agents
func (*Agent) GetRemoteURL ¶ added in v0.0.26
GetRemoteURL returns the URL of the remote agent (empty string if not remote)
func (*Agent) GetSubAgent ¶ added in v0.0.26
GetSubAgent retrieves a sub-agent by name
func (*Agent) GetSubAgents ¶ added in v0.0.26
GetSubAgents returns the sub-agents slice
func (*Agent) GetSystemPrompt ¶ added in v0.0.43
GetSystemPrompt returns the system prompt (for use in custom functions)
func (*Agent) GetTaskByID ¶ added in v0.0.2
func (a *Agent) GetTaskByID(taskID string) (*executionplan.ExecutionPlan, bool)
GetTaskByID returns a task by its ID
func (*Agent) GetTools ¶ added in v0.0.43
func (a *Agent) GetTools() []interfaces.Tool
GetTools returns the tools slice (for use in custom functions)
func (*Agent) GetTracer ¶ added in v0.0.43
func (a *Agent) GetTracer() interfaces.Tracer
GetTracer returns the tracer instance (for use in custom functions)
func (*Agent) HasGraphRAG ¶ added in v0.2.28
HasGraphRAG returns true if the agent has GraphRAG capabilities enabled.
func (*Agent) HasSubAgent ¶ added in v0.0.26
HasSubAgent checks if a specific agent is a sub-agent
func (*Agent) ListTasks ¶ added in v0.0.2
func (a *Agent) ListTasks() []*executionplan.ExecutionPlan
ListTasks returns a list of all tasks
func (*Agent) ModifyExecutionPlan ¶ added in v0.0.2
func (a *Agent) ModifyExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan, modifications string) (*executionplan.ExecutionPlan, error)
ModifyExecutionPlan modifies an execution plan based on user input
func (*Agent) Run ¶
Run runs the agent with the given input. For input with media, such as images, use RunWithContent.
func (*Agent) RunDetailed ¶ added in v0.1.13
func (a *Agent) RunDetailed(ctx context.Context, input string) (*interfaces.AgentResponse, error)
func (*Agent) RunStream ¶ added in v0.0.34
func (a *Agent) RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)
RunStream executes the agent with streaming response. For input with media, such as images, use RunWithContentStream.
func (*Agent) RunStreamWithAuth ¶ added in v0.0.35
func (a *Agent) RunStreamWithAuth(ctx context.Context, input string, authToken string) (<-chan interfaces.AgentStreamEvent, error)
RunStreamWithAuth executes the agent with streaming response and explicit auth token
func (*Agent) RunWithAuth ¶ added in v0.0.29
func (*Agent) RunWithAuthDetailed ¶ added in v0.1.13
func (a *Agent) RunWithAuthDetailed(ctx context.Context, input string, authToken string) (*interfaces.AgentResponse, error)
func (*Agent) RunWithContent ¶ added in v0.2.84
RunWithContent runs the agent with a multipart input, such as text and an image, the way Google ADK's runner.Run takes a genai.Content:
answer, err := a.RunWithContent(ctx, interfaces.NewContentFromParts([]*interfaces.Part{
interfaces.NewPartFromBytes(png, "image/png"),
interfaces.NewPartFromText("What is in this picture?"),
}, interfaces.MessageRoleUser))
The role must be user or empty. Run(ctx, input) is RunWithContent with one text part.
With memory set, the agent stores the content with its parts, so later turns in the conversation still show the model its media. A provider that cannot send a part returns an error that wraps interfaces.ErrContentUnsupported, and the agent then removes the refused message from memory again, so later turns in the conversation do not replay it. That needs a memory that implements interfaces.MessageRemover, as the ones in pkg/memory do. Custom run functions and remote agents take text only, and return the same error for content with media.
func (*Agent) RunWithContentDetailed ¶ added in v0.2.84
func (a *Agent) RunWithContentDetailed(ctx context.Context, content *interfaces.Content) (*interfaces.AgentResponse, error)
RunWithContentDetailed is RunWithContent with token usage and execution details.
func (*Agent) RunWithContentStream ¶ added in v0.2.84
func (a *Agent) RunWithContentStream(ctx context.Context, content *interfaces.Content) (<-chan interfaces.AgentStreamEvent, error)
RunWithContentStream is the streaming form of RunWithContent. Custom stream functions and remote agents take text only.
func (*Agent) SetDataStore ¶ added in v0.2.23
func (a *Agent) SetDataStore(datastore interfaces.DataStore)
SetDataStore sets the datastore for the agent
type AgentConfig ¶ added in v0.0.3
type AgentConfig struct {
Role string `yaml:"role"`
Goal string `yaml:"goal"`
Backstory string `yaml:"backstory"`
ResponseFormat *ResponseFormatConfig `yaml:"response_format,omitempty"`
MCP *MCPConfiguration `yaml:"mcp,omitempty"`
// NEW: Behavioral settings
MaxIterations *int `yaml:"max_iterations,omitempty"`
DisableFinalSummary *bool `yaml:"disable_final_summary,omitempty"`
RequirePlanApproval *bool `yaml:"require_plan_approval,omitempty"`
// NEW: Complex configuration objects
StreamConfig *StreamConfigYAML `yaml:"stream_config,omitempty"`
LLMConfig *LLMConfigYAML `yaml:"llm_config,omitempty"`
CacheConfig *CacheConfigYAML `yaml:"cache_config,omitempty"`
// NEW: LLM Provider configuration
LLMProvider *LLMProviderYAML `yaml:"llm_provider,omitempty"`
// NEW: Tool configurations
Tools []ToolConfigYAML `yaml:"tools,omitempty"`
// NEW: Memory configuration (config only)
Memory *MemoryConfigYAML `yaml:"memory,omitempty"`
// NEW: Runtime settings
Runtime *RuntimeConfigYAML `yaml:"runtime,omitempty"`
// NEW: Image generation configuration
ImageGeneration *ImageGenerationYAML `yaml:"image_generation,omitempty"`
// NEW: Sub-agents configuration (recursive)
SubAgents map[string]AgentConfig `yaml:"sub_agents,omitempty"`
// NEW: Configuration source metadata
ConfigSource *ConfigSourceMetadata `yaml:"config_source,omitempty" json:"config_source,omitempty"`
}
AgentConfig represents the configuration for an agent loaded from YAML
func ExpandAgentConfig ¶ added in v0.2.10
func ExpandAgentConfig(config AgentConfig) AgentConfig
ExpandAgentConfig expands environment variables in agent configuration. Environment variables in the config are expanded with the following priority:
- ConfigSource.Variables (from config service - highest priority)
- OS environment variables
- .env file cache (lowest priority)
type AgentConfigs ¶ added in v0.0.3
type AgentConfigs map[string]AgentConfig
AgentConfigs represents a map of agent configurations
func LoadAgentConfigsFromDir ¶ added in v0.0.3
func LoadAgentConfigsFromDir(dirPath string) (AgentConfigs, error)
LoadAgentConfigsFromDir loads all agent configurations from YAML files in a directory
func LoadAgentConfigsFromFile ¶ added in v0.0.3
func LoadAgentConfigsFromFile(filePath string) (AgentConfigs, error)
LoadAgentConfigsFromFile loads agent configurations from a YAML file
type AgentCreationError ¶ added in v0.2.10
AgentCreationError represents errors that occur during agent creation
func (*AgentCreationError) Error ¶ added in v0.2.10
func (e *AgentCreationError) Error() string
func (*AgentCreationError) Unwrap ¶ added in v0.2.10
func (e *AgentCreationError) Unwrap() error
type AgentToolWrapper ¶ added in v0.2.4
type AgentToolWrapper struct {
// contains filtered or unexported fields
}
AgentToolWrapper is a simple wrapper for agent tools (placeholder implementation) This would normally use the actual tools.AgentTool implementation
func (*AgentToolWrapper) Description ¶ added in v0.2.4
func (atw *AgentToolWrapper) Description() string
Description implements interfaces.Tool.Description
func (*AgentToolWrapper) Name ¶ added in v0.2.4
func (atw *AgentToolWrapper) Name() string
Name implements interfaces.Tool.Name
func (*AgentToolWrapper) Parameters ¶ added in v0.2.4
func (atw *AgentToolWrapper) Parameters() map[string]interfaces.ParameterSpec
Parameters implements interfaces.Tool.Parameters
type CacheConfigYAML ¶ added in v0.2.40
type CacheConfigYAML struct {
CacheSystemMessage *bool `yaml:"cache_system_message,omitempty"`
CacheTools *bool `yaml:"cache_tools,omitempty"`
CacheConversation *bool `yaml:"cache_conversation,omitempty"`
}
CacheConfigYAML represents prompt caching configuration in YAML (Anthropic only) The cache_ttl key is no longer read: extended (1h) cache TTL requires an anthropic-beta header this client does not send, so it never took effect. Existing configs carrying it continue to load; the key is ignored.
type ConfigSourceMetadata ¶ added in v0.2.10
type ConfigSourceMetadata struct {
Type string `yaml:"type" json:"type"` // "local", "remote"
Source string `yaml:"source" json:"source"` // file path or service URL
AgentID string `yaml:"agent_id,omitempty" json:"agent_id,omitempty"`
AgentName string `yaml:"agent_name,omitempty" json:"agent_name,omitempty"`
Environment string `yaml:"environment,omitempty" json:"environment,omitempty"`
Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty"`
LoadedAt time.Time `yaml:"loaded_at" json:"loaded_at"`
}
ConfigSourceMetadata tracks where a configuration was loaded from
type CreateAgentConfig ¶ added in v0.2.10
type CreateAgentConfig struct {
// Source configuration
AgentName string
Environment string
ConfigPath string // For local file loading
// Loading options
PreferRemote bool
AllowFallback bool
CacheTimeout time.Duration
EnableEnvOverrides bool
Verbose bool
// Agent options
MaxIterations *int
RequirePlanApproval *bool
CustomOptions []Option
}
CreateAgentConfig represents options for creating agents from configuration
type CreateOption ¶ added in v0.2.10
CreateOption represents functional options for agent creation
type CustomRunFunction ¶ added in v0.0.43
CustomRunFunction represents a custom function that can replace the default Run behavior
type CustomRunStreamFunction ¶ added in v0.0.43
type CustomRunStreamFunction func(ctx context.Context, input string, agent *Agent) (<-chan interfaces.AgentStreamEvent, error)
CustomRunStreamFunction represents a custom function that can replace the default RunStream behavior
type GCSStorageYAML ¶ added in v0.2.35
type GCSStorageYAML struct {
Bucket string `yaml:"bucket,omitempty"`
Prefix string `yaml:"prefix,omitempty"`
CredentialsFile string `yaml:"credentials_file,omitempty"`
CredentialsJSON string `yaml:"credentials_json,omitempty"`
SignedURLExpiration string `yaml:"signed_url_expiration,omitempty"`
}
GCSStorageYAML represents GCS storage configuration in YAML
type ImageGenerationYAML ¶ added in v0.2.35
type ImageGenerationYAML struct {
Enabled *bool `yaml:"enabled,omitempty"`
Provider string `yaml:"provider,omitempty"` // "gemini"
Model string `yaml:"model,omitempty"` // e.g., "gemini-2.5-flash-image"
Config map[string]interface{} `yaml:"config,omitempty"`
Storage *ImageStorageYAML `yaml:"storage,omitempty"`
MultiTurnEditing *MultiTurnEditingYAML `yaml:"multi_turn_editing,omitempty"`
}
ImageGenerationYAML represents image generation configuration in YAML
type ImageStorageYAML ¶ added in v0.2.35
type ImageStorageYAML struct {
Type string `yaml:"type,omitempty"` // "local", "gcs"
Local *LocalStorageYAML `yaml:"local,omitempty"`
GCS *GCSStorageYAML `yaml:"gcs,omitempty"`
}
ImageStorageYAML represents image storage configuration in YAML
type LLMConfigYAML ¶ added in v0.2.4
type LLMConfigYAML struct {
Temperature *float64 `yaml:"temperature,omitempty"`
TopP *float64 `yaml:"top_p,omitempty"`
FrequencyPenalty *float64 `yaml:"frequency_penalty,omitempty"`
PresencePenalty *float64 `yaml:"presence_penalty,omitempty"`
StopSequences []string `yaml:"stop_sequences,omitempty"`
EnableReasoning *bool `yaml:"enable_reasoning,omitempty"`
ReasoningBudget *int `yaml:"reasoning_budget,omitempty"`
Reasoning *string `yaml:"reasoning,omitempty"`
MaxTokens *int `yaml:"max_tokens,omitempty"`
}
LLMConfigYAML represents LLM configuration in YAML
type LLMProviderYAML ¶ added in v0.2.4
type LLMProviderYAML struct {
Provider string `yaml:"provider"`
Model string `yaml:"model,omitempty"`
Config map[string]interface{} `yaml:"config,omitempty"`
}
LLMProviderYAML represents LLM provider configuration in YAML
type LazyMCPConfig ¶ added in v0.0.42
type LazyMCPConfig struct {
Name string
Type string // "stdio" or "http"
Command string
Args []string
Env []string
URL string
Token string // Bearer token for HTTP authentication
Tools []LazyMCPToolConfig
HttpTransportMode string // "sse" or "streamable"
AllowedTools []string // List of allowed tool names for this MCP server
}
LazyMCPConfig holds configuration for lazy MCP server initialization
type LazyMCPToolConfig ¶ added in v0.0.42
LazyMCPToolConfig holds configuration for a lazy MCP tool
type LocalStorageYAML ¶ added in v0.2.35
type LocalStorageYAML struct {
Path string `yaml:"path,omitempty"`
BaseURL string `yaml:"base_url,omitempty"`
}
LocalStorageYAML represents local storage configuration in YAML
type MCPConfiguration ¶ added in v0.1.14
type MCPConfiguration struct {
MCPServers map[string]MCPServerConfig `json:"mcpServers" yaml:"mcpServers"`
Global *MCPGlobalConfig `json:"global,omitempty" yaml:"global,omitempty"`
}
MCPConfiguration represents the complete MCP configuration
func GetMCPConfigFromAgent ¶ added in v0.1.14
func GetMCPConfigFromAgent(a *Agent) *MCPConfiguration
GetMCPConfigFromAgent extracts MCP configuration from an agent
func LoadMCPConfigFromJSON ¶ added in v0.1.14
func LoadMCPConfigFromJSON(filePath string) (*MCPConfiguration, error)
LoadMCPConfigFromJSON loads MCP configuration from a JSON file
func LoadMCPConfigFromYAML ¶ added in v0.1.14
func LoadMCPConfigFromYAML(filePath string) (*MCPConfiguration, error)
LoadMCPConfigFromYAML loads MCP configuration from a YAML file
type MCPDiscoveredCapabilities ¶ added in v0.1.14
type MCPDiscoveredCapabilities struct {
SupportsTools bool `json:"supportsTools,omitempty"`
SupportsResources bool `json:"supportsResources,omitempty"`
SupportsPrompts bool `json:"supportsPrompts,omitempty"`
}
MCPDiscoveredCapabilities represents capabilities discovered from the server
type MCPDiscoveredServerInfo ¶ added in v0.1.14
type MCPDiscoveredServerInfo struct {
Name string `json:"name,omitempty"`
Title string `json:"title,omitempty"`
Version string `json:"version,omitempty"`
Capabilities *MCPDiscoveredCapabilities `json:"capabilities,omitempty"`
}
MCPDiscoveredServerInfo represents metadata discovered from the server at runtime
type MCPGlobalConfig ¶ added in v0.1.14
type MCPGlobalConfig struct {
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"` // e.g., "30s"
RetryAttempts int `json:"retry_attempts,omitempty" yaml:"retry_attempts,omitempty"`
HealthCheck *bool `json:"health_check,omitempty" yaml:"health_check,omitempty"`
EnableResources *bool `json:"enable_resources,omitempty" yaml:"enable_resources,omitempty"`
EnablePrompts *bool `json:"enable_prompts,omitempty" yaml:"enable_prompts,omitempty"`
EnableSampling *bool `json:"enable_sampling,omitempty" yaml:"enable_sampling,omitempty"`
EnableSchemas *bool `json:"enable_schemas,omitempty" yaml:"enable_schemas,omitempty"`
LogLevel string `json:"log_level,omitempty" yaml:"log_level,omitempty"`
}
MCPGlobalConfig represents global MCP settings
type MCPServerConfig ¶ added in v0.1.14
type MCPServerConfig struct {
Command string `json:"command,omitempty" yaml:"command,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Token string `json:"token,omitempty" yaml:"token,omitempty"`
HttpTransportMode string `json:"httpTransportMode,omitempty" yaml:"httpTransportMode,omitempty"` // "sse" or "streamable"
AllowedTools []string `json:"allowedTools,omitempty" yaml:"allowedTools,omitempty"`
}
MCPServerConfig represents a single MCP server configuration
func (*MCPServerConfig) GetServerType ¶ added in v0.1.14
func (c *MCPServerConfig) GetServerType() string
GetServerType returns the server type based on configuration
type MemoryConfigYAML ¶ added in v0.2.4
type MemoryConfigYAML struct {
Type string `yaml:"type"` // "buffer", "redis", "vector"
Config map[string]interface{} `yaml:"config,omitempty"`
}
MemoryConfigYAML represents memory configuration in YAML
type MultiTurnEditingYAML ¶ added in v0.2.36
type MultiTurnEditingYAML struct {
Enabled *bool `yaml:"enabled,omitempty"`
Model string `yaml:"model,omitempty"` // e.g., "gemini-3-pro-image-preview"
SessionTimeout string `yaml:"session_timeout,omitempty"` // e.g., "30m"
MaxSessionsPerOrg *int `yaml:"max_sessions_per_org,omitempty"`
}
MultiTurnEditingYAML represents multi-turn image editing configuration in YAML
type Option ¶
type Option func(*Agent)
Option represents an option for configuring an agent
func WithAgentConfig ¶ added in v0.0.3
func WithAgentConfig(config AgentConfig, variables map[string]string) Option
WithAgentConfig sets the agent configuration from a YAML config
func WithAgents ¶ added in v0.0.26
WithAgents sets the sub-agents that can be called as tools
func WithCacheConfig ¶ added in v0.2.40
func WithCacheConfig(config interfaces.CacheConfig) Option
WithCacheConfig sets the prompt caching configuration for the agent (Anthropic only)
func WithConfigFile ¶ added in v0.2.10
WithConfigFile loads configuration from a file and creates the agent This is a convenience option that combines file loading with agent creation
func WithCustomRunFunction ¶ added in v0.0.43
func WithCustomRunFunction(fn CustomRunFunction) Option
WithCustomRunFunction sets a custom run function that replaces the default Run behavior
func WithCustomRunStreamFunction ¶ added in v0.0.43
func WithCustomRunStreamFunction(fn CustomRunStreamFunction) Option
WithCustomRunStreamFunction sets a custom streaming run function that replaces the default RunStream behavior
func WithDataStore ¶ added in v0.2.23
func WithDataStore(datastore interfaces.DataStore) Option
WithDataStore sets the datastore for the agent
func WithDescription ¶ added in v0.0.20
WithDescription sets the description for the agent
func WithDisableFinalSummary ¶ added in v0.2.41
WithDisableFinalSummary sets whether to disable the final summary LLM call
func WithGraphRAG ¶ added in v0.2.28
func WithGraphRAG(store interfaces.GraphRAGStore) Option
WithGraphRAG adds GraphRAG capabilities to the agent. When a GraphRAGStore is provided, the agent automatically registers GraphRAG tools (search, add_entity, add_relationship, get_context, extract).
func WithGuardrails ¶
func WithGuardrails(guardrails interfaces.Guardrails) Option
WithGuardrails sets the guardrails for the agent
func WithLLMConfig ¶ added in v0.0.11
func WithLLMConfig(config interfaces.LLMConfig) Option
func WithLazyMCPConfigs ¶ added in v0.0.42
func WithLazyMCPConfigs(configs []LazyMCPConfig) Option
WithLazyMCPConfigs sets the lazy MCP server configurations for the agent
func WithLogger ¶ added in v0.0.36
WithLogger sets the logger for the agent
func WithMCPCommandExecutor ¶ added in v0.2.90
func WithMCPCommandExecutor(executor mcp.CommandExecutor) Option
WithMCPCommandExecutor runs every stdio MCP server the agent starts through executor instead of directly on the host. It applies to servers from WithLazyMCPConfigs, WithMCPURLs, WithMCPPresets and MCP YAML configuration. Servers passed with WithMCPServers are already running, so it does not apply to them; set mcp.StdioServerConfig.Executor when creating those.
sandbox.NewDockerExecutor returns an executor that runs each server in its own locked-down container. The agent does not close the executor.
func WithMCPConfig ¶ added in v0.1.14
func WithMCPConfig(config *MCPConfiguration) Option
WithMCPConfig adds MCP servers from configuration object
func WithMCPConfigFromJSON ¶ added in v0.1.14
WithMCPConfigFromJSON adds MCP servers from a JSON configuration file
func WithMCPConfigFromYAML ¶ added in v0.1.14
WithMCPConfigFromYAML adds MCP servers from a YAML configuration file
func WithMCPPresets ¶ added in v0.1.14
WithMCPPresets adds predefined MCP server configurations
func WithMCPServers ¶ added in v0.0.13
func WithMCPServers(mcpServers []interfaces.MCPServer) Option
WithMCPServers sets the MCP servers for the agent
func WithMCPURLs ¶ added in v0.1.14
WithMCPURLs adds MCP servers from URL strings Supports formats: - stdio://command/path/to/executable - http://localhost:8080/mcp - https://api.example.com/mcp?token=xxx - mcp://preset-name (for presets)
func WithMaxIterations ¶ added in v0.0.19
WithMaxIterations sets the maximum number of tool-calling iterations for the agent
func WithMemory ¶
func WithMemory(memory interfaces.Memory) Option
WithMemory sets the memory for the agent
func WithRemoteTimeout ¶ added in v0.0.29
WithRemoteTimeout sets the timeout for remote agent operations
func WithRequirePlanApproval ¶ added in v0.0.2
WithRequirePlanApproval sets whether execution plans require user approval
func WithResponseFormat ¶ added in v0.0.4
func WithResponseFormat(formatType interfaces.ResponseFormat) Option
WithResponseFormat sets the response format for the agent
func WithStreamConfig ¶ added in v0.0.46
func WithStreamConfig(config *interfaces.StreamConfig) Option
WithStreamConfig sets the streaming configuration for the agent
func WithSystemPrompt ¶
WithSystemPrompt sets the system prompt for the agent
func WithToolDecorator ¶ added in v0.2.71
func WithToolDecorator(decorate ToolDecorator) Option
WithToolDecorator appends a decorator to the agent's tool pipeline.
Decorators run outside the usage tracker and in the order they are added, so a decorator that can deny or short-circuit a call should be added after any that only observe. See decorateTools for the full ordering rationale.
func WithTools ¶
func WithTools(tools ...interfaces.Tool) Option
WithTools appends tools to the agent's tool list, deduplicating by name
func WithTracer ¶
func WithTracer(tracer interfaces.Tracer) Option
WithTracer sets the tracer for the agent
type ResponseFormatConfig ¶ added in v0.0.24
type ResponseFormatConfig struct {
Type string `yaml:"type"`
SchemaName string `yaml:"schema_name"`
SchemaDefinition map[string]interface{} `yaml:"schema_definition"`
}
ResponseFormatConfig represents the configuration for the response format of an agent or task
type RuntimeConfigYAML ¶ added in v0.2.4
type RuntimeConfigYAML struct {
LogLevel string `yaml:"log_level,omitempty"` // "debug", "info", "warn", "error"
EnableTracing *bool `yaml:"enable_tracing,omitempty"`
EnableMetrics *bool `yaml:"enable_metrics,omitempty"`
TimeoutDuration string `yaml:"timeout_duration,omitempty"` // "30s", "5m"
}
RuntimeConfigYAML represents runtime behavior settings in YAML
type StreamConfigYAML ¶ added in v0.2.4
type StreamConfigYAML struct {
BufferSize *int `yaml:"buffer_size,omitempty"`
IncludeToolProgress *bool `yaml:"include_tool_progress,omitempty"`
IncludeIntermediateMessages *bool `yaml:"include_intermediate_messages,omitempty"`
}
StreamConfigYAML represents streaming configuration in YAML
type SubAgentContext ¶ added in v0.0.26
type SubAgentContext struct {
ParentAgent string
SubAgentName string
RecursionDepth int
InvocationID string
StartTime time.Time
}
SubAgentContext contains context information for sub-agent invocations.
type TaskConfig ¶ added in v0.0.3
type TaskConfig struct {
Description string `yaml:"description"`
ExpectedOutput string `yaml:"expected_output"`
Agent string `yaml:"agent"`
OutputFile string `yaml:"output_file,omitempty"`
ResponseFormat *ResponseFormatConfig `yaml:"response_format,omitempty"`
}
TaskConfig represents a task definition loaded from YAML
type TaskConfigs ¶ added in v0.0.3
type TaskConfigs map[string]TaskConfig
TaskConfigs represents a map of task configurations
func LoadTaskConfigsFromDir ¶ added in v0.0.3
func LoadTaskConfigsFromDir(dirPath string) (TaskConfigs, error)
LoadTaskConfigsFromDir loads all task configurations from YAML files in a directory
func LoadTaskConfigsFromFile ¶ added in v0.0.3
func LoadTaskConfigsFromFile(filePath string) (TaskConfigs, error)
LoadTaskConfigsFromFile loads task configurations from a YAML file
type ToolConfigYAML ¶ added in v0.2.4
type ToolConfigYAML struct {
Type string `yaml:"type"` // "builtin", "custom", "mcp", "agent"
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Config map[string]interface{} `yaml:"config,omitempty"`
Enabled *bool `yaml:"enabled,omitempty"`
// For agent tools
URL string `yaml:"url,omitempty"` // Remote agent URL
Timeout string `yaml:"timeout,omitempty"` // Timeout duration
}
ToolConfigYAML represents tool configuration in YAML
type ToolDecorator ¶ added in v0.2.71
type ToolDecorator func([]interfaces.Tool) []interfaces.Tool
ToolDecorator transforms the tool set an agent is about to expose, typically by wrapping each tool to add behaviour around Execute and Run.
A decorator must return a slice of the same length, preserving order, and should forward optional interfaces on the tools it wraps -- see ForwardOptionalToolInterfaces.
type ToolFactory ¶ added in v0.2.4
type ToolFactory struct {
// contains filtered or unexported fields
}
ToolFactory creates tools from YAML configuration
func NewToolFactory ¶ added in v0.2.4
func NewToolFactory() *ToolFactory
NewToolFactory creates a new tool factory with builtin tools registered
func (*ToolFactory) CreateTool ¶ added in v0.2.4
func (tf *ToolFactory) CreateTool(config ToolConfigYAML) (interfaces.Tool, error)
CreateTool creates a tool from YAML configuration
func (*ToolFactory) CreateToolWithParentConfig ¶ added in v0.2.4
func (tf *ToolFactory) CreateToolWithParentConfig(config ToolConfigYAML, parentConfig *AgentConfig) (interfaces.Tool, error)
CreateToolWithParentConfig creates a tool from YAML configuration with access to parent agent config
func (*ToolFactory) RegisterCustomTool ¶ added in v0.2.4
func (tf *ToolFactory) RegisterCustomTool(name string, factory func(map[string]interface{}) (interfaces.Tool, error))
RegisterCustomTool allows external registration of custom tools
type ToolUnwrapper ¶ added in v0.2.71
type ToolUnwrapper interface {
Unwrap() interfaces.Tool
}
ToolUnwrapper is implemented by tool decorators so callers can recover the tool underneath.
Wrapping erases concrete type identity: after a tool is decorated, an assertion such as tool.(*tools.AgentTool) fails. configureSubAgentTools only works today because it inspects a.tools at construction, before any wrapping happens.