openai

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 8 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 struct {
	APIKey          string
	Model           string
	BaseURL         string
	EndpointURL     string
	AllowUnsafeURL  bool
	HTTPClient      *http.Client
	Retry           gaugo.RetryConfig
	MaxResponseBody int64
}

Config configures an OpenAI Chat Completions judge.

func (Config) Validate

func (cfg Config) Validate() error

Validate reports invalid OpenAI configuration.

type Judge

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

Judge evaluates metric prompts with OpenAI.

func New

func New(cfg Config) (*Judge, error)

New returns a configured OpenAI judge.

func (*Judge) EvaluateJSON

func (j *Judge) EvaluateJSON(ctx context.Context, req gaugo.JudgeRequest) (gaugo.JudgeResponse, error)

EvaluateJSON evaluates one structured metric request.

Jump to

Keyboard shortcuts

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