Documentation
¶
Index ¶
- Constants
- type AsyncResult
- type EventContextOptions
- type EventHandler
- type EventStream
- type InterruptRecord
- type Invocation
- type InvokeOption
- type Option
- func WithCheckpointStore[S any](store checkpoint.Store) Option[S]
- func WithEventContext[S any](options EventContextOptions) Option[S]
- func WithEventHandler[S any](handler EventHandler) Option[S]
- func WithMaxSteps[S any](maxSteps int) Option[S]
- func WithRecorder[S any](recorder trace.Recorder) Option[S]
- func WithSerializer[S any](serializer checkpoint.Serializer[S]) Option[S]
- type Result
- type ResumeRequest
- type Run
- type Runner
- func (r *Runner[S]) Invoke(ctx context.Context, initialState S, opts ...InvokeOption) (*Result[S], error)
- func (r *Runner[S]) InvokeAsync(ctx context.Context, initialState S, opts ...InvokeOption) *Invocation[S]
- func (r *Runner[S]) Resume(ctx context.Context, interruptID string, response hitl.Response) (*Result[S], error)
- func (r *Runner[S]) ResumeFrom(ctx context.Context, request ResumeRequest[S]) (*Result[S], error)
- type Status
Constants ¶
View Source
const DefaultMaxSteps = 10000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncResult ¶
type EventContextOptions ¶
type EventContextOptions struct {
Enabled bool
}
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
func NewEventStream ¶
func NewEventStream(buffer int) *EventStream
func (*EventStream) Close ¶
func (s *EventStream) Close()
func (*EventStream) Dropped ¶
func (s *EventStream) Dropped() int64
func (*EventStream) Events ¶
func (s *EventStream) Events() <-chan trace.Event
type InterruptRecord ¶
type InterruptRecord struct {
ID string `json:"id"`
WorkflowID string `json:"workflow_id"`
SessionID string `json:"session_id,omitempty"`
RunID string `json:"run_id"`
Metadata map[string]string `json:"metadata,omitempty"`
NodeID string `json:"node_id"`
ResumeNode string `json:"resume_node"`
CheckpointID string `json:"checkpoint_id"`
Request graph.Interrupt `json:"request"`
Response *hitl.Response `json:"response,omitempty"`
CreatedAt time.Time `json:"created_at"`
ResolvedAt time.Time `json:"resolved_at,omitempty"`
}
type Invocation ¶
type Invocation[S any] struct { // contains filtered or unexported fields }
func (*Invocation[S]) Cancel ¶
func (i *Invocation[S]) Cancel()
func (*Invocation[S]) Done ¶
func (i *Invocation[S]) Done() <-chan AsyncResult[S]
type InvokeOption ¶
type InvokeOption func(*invokeConfig)
func WithMetadata ¶
func WithMetadata(metadata map[string]string) InvokeOption
func WithRunID ¶
func WithRunID(runID string) InvokeOption
func WithSession ¶
func WithSession(sessionID string) InvokeOption
func WithStartAt ¶
func WithStartAt(nodeID string) InvokeOption
type Option ¶
func WithCheckpointStore ¶
func WithCheckpointStore[S any](store checkpoint.Store) Option[S]
func WithEventContext ¶
func WithEventContext[S any](options EventContextOptions) Option[S]
func WithEventHandler ¶
func WithEventHandler[S any](handler EventHandler) Option[S]
func WithMaxSteps ¶
func WithSerializer ¶
func WithSerializer[S any](serializer checkpoint.Serializer[S]) Option[S]
type Result ¶
type Result[S any] struct { Run Run `json:"run"` State S `json:"state"` Events []trace.Event `json:"events"` Checkpoints []checkpoint.Checkpoint `json:"checkpoints"` }
type ResumeRequest ¶
type Run ¶
type Run struct {
ID string `json:"id"`
WorkflowID string `json:"workflow_id"`
SessionID string `json:"session_id,omitempty"`
Status Status `json:"status"`
Metadata map[string]string `json:"metadata,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at,omitempty"`
Error string `json:"error,omitempty"`
}
type Runner ¶
type Runner[S any] struct { // contains filtered or unexported fields }
func (*Runner[S]) InvokeAsync ¶
func (r *Runner[S]) InvokeAsync(ctx context.Context, initialState S, opts ...InvokeOption) *Invocation[S]
func (*Runner[S]) ResumeFrom ¶
Click to show internal directories.
Click to hide internal directories.