RAGASLangfuseObserver

org.llm4s.rag.evaluation.RAGASLangfuseObserver
See theRAGASLangfuseObserver companion object
class RAGASLangfuseObserver(langfuseUrl: String, publicKey: String, secretKey: String, environment: String, release: String, version: String, batchSender: LangfuseBatchSender)

Observer that logs RAGAS evaluation results to Langfuse.

Integrates with existing Langfuse tracing infrastructure to log:

  • Individual metric scores
  • Composite RAGAS scores
  • Evaluation details and metadata

Value parameters

environment

Environment name (e.g., "production", "development")

langfuseUrl

The Langfuse API URL

publicKey

Langfuse public key

release

Release version

secretKey

Langfuse secret key

version

API version

Attributes

Example
{
val observer = RAGASLangfuseObserver.fromTracingSettings(tracingSettings)
val result = evaluator.evaluate(sample)
result.foreach { evalResult =>
 observer.logEvaluation(evalResult)
}

}

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def logEvaluation(result: EvalResult, traceId: Option[String]): Unit

Log a single evaluation result to Langfuse.

Log a single evaluation result to Langfuse.

Creates a trace with the evaluation details and scores for each metric.

Value parameters

result

The evaluation result to log

traceId

Optional trace ID to link to an existing trace

Attributes

def logEvaluationSummary(summary: EvalSummary): Unit

Log a batch evaluation summary to Langfuse.

Log a batch evaluation summary to Langfuse.

Value parameters

summary

The evaluation summary to log

Attributes