runner

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxTurns is the default maximum number of turns
	DefaultMaxTurns = 10
)

Variables

This section is empty.

Functions

func GenerateTaskID

func GenerateTaskID() string

GenerateTaskID generates a unique task ID

Types

type AgentToolUseTracker

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

AgentToolUseTracker tracks which tools each agent has used Similar to OpenAI's AgentToolUseTracker

func NewAgentToolUseTracker

func NewAgentToolUseTracker() *AgentToolUseTracker

NewAgentToolUseTracker creates a new tool use tracker

func (*AgentToolUseTracker) AddToolUse

func (t *AgentToolUseTracker) AddToolUse(agentName string, toolNames []string)

AddToolUse adds tool names to the tracker for an agent

func (*AgentToolUseTracker) HasUsedTools

func (t *AgentToolUseTracker) HasUsedTools(agentName string) bool

HasUsedTools checks if an agent has used any tools

type AgentType

type AgentType = *agent.Agent

Type aliases to help with import resolution

type ApprovalRecord

type ApprovalRecord struct {
	Approved bool
	Rejected bool
	ToolName string
	CallID   string
}

ApprovalRecord tracks approval state for a tool call

type DefaultRunHooks

type DefaultRunHooks struct{}

DefaultRunHooks provides a default implementation of RunHooks

func (*DefaultRunHooks) OnAfterHandoff

func (h *DefaultRunHooks) OnAfterHandoff(ctx context.Context, agent AgentType, handoffAgent AgentType, result interface{}) error

OnAfterHandoff is called after a handoff completes

func (*DefaultRunHooks) OnAgentStart

func (h *DefaultRunHooks) OnAgentStart(ctx context.Context, agent AgentType, input interface{}) error

OnAgentStart is called when an agent starts (first turn or after handoff)

func (*DefaultRunHooks) OnBeforeHandoff

func (h *DefaultRunHooks) OnBeforeHandoff(ctx context.Context, agent AgentType, handoffAgent AgentType) error

OnBeforeHandoff is called before a handoff occurs (deprecated, use OnHandoff)

func (*DefaultRunHooks) OnHandoff

func (h *DefaultRunHooks) OnHandoff(ctx context.Context, fromAgent AgentType, toAgent AgentType) error

OnHandoff is called when a handoff occurs

func (*DefaultRunHooks) OnRunEnd

func (h *DefaultRunHooks) OnRunEnd(ctx context.Context, result *result.RunResult) error

OnRunEnd is called when the run ends

func (*DefaultRunHooks) OnRunStart

func (h *DefaultRunHooks) OnRunStart(ctx context.Context, agent *agent.Agent, input interface{}) error

OnRunStart is called when the run starts

func (*DefaultRunHooks) OnTurnEnd

func (h *DefaultRunHooks) OnTurnEnd(ctx context.Context, agent *agent.Agent, turn int, result *SingleTurnResult) error

OnTurnEnd is called when a turn ends

func (*DefaultRunHooks) OnTurnStart

func (h *DefaultRunHooks) OnTurnStart(ctx context.Context, agent *agent.Agent, turn int) error

OnTurnStart is called when a turn starts

type DefaultToolUseBehavior

type DefaultToolUseBehavior struct{}

DefaultToolUseBehavior is the default behavior: always continue after tools

func (*DefaultToolUseBehavior) ShouldStop

func (b *DefaultToolUseBehavior) ShouldStop(ctx context.Context, toolResults []ToolResult) (bool, interface{})

type HandoffInputData

type HandoffInputData struct {
	// InputHistory is the original input to the run
	InputHistory interface{}

	// PreHandoffItems are items generated before the handoff
	PreHandoffItems []result.RunItem

	// NewItems are items generated in the current step (including the handoff call)
	NewItems []result.RunItem

	// RunContext is the shared run context
	RunContext *RunContext
}

HandoffInputData contains the data passed to a handoff input filter This follows OpenAI's HandoffInputData pattern

func (*HandoffInputData) AllItems

func (d *HandoffInputData) AllItems() []interface{}

AllItems returns all items that should be passed to the next agent This combines inputHistory, preHandoffItems, and newItems

type HandoffInputFilter

type HandoffInputFilter func(input interface{}) (interface{}, error)

HandoffInputFilter is a function that filters input during handoffs

type InputGuardrail

