Documentation
¶
Index ¶
- type Context
- type Edge
- type EdgeBuilder
- func (b *EdgeBuilder) Add(from, to Node) *EdgeBuilder
- func (b *EdgeBuilder) AddFanIn(sources []Node, target Node) *EdgeBuilder
- func (b *EdgeBuilder) AddFanOut(from Node, targets ...Node) *EdgeBuilder
- func (b *EdgeBuilder) AddRoute(from, to Node, route Route) *EdgeBuilder
- func (b *EdgeBuilder) Build() []Edge
- type EmitFunc
- type Event
- type Graph
- type GraphConfig
- type Node
- func NewAgentNode(name string, runner SessionGenerator, config NodeConfig) Node
- func NewEmittingFunctionNode[I, O any](name string, fn func(Context, I, EmitFunc) (O, error), config NodeConfig) Node
- func NewFunctionNode[I, O any](name string, fn func(Context, I) (O, error), config NodeConfig) Node
- func NewToolNode(name string, tool goagent.Tool, config NodeConfig) Node
- type NodeConfig
- type Route
- type SessionGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdgeBuilder ¶
type EdgeBuilder struct {
// contains filtered or unexported fields
}
EdgeBuilder provides a fluent way to assemble graph edges.
func NewEdgeBuilder ¶
func NewEdgeBuilder() *EdgeBuilder
func (*EdgeBuilder) Add ¶
func (b *EdgeBuilder) Add(from, to Node) *EdgeBuilder
func (*EdgeBuilder) AddFanIn ¶
func (b *EdgeBuilder) AddFanIn(sources []Node, target Node) *EdgeBuilder
func (*EdgeBuilder) AddFanOut ¶
func (b *EdgeBuilder) AddFanOut(from Node, targets ...Node) *EdgeBuilder
func (*EdgeBuilder) AddRoute ¶
func (b *EdgeBuilder) AddRoute(from, to Node, route Route) *EdgeBuilder
func (*EdgeBuilder) Build ¶
func (b *EdgeBuilder) Build() []Edge
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph executes workflow nodes according to explicit edges and routes.
type GraphConfig ¶
type GraphConfig struct {
MaxSteps int
}
GraphConfig configures workflow graph execution.
type Node ¶
type Node interface {
Name() string
Description() string
// contains filtered or unexported methods
}
Node is an executable step in a workflow graph.
var Start Node = startNode{}
Start is the synthetic graph entry point used in edges and chains.
func NewAgentNode ¶
func NewAgentNode(name string, runner SessionGenerator, config NodeConfig) Node
NewAgentNode wraps a session-aware agent as a graph node.
func NewEmittingFunctionNode ¶
func NewEmittingFunctionNode[I, O any](name string, fn func(Context, I, EmitFunc) (O, error), config NodeConfig) Node
NewEmittingFunctionNode wraps a function that can emit explicit Events. Returning nil and emitting no events suppresses automatic output.
func NewFunctionNode ¶
NewFunctionNode wraps a plain Go function as a workflow node. The returned value is forwarded to successor nodes through Event.Output.
func NewToolNode ¶
func NewToolNode(name string, tool goagent.Tool, config NodeConfig) Node
NewToolNode wraps an agent.Tool as a graph node. Map inputs are passed as arguments; other inputs are passed as the "input" argument.
type NodeConfig ¶
type NodeConfig struct {
Description string
}
NodeConfig carries metadata for workflow nodes.
type Route ¶
Route selects successor edges based on emitted Event.Routes.
var Default Route = routeFunc{ // contains filtered or unexported fields }
Default matches only when no non-default route from the same node matches.
func MultiRoute ¶
func MultiRoute[T comparable](values ...T) Route
MultiRoute matches any emitted route value in values.
func StringRoute ¶
StringRoute matches an emitted string route value.