Documentation
¶
Index ¶
- type Edge
- type Flow
- func (f *Flow) AddConditionalEdge(fromID, toID string, cond OutputCondition) error
- func (f *Flow) AddEdge(fromID, toID string) error
- func (f *Flow) AddNode(id string, agent *agent.Agent, task string) error
- func (f *Flow) OnCallback(cb callback.Callback)
- func (f *Flow) Run(ctx context.Context) (*Result, error)
- type Node
- type OutputCondition
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶
type Edge struct {
FromID string
ToID string
Condition *OutputCondition
}
Edge represents a directed connection between two flow nodes, optionally conditional.
type Flow ¶
type Flow struct {
AfterNode func(nodeID string, node *Node) // optional callback after each node execution, used for checkpointing
BeforeLevel func() bool // optional hook called before each level; return false to stop
// contains filtered or unexported fields
}
Flow manages a DAG of nodes and edges for agent-based workflow execution.
func (*Flow) AddConditionalEdge ¶
func (f *Flow) AddConditionalEdge(fromID, toID string, cond OutputCondition) error
AddConditionalEdge creates a directed edge with an output condition for routing.
func (*Flow) AddNode ¶
AddNode adds a new node to the flow with the given ID, agent, and task description.
func (*Flow) OnCallback ¶
OnCallback sets the callback function for flow lifecycle events.
type OutputCondition ¶
type OutputCondition struct {
Field string `json:"field"`
Operator string `json:"operator"`
Value string `json:"value"`
}
OutputCondition defines a condition for evaluating task output to determine flow routing.
Click to show internal directories.
Click to hide internal directories.