type InputGuardrail interface {
	// Check checks the input
	Check(input interface{}) (bool, string, error)
}

InputGuardrail is an interface for input guardrails

type Interaction

type Interaction struct {
	// Role is the role of the interaction (e.g., "user", "agent")
	Role string

	// Content is the content of the interaction
	Content interface{}

	// Timestamp is the time the interaction occurred
	Timestamp time.Time
}

Interaction represents a single interaction in a task's history

type ModelRequestType

type ModelRequestType = model.Request

Type aliases to help with import resolution

type ModelSettingsType

type ModelSettingsType = model.Settings

Type aliases to help with import resolution

type NextStep

type NextStep interface {
	StepType() string
}

NextStep represents the next step in the agent loop. Similar to OpenAI's NextStep discriminated union in both Python and TypeScript. This follows OpenAI's discriminated union pattern for controlling loop flow.

type NextStepFinalOutput

type NextStepFinalOutput struct {
	Output interface{}
}

NextStepFinalOutput indicates the agent has produced a final output

func (*NextStepFinalOutput) StepType

func (n *NextStepFinalOutput) StepType() string

type NextStepHandoff

type NextStepHandoff struct {
	NewAgent AgentType
	Input    interface{}
}

NextStepHandoff indicates a handoff to another agent

func (*NextStepHandoff) StepType

func (n *NextStepHandoff) StepType() string

type NextStepInterruption

type NextStepInterruption struct {
	Interruptions []result.RunItem // Items that require approval/intervention
}

NextStepInterruption indicates the run was interrupted (e.g., for tool approval)

func (*NextStepInterruption) StepType

func (n *NextStepInterruption) StepType() string

type NextStepRunAgain

type NextStepRunAgain struct{}

NextStepRunAgain indicates the loop should continue with another turn

func (*NextStepRunAgain) StepType

func (n *NextStepRunAgain) StepType() string

type OutputGuardrail

type OutputGuardrail interface {
	// Check checks the output
	Check(output interface{}) (bool, string, error)
}

OutputGuardrail is an interface for output guardrails

type ProcessedResponse

type ProcessedResponse struct {
	ToolCalls          []ToolRunFunction
	Handoffs           []ToolRunHandoff
	Messages           []result.RunItem
	HasToolsOrHandoffs bool
	ToolsUsed          []string // Names of all tools used (for tracking)
}

ProcessedResponse contains the processed model response. Similar to OpenAI's ProcessedResponse in both Python and TypeScript. It categorizes the model output into messages, tool calls, handoffs, and tracks tools used.

type RecoveryConfig

type RecoveryConfig struct {
	// AutomaticRecovery indicates whether to attempt automatic recovery
	AutomaticRecovery bool

	// RecoveryFunc is called to attempt recovery from a panic
	RecoveryFunc func(ctx interface{}, agent AgentType, state *WorkflowState, rec interface{}) error

	// OnPanic is called when a panic occurs
	OnPanic func(ctx interface{}, panicErr interface{}) error

	// MaxRecoveryAttempts is the maximum number of recovery attempts
	MaxRecoveryAttempts int
}

RecoveryConfig configures failure recovery

type RetryConfig

type RetryConfig struct {
	// MaxRetries is the maximum number of retries for a failed operation
	MaxRetries int

	// RetryDelay is the delay between retries
	RetryDelay time.Duration

	// RetryBackoffFactor is the factor to multiply delay by after each retry
	RetryBackoffFactor float64

	// RetryableErrors are error types that should trigger a retry
	RetryableErrors []string

	// OnRetry is called before each retry attempt
	OnRetry func(attempt int, err error) error
}

RetryConfig configures retry behavior

type RunConfig

type RunConfig struct {
	// Model is a model override (string or Model)
	Model interface{}

	// ModelProvider is the provider for resolving model names
	ModelProvider model.Provider

	// ModelSettings are global model settings
	ModelSettings *model.Settings

	// HandoffInputFilter is a global handoff input filter
	HandoffInputFilter HandoffInputFilter

	// InputGuardrails are global input guardrails
	InputGuardrails []InputGuardrail

	// OutputGuardrails are global output guardrails
	OutputGuardrails []OutputGuardrail

	// TracingDisabled indicates whether tracing is disabled
	TracingDisabled bool

	// TracingConfig is tracing configuration
	TracingConfig *TracingConfig
}

