Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentPool ¶
type AgentPool struct {
// contains filtered or unexported fields
}
AgentPool represents a pool of specialized agents
func (*AgentPool) GetDescription ¶
GetDescription retrieves an agent's description
func (*AgentPool) ListDescriptions ¶
ListDescriptions returns all agent descriptions
type AgentRegistry ¶
type AgentRegistry struct {
// contains filtered or unexported fields
}
AgentRegistry maintains a registry of available agents
func NewAgentRegistry ¶
func NewAgentRegistry() *AgentRegistry
NewAgentRegistry creates a new agent registry
func (*AgentRegistry) Get ¶
func (r *AgentRegistry) Get(id string) (*agent.Agent, bool)
Get retrieves an agent from the registry
type CodeOrchestrator ¶
type CodeOrchestrator struct {
// contains filtered or unexported fields
}
CodeOrchestrator orchestrates agents using code-defined workflows
func NewCodeOrchestrator ¶
func NewCodeOrchestrator(registry *AgentRegistry) *CodeOrchestrator
NewCodeOrchestrator creates a new code orchestrator
func (*CodeOrchestrator) ExecuteWorkflow ¶
ExecuteWorkflow executes a workflow
type DelegationAgent ¶
DelegationAgent is an agent that can delegate tasks to other agents
func NewDelegationAgent ¶
func NewDelegationAgent(baseAgent *agent.Agent, registry *AgentRegistry) *DelegationAgent
NewDelegationAgent creates a new delegation agent
type HandoffRequest ¶
type HandoffRequest struct {
// TargetAgentID is the ID of the agent to hand off to
TargetAgentID string
// Reason explains why the handoff is happening
Reason string
// Context contains additional context for the target agent
Context map[string]interface{}
// Query is the query to send to the target agent
Query string
// PreserveMemory indicates whether to copy memory to the target agent
PreserveMemory bool
}
HandoffRequest represents a request to hand off to another agent
type HandoffResult ¶
type HandoffResult struct {
// AgentID is the ID of the agent that handled the request
AgentID string
// Response is the response from the agent
Response string
// Completed indicates whether the task was completed
Completed bool
// NextHandoff is the next handoff request, if any
NextHandoff *HandoffRequest
}
HandoffResult represents the result of a handoff
type LLMOrchestrator ¶
type LLMOrchestrator struct {
// contains filtered or unexported fields
}
LLMOrchestrator orchestrates the execution of a query using multiple agents
func NewLLMOrchestrator ¶
func NewLLMOrchestrator(registry *AgentRegistry, planner interfaces.LLM) *LLMOrchestrator
NewLLMOrchestrator creates a new LLM orchestrator
func (*LLMOrchestrator) WithLogger ¶
func (o *LLMOrchestrator) WithLogger(logger logging.Logger) *LLMOrchestrator
WithLogger sets the logger for the orchestrator
type LLMRouter ¶
type LLMRouter struct {
// contains filtered or unexported fields
}
LLMRouter uses an LLM to determine which agent should handle a request
func NewLLMRouter ¶
func NewLLMRouter(llm interfaces.LLM) *LLMRouter
NewLLMRouter creates a new LLM router
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator orchestrates handoffs between agents
func NewOrchestrator ¶
func NewOrchestrator(registry *AgentRegistry, router Router) *Orchestrator
NewOrchestrator creates a new orchestrator
func (*Orchestrator) HandleRequest ¶
func (o *Orchestrator) HandleRequest(ctx context.Context, query string, initialContext map[string]interface{}) (*HandoffResult, error)
HandleRequest handles a request, potentially routing it through multiple agents
func (*Orchestrator) WithLogger ¶
func (o *Orchestrator) WithLogger(logger logging.Logger) *Orchestrator
WithLogger sets the logger for the orchestrator
type Plan ¶
type Plan struct {
// Steps is the list of steps in the plan
Steps []Step `json:"steps"`
// FinalAgentID is the ID of the agent that should provide the final response
FinalAgentID string `json:"final_agent_id"`
}
Plan represents an orchestration plan
type Router ¶
type Router interface {
Route(ctx context.Context, query string, context map[string]interface{}) (string, error)
}
Router determines which agent should handle a request
type SimpleRouter ¶
type SimpleRouter struct {
// contains filtered or unexported fields
}
SimpleRouter routes requests based on a simple keyword matching
func NewSimpleRouter ¶
func NewSimpleRouter() *SimpleRouter
NewSimpleRouter creates a new simple router
func (*SimpleRouter) AddRoute ¶
func (r *SimpleRouter) AddRoute(keyword string, agentID string)
AddRoute adds a route to the router
type Step ¶
type Step struct {
// AgentID is the ID of the agent to execute
AgentID string `json:"agent_id"`
// Input is the input to provide to the agent
Input string `json:"input"`
// Description explains the purpose of this step
Description string `json:"description"`
// DependsOn lists the IDs of steps that must complete before this one
DependsOn []string `json:"depends_on,omitempty"`
}
Step represents a single step in an orchestration plan
type Task ¶
type Task struct {
// ID is the unique identifier for the task
ID string
// AgentID is the ID of the agent to execute the task
AgentID string
// Input is the input to provide to the agent
Input string
// Dependencies are the IDs of tasks that must complete before this one
Dependencies []string
// Status is the current status of the task
Status TaskStatus
// Result is the result of the task
Result string
// Error is any error that occurred during execution
Error error
}
Task represents a task to be executed by an agent
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the status of a task
const ( // TaskPending indicates the task is pending TaskPending TaskStatus = "pending" // TaskRunning indicates the task is running TaskRunning TaskStatus = "running" // TaskCompleted indicates the task is completed TaskCompleted TaskStatus = "completed" // TaskFailed indicates the task failed TaskFailed TaskStatus = "failed" )
type Workflow ¶
type Workflow struct {
// Tasks is the list of tasks in the workflow
Tasks []*Task
// Results is a map of task IDs to results
Results map[string]string
// Errors is a map of task IDs to errors
Errors map[string]error
// FinalTaskID is the ID of the task that produces the final result
FinalTaskID string
}
Workflow represents a workflow of tasks
func (*Workflow) SetFinalTask ¶
SetFinalTask sets the final task