Documentation
¶
Index ¶
- Constants
- 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 ValidateRecursionDepth(ctx context.Context) error
- func WithStreamForwarder(ctx context.Context, forwarder interfaces.StreamForwarder) context.Context
- func WithSubAgentContext(ctx context.Context, parentAgent, subAgentName string) 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 GetInvocationID ¶ added in v0.2.71
GetInvocationID returns the invocation ID for this sub-agent call, or "".
func GetParentAgent ¶ added in v0.2.71
GetParentAgent returns the name of the invoking parent agent, or "".
func GetRecursionDepth ¶ added in v0.2.71
GetRecursionDepth returns the current sub-agent recursion depth.
func GetSubAgentName ¶ added in v0.2.71
GetSubAgentName returns the name of the sub-agent being invoked, or "".
func IsSubAgentCall ¶ added in v0.2.71
IsSubAgentCall reports whether ctx is inside a sub-agent invocation.
func ValidateRecursionDepth ¶ added in v0.2.71
ValidateRecursionDepth reports an error when the sub-agent recursion depth has exceeded MaxRecursionDepth.
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
Directories
¶
| Path | Synopsis |
|---|---|
|
Package graphrag provides tools for interacting with GraphRAG knowledge graphs.
|
Package graphrag provides tools for interacting with GraphRAG knowledge graphs. |