RunConfig configures global settings

type RunContext

type RunContext struct {
	// Context is user-provided custom context
	Context interface{}

	// Usage tracks token usage across the run
	Usage *Usage
	// contains filtered or unexported fields
}

RunContext shares context across agent turns and handoffs Similar to OpenAI's RunContext, it tracks usage, approvals, and custom context

func NewRunContext

func NewRunContext(context interface{}) *RunContext

NewRunContext creates a new RunContext

func (*RunContext) AddUsage

func (rc *RunContext) AddUsage(requests, inputTokens, outputTokens, totalTokens int)

AddUsage adds token usage to the context

func (*RunContext) ApproveTool

func (rc *RunContext) ApproveTool(toolName, callID string)

ApproveTool marks a tool call as approved

func (*RunContext) IsToolApproved

func (rc *RunContext) IsToolApproved(toolName, callID string) bool

IsToolApproved checks if a tool call is approved

func (*RunContext) IsToolRejected

func (rc *RunContext) IsToolRejected(toolName, callID string) bool

IsToolRejected checks if a tool call is rejected

func (*RunContext) RejectTool

func (rc *RunContext) RejectTool(toolName, callID string)

RejectTool marks a tool call as rejected

type RunHooks

type RunHooks interface {
	// OnRunStart is called when the run starts
	OnRunStart(ctx context.Context, agent *agent.Agent, input interface{}) error

	// OnAgentStart is called when an agent starts (first turn or after handoff)
	// Similar to Python's hooks.on_agent_start
	OnAgentStart(ctx context.Context, agent AgentType, input interface{}) error

	// OnTurnStart is called when a turn starts
	OnTurnStart(ctx context.Context, agent *agent.Agent, turn int) error

	// OnTurnEnd is called when a turn ends
	OnTurnEnd(ctx context.Context, agent *agent.Agent, turn int, result *SingleTurnResult) error

	// OnRunEnd is called when the run ends
	OnRunEnd(ctx context.Context, result *result.RunResult) error

	// OnHandoff is called when a handoff occurs (from_agent -> to_agent)
	// Similar to Python's hooks.on_handoff
	OnHandoff(ctx context.Context, fromAgent AgentType, toAgent AgentType) error

	// OnBeforeHandoff is called before a handoff occurs (deprecated, use OnHandoff)
	OnBeforeHandoff(ctx context.Context, agent AgentType, handoffAgent AgentType) error

	// OnAfterHandoff is called after a handoff completes
	OnAfterHandoff(ctx context.Context, agent AgentType, handoffAgent AgentType, result interface{}) error
}

RunHooks defines lifecycle hooks for a run

type RunOptions

type RunOptions struct {
	// Input is the input to the run
	Input interface{}

	// Context is a user-provided context object
	Context interface{}

	// MaxTurns is the maximum number of turns
	MaxTurns int

	// Hooks are lifecycle hooks for the run
	Hooks RunHooks

	// RunConfig is global configuration
	RunConfig *RunConfig

	// WorkflowConfig configures workflow-specific behavior
	WorkflowConfig *WorkflowConfig
}

RunOptions configures a run

type RunState

type RunState struct {
	// OriginalInput is the initial input to the run, never mutated
	OriginalInput interface{}

	// GeneratedItems are items generated during the run (messages, tool calls, etc.)
	// These accumulate over time
	GeneratedItems []result.RunItem

	// CurrentAgent is the agent currently handling the conversation
	CurrentAgent AgentType

	// CurrentStep determines what should happen next in the loop
	CurrentStep NextStep

	// CurrentTurn is the current turn number
	CurrentTurn int

	// MaxTurns is the maximum number of turns allowed
	MaxTurns int

	// ConsecutiveToolCalls tracks consecutive calls to the same tool
	ConsecutiveToolCalls int

	// RawResponses stores all raw model responses
	RawResponses []model.Response

	// LastTurnResponse stores the last model response for interruption handling
	LastTurnResponse *model.Response

	// RunContext shares context across handoffs (usage, approvals, custom context)
	RunContext *RunContext

	// ToolUseTracker tracks which tools each agent has used
	ToolUseTracker *AgentToolUseTracker

	// ShouldRunAgentStartHooks controls when agent start hooks should run
	// Set to true on first turn or after handoff
	ShouldRunAgentStartHooks bool
}

