Versions in this module Expand all Collapse all v0 v0.1.0 Aug 9, 2025 Changes in this version + const END + const START + func RouteByMessageType(ctx context.Context, state *BaseState) (string, error) + func RouteByToolCalls(ctx context.Context, state *BaseState) (string, error) + type BaseState struct + func NewBaseState() *BaseState + func (bs *BaseState) Clone() *BaseState + func (bs *BaseState) CreateSnapshot() StateSnapshot + func (bs *BaseState) Delete(key string) + func (bs *BaseState) FromJSON(data []byte) error + func (bs *BaseState) Get(key string) (StateValue, bool) + func (bs *BaseState) GetAll() map[string]StateValue + func (bs *BaseState) GetHistory() *StateHistory + func (bs *BaseState) GetMetadata(key string) (interface{}, bool) + func (bs *BaseState) Keys() []string + func (bs *BaseState) Merge(other *BaseState) + func (bs *BaseState) RestoreFromSnapshot(snapshot StateSnapshot) + func (bs *BaseState) Set(key string, value StateValue) + func (bs *BaseState) SetMetadata(key string, value interface{}) + func (bs *BaseState) ToJSON() ([]byte, error) + type ConditionalEdge struct + Condition EdgeCondition + From string + ID string + Metadata map[string]interface{} + Routes map[string]string + type ConditionalRouter struct + func NewConditionalRouter(fallback string) *ConditionalRouter + func (cr *ConditionalRouter) AddRoute(condition string, router RouterFunction) + func (cr *ConditionalRouter) Route(ctx context.Context, state *BaseState) (string, error) + type Edge struct + Condition EdgeCondition + From string + ID string + Metadata map[string]interface{} + To string + type EdgeCondition func(ctx context.Context, state *BaseState) (string, error) + type ExecutionResult struct + Duration time.Duration + Error error + NodeID string + State *BaseState + Success bool + Timestamp time.Time + type Graph struct + Config *GraphConfig + Edges map[string]*Edge + EndNodes []string + ID string + Metadata map[string]interface{} + Name string + Nodes map[string]*Node + StartNode string + func NewGraph(name string) *Graph + func (g *Graph) AddConditionalEdges(from string, condition EdgeCondition, routes map[string]string) error + func (g *Graph) AddEdge(from, to string, condition EdgeCondition) *Edge + func (g *Graph) AddEndNode(nodeID string) error + func (g *Graph) AddNode(id, name string, fn NodeFunc) *Node + func (g *Graph) Close() + func (g *Graph) Execute(ctx context.Context, initialState *BaseState) (*BaseState, error) + func (g *Graph) ExecuteParallel(ctx context.Context, nodeIDs []string, state *BaseState) (map[string]*ExecutionResult, error) + func (g *Graph) GetConditionalEdge(nodeID string) (*ConditionalEdge, bool) + func (g *Graph) GetCurrentState() *BaseState + func (g *Graph) GetExecutionHistory() []*ExecutionResult + func (g *Graph) GetNextNodes(ctx context.Context, currentNodeID string, state *BaseState) ([]string, error) + func (g *Graph) GetNodesByType(nodeType string) []*Node + func (g *Graph) GetTopology() map[string][]string + func (g *Graph) Interrupt() + func (g *Graph) IsEndNode(nodeID string) bool + func (g *Graph) IsRunning() bool + func (g *Graph) IsStartNode(nodeID string) bool + func (g *Graph) Reset() + func (g *Graph) SetStartNode(nodeID string) error + func (g *Graph) Stream() <-chan *ExecutionResult + func (g *Graph) Validate() error + type GraphConfig struct + EnableCheckpoints bool + EnableStreaming bool + MaxIterations int + ParallelExecution bool + RetryAttempts int + RetryDelay time.Duration + Timeout time.Duration + func DefaultGraphConfig() *GraphConfig + type Node struct + Function NodeFunc + ID string + Metadata map[string]interface{} + Name string + type NodeFunc func(ctx context.Context, state *BaseState) (*BaseState, error) + type RouterFunction func(ctx context.Context, state *BaseState) (string, error) + func RouteByCondition(conditionKey string, trueRoute string, falseRoute string) RouterFunction + func RouteByCounter(counterKey string, maxCount int, continueRoute string, exitRoute string) RouterFunction + func RouteByStateValue(key string, routes map[interface{}]string, defaultRoute string) RouterFunction + type StateHistory struct + func NewStateHistory(maxSize int) *StateHistory + func (sh *StateHistory) AddSnapshot(snapshot StateSnapshot) + func (sh *StateHistory) GetSnapshot(id string) (*StateSnapshot, error) + func (sh *StateHistory) GetSnapshots() []StateSnapshot + type StateManager struct + func NewStateManager() *StateManager + func (sm *StateManager) CreateState(id string) *BaseState + func (sm *StateManager) DeleteState(id string) + func (sm *StateManager) GetState(id string) (*BaseState, bool) + func (sm *StateManager) ListStates() []string + type StateSnapshot struct + Data map[string]StateValue + ID string + Metadata map[string]interface{} + Timestamp time.Time + type StateValue interface