judge

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Messages() []datamodel.Message
	ModelParam(key string) (ldvalue.Value, bool)
	CustomModelParam(key string) (ldvalue.Value, bool)
	EvaluationMetricKey() string
	EvaluationMetricKeys() []string
}

type Judge

type Judge struct {
	// contains filtered or unexported fields
}

func New

func New(config Config, tracker Tracker, provider Provider, configKey string, logger interfaces.LDLoggers) (*Judge, error)

func (*Judge) Evaluate

func (j *Judge) Evaluate(input, output string, samplingRate float64) (*datamodel.JudgeResponse, error)

func (*Judge) EvaluateMessages

func (j *Judge) EvaluateMessages(messages []datamodel.Message, response string, samplingRate float64) (*datamodel.JudgeResponse, error)

func (*Judge) GetConfig

func (j *Judge) GetConfig() Config

func (*Judge) GetProvider

func (j *Judge) GetProvider() Provider

func (*Judge) GetTracker

func (j *Judge) GetTracker() Tracker

type Provider

type Provider interface {
	InvokeStructuredModel(messages []datamodel.Message, schema map[string]interface{}) (StructuredResponse, error)
}

type StructuredResponse

type StructuredResponse struct {
	Content map[string]interface{}
	Usage   ldai.TokenUsage
}

type Tracker

type Tracker interface {
	TrackJudgeResponse(response datamodel.JudgeResponse) error
	TrackTokens(usage ldai.TokenUsage) error
}

Jump to

Keyboard shortcuts

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