RunState tracks the state of an agent run. Similar to OpenAI's RunState in both Python and TypeScript. It maintains originalInput separately from generatedItems, following OpenAI's pattern.

func NewRunState

func NewRunState(agent AgentType, input interface{}, maxTurns int, runContext *RunContext) *RunState

NewRunState creates a new RunState

func (*RunState) AddGeneratedItem

func (s *RunState) AddGeneratedItem(item result.RunItem)

AddGeneratedItem adds a new item to the generated items list

func (*RunState) AddGeneratedItems

func (s *RunState) AddGeneratedItems(items []result.RunItem)

AddGeneratedItems adds multiple items to the generated items list

func (*RunState) AddRawResponse

func (s *RunState) AddRawResponse(response model.Response)

AddRawResponse adds a raw model response

func (*RunState) GetTurnInput

func (s *RunState) GetTurnInput() []interface{}

GetTurnInput combines originalInput and generatedItems to create the input for the next turn This follows OpenAI's getTurnInput pattern, filtering out internal items like approvals

func (*RunState) IncrementTurn

func (s *RunState) IncrementTurn()

IncrementTurn increments the turn counter

type Runner

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

Runner executes agents

func NewRunner

func NewRunner() *Runner

NewRunner creates a new runner with default configuration

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, agent AgentType, opts *RunOptions) (*result.RunResult, error)

Run executes an agent with the given input and options

func (*Runner) RunStreaming

func (r *Runner) RunStreaming(ctx context.Context, agent AgentType, opts *RunOptions) (*result.StreamedRunResult, error)

RunStreaming executes an agent with streaming responses

func (*Runner) RunSync

func (r *Runner) RunSync(agent AgentType, opts *RunOptions) (*result.RunResult, error)

RunSync is a synchronous version of Run

func (*Runner) WithDefaultMaxTurns

func (r *Runner) WithDefaultMaxTurns(maxTurns int) *Runner

WithDefaultMaxTurns sets the default maximum turns

func (*Runner) WithDefaultProvider

func (r *Runner) WithDefaultProvider(provider model.Provider) *Runner

WithDefaultProvider sets the default model provider

type SingleTurnResult

type SingleTurnResult struct {
	Agent    *agent.Agent
	Response interface{}
	Output   interface{}
}

SingleTurnResult contains the result of a single turn

type StateManagementConfig

type StateManagementConfig struct {
	// PersistState indicates whether to persist workflow state
	PersistState bool

	// StateStore is the interface for storing workflow state
	StateStore WorkflowStateStore

	// CheckpointFrequency determines how often to save state
	CheckpointFrequency time.Duration

	// RestoreOnFailure indicates whether to restore state on failure
	RestoreOnFailure bool
}

StateManagementConfig configures workflow state management

type StopOnFirstToolBehavior

type StopOnFirstToolBehavior struct{}

StopOnFirstToolBehavior stops execution after the first tool

func (*StopOnFirstToolBehavior) ShouldStop

func (b *StopOnFirstToolBehavior) ShouldStop(ctx context.Context, toolResults []ToolResult) (bool, interface{})

type TaskContext

type TaskContext struct {
	// TaskID is a unique identifier for the task
	TaskID string

	// ParentAgentName is the name of the agent that delegated the task
	ParentAgentName string

	// ChildAgentName is the name of the agent executing the task
	ChildAgentName string

	// Status indicates the current status of the task
	Status TaskStatus

	// CreatedAt is the time the task was created
	CreatedAt time.Time

	// CompletedAt is the time the task was completed
	CompletedAt *time.Time

	// Result contains the result of the task
	Result interface{}

	// RelatedTaskIDs contains IDs of related tasks (e.g., parent, children)
	RelatedTaskIDs []string

	// TaskDescription contains a human-readable description of the task
	TaskDescription string

	// WorkingContext contains context information about what is being worked on
	WorkingContext *WorkingContext

	// InteractionHistory contains the history of interactions for this task
	InteractionHistory []Interaction
}

TaskContext tracks information about a delegated task

func NewTaskContext

func NewTaskContext(taskID, parentName, childName string) *TaskContext

NewTaskContext creates a new task context

func (*TaskContext) AddInteraction

func (t *TaskContext) AddInteraction(role string, content interface{})

