evals

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 5 Imported by: 0

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

func NewEvaluator(client *phoenix.Client) *Evaluator

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

func (e *Evaluator) AddFeedbackScore(ctx context.Context, opts llmops.FeedbackScoreOpts) error

AddFeedbackScore adds a feedback score to a span or trace.

func (*Evaluator) Evaluate

func (e *Evaluator) Evaluate(ctx context.Context, input llmops.EvalInput, metrics ...llmops.Metric) (*llmops.EvalResult, error)

Evaluate runs metrics on the input and optionally records results to Phoenix.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL