Documentation
¶
Overview ¶
Package evals provides evaluation capabilities for Phoenix.
This package implements the llmops.Evaluator interface, enabling evaluation of LLM outputs with metrics and recording results to Phoenix.
Usage ¶
import (
"github.com/agentplexus/go-phoenix"
"github.com/agentplexus/go-phoenix/evals"
"github.com/agentplexus/omniobserve/llmops"
"github.com/agentplexus/omniobserve/llmops/metrics"
)
// Create Phoenix client
client, _ := phoenix.NewClient()
// Create evaluator
evaluator := evals.NewEvaluator(client)
// Run evaluation
result, _ := evaluator.Evaluate(ctx, llmops.EvalInput{
Input: "What is the capital of France?",
Output: "The capital of France is Paris.",
SpanID: "span-123",
}, metrics.NewExactMatchMetric())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator implements llmops.Evaluator for Phoenix.
func NewEvaluator ¶
NewEvaluator creates a new Phoenix evaluator.
func NewEvaluatorWithOptions ¶
func NewEvaluatorWithOptions(client *phoenix.Client, opts ...EvaluatorOption) *Evaluator
NewEvaluatorWithOptions creates an evaluator with options.
func (*Evaluator) AddFeedbackScore ¶
AddFeedbackScore adds a feedback score to a span or trace.
type EvaluatorOption ¶
type EvaluatorOption func(*Evaluator)
EvaluatorOption configures the Evaluator.
func WithRecordResults ¶
func WithRecordResults(record bool) EvaluatorOption
WithRecordResults sets whether to record results to Phoenix.
Click to show internal directories.
Click to hide internal directories.