AddInteraction adds an interaction to the task history

func (*TaskContext) AddMetadata

func (t *TaskContext) AddMetadata(key string, value interface{})

AddMetadata adds metadata to the task context

func (*TaskContext) AddRelatedTask

func (t *TaskContext) AddRelatedTask(taskID string)

AddRelatedTask adds a related task ID

func (*TaskContext) Complete

func (t *TaskContext) Complete(result interface{})

Complete marks the task as complete with a result

func (*TaskContext) Fail

func (t *TaskContext) Fail(err error)

Fail marks the task as failed with an error

func (*TaskContext) GetArtifact

func (t *TaskContext) GetArtifact() interface{}

GetArtifact returns the working artifact for the task

func (*TaskContext) GetDelegationChain

func (t *TaskContext) GetDelegationChain() string

GetDelegationChain returns the delegation chain in the format "parent -> child"

func (*TaskContext) GetInteractionHistory

func (t *TaskContext) GetInteractionHistory() []Interaction

GetInteractionHistory returns the interaction history for the task

func (*TaskContext) GetLastInteraction

func (t *TaskContext) GetLastInteraction() *Interaction

GetLastInteraction returns the most recent interaction

func (*TaskContext) GetMetadata

func (t *TaskContext) GetMetadata(key string) interface{}

GetMetadata retrieves metadata from the task context

func (*TaskContext) GetResult

func (t *TaskContext) GetResult() interface{}

GetResult returns the task result

func (*TaskContext) IsComplete

func (t *TaskContext) IsComplete() bool

IsComplete checks if the task is complete

func (*TaskContext) IsFailed

func (t *TaskContext) IsFailed() bool

IsFailed checks if the task has failed

func (*TaskContext) IsFinished

func (t *TaskContext) IsFinished() bool

IsFinished checks if the task is either complete or failed

func (*TaskContext) IsPending

func (t *TaskContext) IsPending() bool

IsPending checks if the task is still pending

func (*TaskContext) SetArtifact

func (t *TaskContext) SetArtifact(artifact interface{}, artifactType string)

SetArtifact sets the working artifact for the task

func (*TaskContext) SetDescription

func (t *TaskContext) SetDescription(description string)

SetDescription sets a human-readable description for the task

func (*TaskContext) ToJSON

func (t *TaskContext) ToJSON() (string, error)

ToJSON converts the task context to JSON

type TaskStatus

type TaskStatus string

TaskStatus represents the status of a delegated task

const (
	// TaskStatusPending indicates the task is in progress
	TaskStatusPending TaskStatus = "pending"

	// TaskStatusComplete indicates the task is complete
	TaskStatusComplete TaskStatus = "complete"

	// TaskStatusFailed indicates the task failed
	TaskStatusFailed TaskStatus = "failed"
)

type ToolResult

type ToolResult struct {
	ToolName string
	Output   interface{}
	Error    error
}

ToolResult represents the result of executing a tool

type ToolRunFunction

type ToolRunFunction struct {
	ToolCall model.ToolCall
	Tool     tool.Tool
}

ToolRunFunction represents a function tool call to execute. Similar to OpenAI's ToolRunFunction type in both SDKs.

type ToolRunHandoff

type ToolRunHandoff struct {
	ToolCall model.ToolCall
	Agent    AgentType
}

ToolRunHandoff represents a handoff call to another agent. Similar to OpenAI's ToolRunHandoff type in both SDKs.

type ToolUseBehavior

type ToolUseBehavior interface {
	// ShouldStop determines if execution should stop after tool execution
	// Returns (shouldStop, finalOutput)
	ShouldStop(ctx context.Context, toolResults []ToolResult) (bool, interface{})
}

ToolUseBehavior determines how tool outputs are handled Similar to OpenAI's toolUseBehavior

type TracingConfig

type TracingConfig struct {
	// WorkflowName is the name of the workflow
	WorkflowName string

	// TraceID is a custom trace ID
	TraceID string

	// GroupID is a grouping identifier
	GroupID string

	// Metadata is additional metadata
	Metadata map[string]interface{}
}

TracingConfig configures tracing

type TurnResult

type TurnResult struct {
	// OriginalInput is the original input (may be mutated by handoff filters)
	OriginalInput interface{}

	// GeneratedItems are all items generated during this turn
	GeneratedItems []result.RunItem

	// NextStep determines what should happen next
	NextStep NextStep

	// ModelResponse is the raw model response for this turn
	ModelResponse *model.Response
}

