Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Description string
ExpectedOutput string
Agent *agent.Agent
Context []*Task
Tools []tools.Tool
AsyncExecution bool
HumanInput bool
Callback callback.Callback
OutputFile string
FlowNodeID string
// @sk-task guardrails#T1.2: guardrails validated after agent returns (AC-007)
Guardrails []guardrail.Guardrail
GuardrailMaxRetries int
// @sk-task conditional-tasks#T2.1: condition evaluated before agent call (AC-001–AC-005)
Condition func(ctx context.Context, previousOutput string) (bool, error)
}
Config defines the configuration for a Task.
type Task ¶
type Task struct {
Config
ID string
Processed bool
Failed bool
Error error
Output string
OutputCondition string
NextPaths map[string]string
// @sk-task replay-system#T1.1: per-task usage and input context for checkpoint capture (AC-006)
Usage map[string]int // token usage for this task execution; set before saveCheckpoint
InputContext map[string]string // context results passed to this task; set before saveCheckpoint
// @sk-task conditional-tasks#T2.1: skip state set when condition returns false (AC-002)
Skipped bool
}
Task represents a unit of work to be executed by an agent.
func (*Task) Execute ¶
func (t *Task) Execute(ctx context.Context, contextResults map[string]string, previousOutput ...string) (string, error)
Execute runs the task and returns its output, handling condition evaluation, human input, context dependencies and guardrails. previousOutput is the output of the immediately preceding task (empty string for first task).
func (*Task) SetNextPath ¶
SetNextPath defines a conditional transition from this task to another task by ID.
Click to show internal directories.
Click to hide internal directories.