Skip to main content

Module factories

Module factories 

Source
Expand description

Ergonomic constructors for every event type.

These mirror the create*Event helpers in the TypeScript SDK: each takes the fields the schema requires and leaves the optional ones unset. Anything optional is set afterwards, either on the payload struct or through Event::with_timestamp and Event::with_raw_event.

let paused = Event::run_finished_interrupt(
    "thread-1",
    "run-1",
    vec![Interrupt::new("i-1", "tool_approval")],
)
.with_timestamp(1_700_000_000_000);