TurnResult represents the result of processing a single turn. Similar to OpenAI's SingleStepResult in both Python and TypeScript. It contains the generated items, next step, and raw model response for a turn.

func NewTurnResult

func NewTurnResult(originalInput interface{}, generatedItems []result.RunItem, nextStep NextStep, modelResponse *model.Response) *TurnResult

NewTurnResult creates a new TurnResult

type Usage

type Usage struct {
	Requests     int
	InputTokens  int
	OutputTokens int
	TotalTokens  int
}

Usage tracks token usage

type ValidationConfig

type ValidationConfig struct {
	// PreHandoffValidation validates data before handoff
	PreHandoffValidation []ValidationRule

	// PostHandoffValidation validates data after handoff
	PostHandoffValidation []ValidationRule

	// PhaseTransitionValidation validates phase transitions
	PhaseTransitionValidation []ValidationRule
}

ValidationConfig configures validation behavior

type ValidationRule

type ValidationRule struct {
	// Name is the name of the rule
	Name string

	// Validate is the validation function
	Validate func(data interface{}) (bool, error)

	// ErrorMessage is the message to show on validation failure
	ErrorMessage string

	// Severity determines if validation failure should block progress
	Severity ValidationSeverity
}

ValidationRule defines a validation rule

type ValidationSeverity

type ValidationSeverity string

ValidationSeverity indicates the severity of a validation failure

const (
	// ValidationError indicates a blocking validation failure
	ValidationError ValidationSeverity = "error"

	// ValidationWarning indicates a non-blocking validation failure
	ValidationWarning ValidationSeverity = "warning"
)

type WorkflowConfig

type WorkflowConfig struct {
	// RetryConfig configures retry behavior for handoffs and tool calls
	RetryConfig *RetryConfig

	// StateManagement configures how workflow state is managed
	StateManagement *StateManagementConfig

	// ValidationConfig configures input/output validation between phases
	ValidationConfig *ValidationConfig

	// RecoveryConfig configures how to handle and recover from failures
	RecoveryConfig *RecoveryConfig
}

WorkflowConfig configures workflow behavior

type WorkflowRunner

type WorkflowRunner struct {
	*Runner
	// contains filtered or unexported fields
}

WorkflowRunner extends the base Runner with workflow capabilities

func NewWorkflowRunner

func NewWorkflowRunner(baseRunner *Runner, config *WorkflowConfig) *WorkflowRunner

NewWorkflowRunner creates a new workflow runner

func (*WorkflowRunner) RunWorkflow

func (wr *WorkflowRunner) RunWorkflow(ctx context.Context, agent AgentType, opts *RunOptions) (*result.RunResult, error)

RunWorkflow executes a workflow with the given options

type WorkflowState

type WorkflowState struct {
	// CurrentPhase is the current phase of the workflow
	CurrentPhase string
	// CompletedPhases are the phases that have been completed
	CompletedPhases []string
	// Artifacts are data produced during workflow execution
	Artifacts map[string]interface{}
	// LastCheckpoint is when the state was last saved
	LastCheckpoint time.Time
	// Metadata is additional workflow metadata
	Metadata map[string]interface{}
}

WorkflowState represents the current state of a workflow

type WorkflowStateStore

type WorkflowStateStore interface {
	// SaveState saves the current workflow state
	SaveState(workflowID string, state interface{}) error

	// LoadState loads a workflow state
	LoadState(workflowID string) (interface{}, error)

	// ListCheckpoints lists available checkpoints for a workflow
	ListCheckpoints(workflowID string) ([]string, error)

	// DeleteCheckpoint deletes a checkpoint
	DeleteCheckpoint(workflowID string, checkpointID string) error
}

WorkflowStateStore defines the interface for storing workflow state

type WorkingContext

type WorkingContext struct {
	// Artifact is the primary artifact being worked on (e.g., code, text)
	Artifact interface{} `json:"artifact,omitempty"`

	// ArtifactType indicates the type of artifact (e.g., "code", "text")
	ArtifactType string `json:"artifact_type,omitempty"`

	// Metadata contains additional metadata about the task
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

WorkingContext contains context information about the task

Jump to

Keyboard shortcuts

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