Documentation
¶
Index ¶
- func GetOutput[T any](r *Result, taskID string) (T, error)
- type Checkpoint
- type CheckpointStore
- type Config
- type Crew
- func (c *Crew) Kickoff(ctx context.Context) (*Result, error)
- func (c *Crew) Resume(ctx context.Context, freshCrew *Crew, checkpointID string) (*Result, error)
- func (c *Crew) SetStepCallback(cb callback.Callback)
- func (c *Crew) StepCallback() callback.Callback
- func (c *Crew) Train(ctx context.Context, iterations int, inputs map[string]any, trainingDir string, ...) (*TrainingReport, error)
- type NodeState
- type ProcessType
- type Result
- type TrainingReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checkpoint ¶
type Checkpoint struct {
ID string
ProcessType string
Phase string
NodeStates map[string]*NodeState
OrderedTaskIDs []string // preserves task execution order for resume
CreatedAt time.Time
UpdatedAt time.Time
}
Checkpoint represents a snapshot of crew execution state.
type CheckpointStore ¶
type CheckpointStore interface {
Save(ctx context.Context, ckpt *Checkpoint) error
Load(ctx context.Context, id string) (*Checkpoint, error)
List(ctx context.Context, filter map[string]any) ([]*Checkpoint, error)
Delete(ctx context.Context, id string) error
}
CheckpointStore defines the interface for checkpoint persistence. The implementation is provided by the checkpoint package to avoid circular dependency.
type Config ¶
type Config struct {
Agents []*agent.Agent
Tasks []*task.Task
Process ProcessType
ManagerLLM llm.Client
ManagerAgent *agent.Agent
Verbose bool
MaxRPM int
MaxCycles int
StepCallback callback.Callback
CheckpointStore CheckpointStore
// @sk-task knowledge-sources#T4.1: shared knowledge sources (AC-008)
KnowledgeSources []knowledge.KnowledgeSource
}
Config defines the configuration for a Crew.
type Crew ¶
type Crew struct {
// contains filtered or unexported fields
}
Crew orchestrates a group of agents to execute a collection of tasks.
func (*Crew) Resume ¶
Resume restores crew execution from a checkpoint, using a fresh crew for agents/LLMs. Completed tasks are not re-executed (matched by index position in the tasks slice); remaining tasks execute normally.
func (*Crew) SetStepCallback ¶
SetStepCallback replaces the crew's step callback. Used by telemetry bridge.
func (*Crew) StepCallback ¶
StepCallback returns the crew's current step callback.
func (*Crew) Train ¶ added in v0.4.0
func (c *Crew) Train(ctx context.Context, iterations int, inputs map[string]any, trainingDir string, feedbackFn func(iteration int, result *Result) training.Feedback, ) (*TrainingReport, error)
Train runs the crew N iterations, collects human feedback after each iteration, persists negative feedback (Rating < 0), and consolidates advice per agent after all iterations. Only sequential process is supported; other processes return ErrInvalidProcess.
type NodeState ¶
NodeState represents the execution state of a single task or flow node within a checkpoint.
type ProcessType ¶
type ProcessType string
ProcessType defines the execution strategy for a crew.
const ( ProcessSequential ProcessType = "sequential" ProcessHierarchical ProcessType = "hierarchical" ProcessConsensual ProcessType = "consensual" ProcessReflective ProcessType = "reflective" ProcessFlow ProcessType = "flow" ProcessStateMachine ProcessType = "state_machine" )
Supported crew process types.