workflowagent

package
v1.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent executes a workflow graph behind an agent-like Generate and Run API.

func New

func New(config Config) (*Agent, error)

New builds a graph-backed agent from workflow edges.

func (*Agent) Description

func (a *Agent) Description() string

func (*Agent) Generate

func (a *Agent) Generate(ctx context.Context, sessionID, input string) (any, error)

Generate runs the workflow graph with session-aware context.

func (*Agent) Graph

func (a *Agent) Graph() *workflow.Graph

func (*Agent) Name

func (a *Agent) Name() string

func (*Agent) ResumeRun added in v1.13.5

func (a *Agent) ResumeRun(ctx context.Context, store workflow.RunStore, runID string) (any, error)

ResumeRun continues a durable graph run from its most recently saved node transition. Completed runs return their saved result without re-executing.

func (*Agent) Run

func (a *Agent) Run(ctx context.Context, input string) (string, error)

Run lets a workflow agent satisfy the root agent.SubAgent interface.

func (*Agent) StartRun added in v1.13.5

func (a *Agent) StartRun(ctx context.Context, store workflow.RunStore, runID, sessionID string, input any) (any, error)

StartRun creates and executes a durable graph run. Use ResumeRun after a transient node failure or process restart.

type Config

type Config struct {
	Name        string
	Description string
	Edges       []workflow.Edge
	MaxSteps    int
}

Config describes a graph-backed agent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL