TraceEvent

org.llm4s.trace.TraceEvent
See theTraceEvent companion trait
object TraceEvent

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
TraceEvent.type

Members list

Type members

Classlikes

case class AgentInitialized(query: String, tools: Vector[String], timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class AgentStateUpdated(status: String, messageCount: Int, logCount: Int, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class CompletionReceived(id: String, model: String, toolCalls: Int, content: String, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class CostRecorded(costUsd: Double, model: String, operation: String, tokenCount: Int, costType: String, timestamp: Instant) extends TraceEvent

Tracks cost in USD for any model operation.

Tracks cost in USD for any model operation.

Value parameters

costType

Category: "embedding", "completion", "total"

costUsd

Estimated cost in US dollars

model

Model name used for pricing lookup

operation

Type of operation: "embedding", "completion", "evaluation"

tokenCount

Total tokens consumed

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class CustomEvent(name: String, data: Value, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class EmbeddingUsageRecorded(usage: EmbeddingUsage, model: String, operation: String, inputCount: Int, timestamp: Instant) extends TraceEvent

Tracks embedding token usage for cost analysis.

Tracks embedding token usage for cost analysis.

Value parameters

inputCount

Number of texts embedded in this operation

model

Embedding model name (e.g., "text-embedding-3-small")

operation

Type of operation: "indexing", "query", "evaluation"

usage

Token usage statistics from embedding operation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class ErrorOccurred(error: Throwable, context: String, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class RAGOperationCompleted(operation: String, durationMs: Long, embeddingTokens: Option[Int], llmPromptTokens: Option[Int], llmCompletionTokens: Option[Int], totalCostUsd: Option[Double], timestamp: Instant) extends TraceEvent

Tracks completion of a RAG operation with full metrics.

Tracks completion of a RAG operation with full metrics.

Value parameters

durationMs

Wall-clock duration in milliseconds

embeddingTokens

Optional token count for embedding operations

llmCompletionTokens

Optional completion tokens for LLM operations

llmPromptTokens

Optional prompt tokens for LLM operations

operation

Type: "index", "search", "answer", "evaluate"

totalCostUsd

Optional accumulated cost in USD

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class TokenUsageRecorded(usage: TokenUsage, model: String, operation: String, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all
case class ToolExecuted(name: String, input: String, output: String, duration: Long, success: Boolean, timestamp: Instant) extends TraceEvent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def createTraceEvent(traceId: String, now: String, environment: String, release: String, version: String, traceInput: String, traceOutput: String, modelName: String, messageCount: Int): Obj