Documentation
¶
Index ¶
- type CollaborationAdapter
- func (a *CollaborationAdapter) CanHandle(task *OrchestrationTask) bool
- func (a *CollaborationAdapter) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
- func (a *CollaborationAdapter) Name() Pattern
- func (a *CollaborationAdapter) Priority(task *OrchestrationTask) int
- type CrewAdapter
- type HandoffAdapter
- type HierarchicalAdapter
- type OrchestrationResult
- type OrchestrationTask
- type Orchestrator
- type OrchestratorAdapter
- type OrchestratorConfig
- type Pattern
- type PatternExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollaborationAdapter ¶
type CollaborationAdapter struct {
// contains filtered or unexported fields
}
CollaborationAdapter wraps agent/collaboration into a PatternExecutor.
func NewCollaborationAdapter ¶
func NewCollaborationAdapter(coordinationType string, logger *zap.Logger) *CollaborationAdapter
NewCollaborationAdapter creates a new collaboration adapter.
func (*CollaborationAdapter) CanHandle ¶
func (a *CollaborationAdapter) CanHandle(task *OrchestrationTask) bool
func (*CollaborationAdapter) Execute ¶
func (a *CollaborationAdapter) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
func (*CollaborationAdapter) Name ¶
func (a *CollaborationAdapter) Name() Pattern
func (*CollaborationAdapter) Priority ¶
func (a *CollaborationAdapter) Priority(task *OrchestrationTask) int
type CrewAdapter ¶
type CrewAdapter struct {
// contains filtered or unexported fields
}
CrewAdapter wraps agent/crews into a PatternExecutor.
func NewCrewAdapter ¶
func NewCrewAdapter(logger *zap.Logger) *CrewAdapter
NewCrewAdapter creates a new crew adapter.
func (*CrewAdapter) CanHandle ¶
func (a *CrewAdapter) CanHandle(task *OrchestrationTask) bool
func (*CrewAdapter) Execute ¶
func (a *CrewAdapter) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
func (*CrewAdapter) Name ¶
func (a *CrewAdapter) Name() Pattern
func (*CrewAdapter) Priority ¶
func (a *CrewAdapter) Priority(task *OrchestrationTask) int
type HandoffAdapter ¶
type HandoffAdapter struct {
// contains filtered or unexported fields
}
HandoffAdapter wraps agent/handoff into a PatternExecutor.
func NewHandoffAdapter ¶
func NewHandoffAdapter(logger *zap.Logger) *HandoffAdapter
NewHandoffAdapter creates a new handoff adapter.
func (*HandoffAdapter) CanHandle ¶
func (a *HandoffAdapter) CanHandle(task *OrchestrationTask) bool
func (*HandoffAdapter) Execute ¶
func (a *HandoffAdapter) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
func (*HandoffAdapter) Name ¶
func (a *HandoffAdapter) Name() Pattern
func (*HandoffAdapter) Priority ¶
func (a *HandoffAdapter) Priority(task *OrchestrationTask) int
type HierarchicalAdapter ¶
type HierarchicalAdapter struct {
// contains filtered or unexported fields
}
HierarchicalAdapter wraps agent/hierarchical into a PatternExecutor.
func NewHierarchicalAdapter ¶
func NewHierarchicalAdapter(logger *zap.Logger) *HierarchicalAdapter
NewHierarchicalAdapter creates a new hierarchical adapter.
func (*HierarchicalAdapter) CanHandle ¶
func (a *HierarchicalAdapter) CanHandle(task *OrchestrationTask) bool
func (*HierarchicalAdapter) Execute ¶
func (a *HierarchicalAdapter) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
func (*HierarchicalAdapter) Name ¶
func (a *HierarchicalAdapter) Name() Pattern
func (*HierarchicalAdapter) Priority ¶
func (a *HierarchicalAdapter) Priority(task *OrchestrationTask) int
type OrchestrationResult ¶
type OrchestrationResult struct {
Pattern Pattern
Output *agent.Output
AgentUsed []string // agent IDs that participated
Duration time.Duration
Metadata map[string]any
}
OrchestrationResult wraps agent.Output with pattern info and metrics.
type OrchestrationTask ¶
type OrchestrationTask struct {
ID string
Description string
Input *agent.Input
Agents []agent.Agent
Metadata map[string]any
}
OrchestrationTask wraps agent.Input with orchestration metadata.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator dynamically selects and executes orchestration patterns.
func NewDefaultOrchestrator ¶ added in v1.2.0
func NewDefaultOrchestrator(config OrchestratorConfig, logger *zap.Logger) *Orchestrator
NewDefaultOrchestrator creates an Orchestrator pre-loaded with all built-in pattern adapters (collaboration, crew, hierarchical, handoff). This is the recommended entry point for wiring orchestration into the agent builder or any top-level API.
func NewOrchestrator ¶
func NewOrchestrator(config OrchestratorConfig, logger *zap.Logger) *Orchestrator
NewOrchestrator creates a new orchestrator.
func (*Orchestrator) Execute ¶
func (o *Orchestrator) Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
Execute runs the task using the configured or auto-selected pattern.
func (*Orchestrator) RegisterPattern ¶
func (o *Orchestrator) RegisterPattern(executor PatternExecutor)
RegisterPattern registers a pattern executor.
func (*Orchestrator) SelectPattern ¶
func (o *Orchestrator) SelectPattern(task *OrchestrationTask) (Pattern, error)
SelectPattern analyzes the task to pick the best pattern.
type OrchestratorAdapter ¶ added in v1.2.0
type OrchestratorAdapter struct {
// contains filtered or unexported fields
}
OrchestratorAdapter wraps *Orchestrator to satisfy agent.OrchestratorRunner. This bridges the orchestration package types with the agent-layer local interface, following the §12 workflow-local interface pattern.
func NewOrchestratorAdapter ¶ added in v1.2.0
func NewOrchestratorAdapter(o *Orchestrator) *OrchestratorAdapter
NewOrchestratorAdapter creates an adapter that satisfies agent.OrchestratorRunner.
func (*OrchestratorAdapter) Execute ¶ added in v1.2.0
func (a *OrchestratorAdapter) Execute(ctx context.Context, task *agent.OrchestrationTaskInput) (*agent.OrchestrationTaskOutput, error)
Execute converts agent-layer types to orchestration types and delegates.
type OrchestratorConfig ¶
type OrchestratorConfig struct {
DefaultPattern Pattern
AutoSelectEnabled bool
Timeout time.Duration
MaxAgents int
}
OrchestratorConfig configures the orchestrator behavior.
func DefaultOrchestratorConfig ¶
func DefaultOrchestratorConfig() OrchestratorConfig
DefaultOrchestratorConfig returns sensible defaults.
type PatternExecutor ¶
type PatternExecutor interface {
Execute(ctx context.Context, task *OrchestrationTask) (*OrchestrationResult, error)
Name() Pattern
CanHandle(task *OrchestrationTask) bool
Priority(task *OrchestrationTask) int // higher = better fit
}
PatternExecutor is the unified interface for all orchestration patterns.