Type-safe, sealed hierarchy of trace events emitted during LLM agent execution.
Each subtype carries the data relevant to one observable moment in the agent lifecycle (completion received, tool executed, token usage recorded, etc.). All subtypes are serialisable to JSON via toJson, which produces a flat object containing at minimum "event_type" and "timestamp" fields.
== Error truncation == ErrorOccurred.toJson includes only the first 5 frames of the stack trace to limit payload size.
== Timestamp default == Every case class defaults timestamp to Instant.now() at construction time. Override explicitly when replaying historical events or writing deterministic tests.
Attributes
- See also
-
Tracing for the interface that consumes these events
TraceEvent.createTraceEvent for the Langfuse batch-envelope helper
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class AgentInitializedclass AgentStateUpdatedclass CacheHitclass CacheMissclass CompletionReceivedclass CostRecordedclass CustomEventclass EmbeddingUsageRecordedclass ErrorOccurredclass RAGOperationCompletedclass TokenUsageRecordedclass ToolExecuted