Documentation
¶
Index ¶
- Constants
- func Payload(value any) json.RawMessage
- func WithEmitter(ctx context.Context, emit EmitFunc) context.Context
- func WithEventContext(ctx context.Context, eventContext *EventContext) context.Context
- type ContextChange
- type ContextSnapshot
- type EmitFunc
- type Event
- type EventContext
- type MemoryRecorder
- type Recorder
Constants ¶
View Source
const ( EventRunStarted = "run.started" EventRunCompleted = "run.completed" EventRunFailed = "run.failed" EventRunCancelled = "run.cancelled" EventRunInterrupted = "run.interrupted" EventRunResumed = "run.resumed" EventNodeStarted = "node.started" EventNodeCompleted = "node.completed" EventNodeFailed = "node.failed" EventEdgeSelected = "edge.selected" EventCheckpointSaved = "checkpoint.saved" EventPromptRendered = "prompt.rendered" EventPromptEstimated = "prompt.estimated" EventPromptAdjusted = "prompt.adjusted" EventLLMStarted = "llm.started" EventLLMDelta = "llm.delta" EventLLMCompleted = "llm.completed" EventLLMFailed = "llm.failed" EventToolStarted = "tool.started" EventToolProgress = "tool.progress" EventToolCompleted = "tool.completed" EventToolFailed = "tool.failed" EventMessageRead = "message.read" EventMessageWritten = "message.written" EventInterruptCreated = "interrupt.created" )
Variables ¶
This section is empty.
Functions ¶
func Payload ¶
func Payload(value any) json.RawMessage
func WithEventContext ¶
func WithEventContext(ctx context.Context, eventContext *EventContext) context.Context
Types ¶
type ContextChange ¶
type ContextChange struct {
Before json.RawMessage `json:"before,omitempty"`
After json.RawMessage `json:"after,omitempty"`
Ops json.RawMessage `json:"ops,omitempty"`
}
type ContextSnapshot ¶
type ContextSnapshot struct {
State json.RawMessage `json:"state,omitempty"`
Messages json.RawMessage `json:"messages,omitempty"`
Prompt json.RawMessage `json:"prompt,omitempty"`
LLMRequest json.RawMessage `json:"llm_request,omitempty"`
ToolCall json.RawMessage `json:"tool_call,omitempty"`
ToolResult json.RawMessage `json:"tool_result,omitempty"`
}
type Event ¶
type Event struct {
ID string `json:"id"`
Type string `json:"type"`
ProjectID string `json:"project_id,omitempty"`
WorkflowID string `json:"workflow_id"`
SessionID string `json:"session_id,omitempty"`
RunID string `json:"run_id"`
ParentID string `json:"parent_id,omitempty"`
NodeID string `json:"node_id,omitempty"`
Sequence int64 `json:"sequence"`
Time time.Time `json:"time"`
Payload json.RawMessage `json:"payload,omitempty"`
Context *EventContext `json:"context,omitempty"`
}
type EventContext ¶
type EventContext struct {
Current ContextSnapshot `json:"current"`
Change *ContextChange `json:"change,omitempty"`
}
func EventContextFromContext ¶
func EventContextFromContext(ctx context.Context) (*EventContext, bool)
type MemoryRecorder ¶
type MemoryRecorder struct {
// contains filtered or unexported fields
}
func NewMemoryRecorder ¶
func NewMemoryRecorder() *MemoryRecorder
Click to show internal directories.
Click to hide internal directories.