Documentation
¶
Index ¶
- Constants
- func WithStreamForwarder(ctx context.Context, forwarder interfaces.StreamForwarder) context.Context
- type AgentTool
- func (at *AgentTool) Description() string
- func (at *AgentTool) DisplayName() string
- func (at *AgentTool) Execute(ctx context.Context, args string) (string, error)
- func (at *AgentTool) Internal() bool
- func (at *AgentTool) Name() string
- func (at *AgentTool) Parameters() map[string]interfaces.ParameterSpec
- func (at *AgentTool) Run(ctx context.Context, input string) (string, error)
- func (at *AgentTool) SetDescription(description string)
- func (at *AgentTool) WithLogger(logger logging.Logger) *AgentTool
- func (at *AgentTool) WithTimeout(timeout time.Duration) *AgentTool
- func (at *AgentTool) WithTracer(tracer interfaces.Tracer) *AgentTool
- type Registry
- type SubAgent
Constants ¶
const (
// MaxRecursionDepth is the maximum allowed recursion depth
MaxRecursionDepth = 5
)
Variables ¶
This section is empty.
Functions ¶
func WithStreamForwarder ¶ added in v0.2.3
func WithStreamForwarder(ctx context.Context, forwarder interfaces.StreamForwarder) context.Context
WithStreamForwarder adds a stream forwarder to the context
Types ¶
type AgentTool ¶ added in v0.0.26
type AgentTool struct {
// contains filtered or unexported fields
}
AgentTool wraps an agent to make it callable as a tool
func NewAgentTool ¶ added in v0.0.26
NewAgentTool creates a new agent tool wrapper
func (*AgentTool) Description ¶ added in v0.0.26
Description returns the description of what the tool does
func (*AgentTool) DisplayName ¶ added in v0.0.53
DisplayName implements interfaces.ToolWithDisplayName.DisplayName
func (*AgentTool) Parameters ¶ added in v0.0.26
func (at *AgentTool) Parameters() map[string]interfaces.ParameterSpec
Parameters returns the parameters that the tool accepts
func (*AgentTool) SetDescription ¶ added in v0.0.26
SetDescription allows updating the tool description
func (*AgentTool) WithLogger ¶ added in v0.0.26
WithLogger sets a custom logger for the agent tool
func (*AgentTool) WithTimeout ¶ added in v0.0.26
WithTimeout sets a custom timeout for the agent tool
func (*AgentTool) WithTracer ¶ added in v0.0.26
func (at *AgentTool) WithTracer(tracer interfaces.Tracer) *AgentTool
WithTracer sets a custom tracer for the agent tool
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry implements the ToolRegistry interface
func (*Registry) Get ¶
func (r *Registry) Get(name string) (interfaces.Tool, bool)
Get returns a tool by name
func (*Registry) List ¶
func (r *Registry) List() []interfaces.Tool
List returns all registered tools
func (*Registry) Register ¶
func (r *Registry) Register(tool interfaces.Tool)
Register registers a tool with the registry
type SubAgent ¶ added in v0.0.26
type SubAgent interface {
Run(ctx context.Context, input string) (string, error)
RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)
RunDetailed(ctx context.Context, input string) (*interfaces.AgentResponse, error)
GetName() string
GetDescription() string
}
SubAgent interface defines the minimal interface needed for a sub-agent