RAGOperationCompleted

org.llm4s.trace.TraceEvent.RAGOperationCompleted
See theRAGOperationCompleted companion object
final case class RAGOperationCompleted extends TraceEvent

Tracks completion of a RAG operation with full metrics.

Value parameters

duration

Wall-clock duration

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

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

Members list

Value members

Concrete methods

def eventType: String
def toJson: Value
def withDuration(duration: FiniteDuration): RAGOperationCompleted
def withEmbeddingTokens(embeddingTokens: Int): RAGOperationCompleted
def withEmbeddingTokens(embeddingTokens: Option[Int]): RAGOperationCompleted
def withLlmCompletionTokens(llmCompletionTokens: Int): RAGOperationCompleted
def withLlmCompletionTokens(llmCompletionTokens: Option[Int]): RAGOperationCompleted
def withLlmPromptTokens(llmPromptTokens: Int): RAGOperationCompleted
def withLlmPromptTokens(llmPromptTokens: Option[Int]): RAGOperationCompleted
def withOperation(operation: String): RAGOperationCompleted
def withTimestamp(timestamp: Instant): RAGOperationCompleted
def withTotalCostUsd(totalCostUsd: Double): RAGOperationCompleted
def withTotalCostUsd(totalCostUsd: Option[Double]): RAGOperationCompleted

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def span: Option[TraceSpan]

Where this event sits in a trace, when its emitter places it in one (design 4.58): the span it is, that span's parent and when it started; the event's timestamp is its end. None for an event traced on its own. Only TraceEvent.CustomEvent, TraceEvent.TokenUsageRecorded, TraceEvent.ErrorOccurred and TraceEvent.AgentRunEnded carry one.

Where this event sits in a trace, when its emitter places it in one (design 4.58): the span it is, that span's parent and when it started; the event's timestamp is its end. None for an event traced on its own. Only TraceEvent.CustomEvent, TraceEvent.TokenUsageRecorded, TraceEvent.ErrorOccurred and TraceEvent.AgentRunEnded carry one.

Attributes

Inherited from:
TraceEvent