A single ordered, protocol-neutral execution event.
kinds/0 is the complete list of kinds Imp emits:
:run_started,:run_finished,:run_failed,:run_cancelled— the run's lifecycle. Exactly one of the last three ends a run;:run_finishedcarries the program's prediction as itsoutput.:model_request,:model_response— oneImp.LM.request/2call.:tools_sent— the tool definitions a request sent, once per run per distinct roster.:tool_call,:tool_result— one tool call a ReActV2 or RLM loop made, and what came of it;metadata.outcomeis the call'sImp.Tool.outcome/0.:reasoning— a thought the model reported.:context_projected— older episodes left out of one request after a provider refused it for length.:capture_gap— events evicted from the snapshot.
A host may emit kinds of its own inside a run with Imp.Run.emit/2; they
are atoms not in kinds/0. Imp.Trajectory.to_atif/2 reads a stored event
whose kind it does not know with the kind kept as the stored string.
Summary
Functions
Every event kind Imp emits, in the order the module documentation lists them.
Serializes a native event for JSON storage, redacting again at the boundary.
Types
@type kind() ::
:run_started
| :run_finished
| :run_failed
| :run_cancelled
| :model_request
| :model_response
| :tools_sent
| :tool_call
| :tool_result
| :reasoning
| :context_projected
| :capture_gap
One of kinds/0.
@type t() :: %Imp.Run.Event{ component: module() | atom() | String.t() | nil, error: term(), input: term(), kind: kind() | atom() | String.t(), metadata: map(), output: term(), reasoning: term(), run_id: String.t(), sequence: non_neg_integer(), timestamp: String.t() | nil, tool_call_id: String.t() | nil, tool_name: atom() | String.t() | nil }
Functions
@spec kinds() :: [kind()]
Every event kind Imp emits, in the order the module documentation lists them.
Serializes a native event for JSON storage, redacting again at the boundary.