openai

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveModel

func ResolveModel(model string) string

ResolveModel expands a model shortcut to its full identifier. If the model is not a known shortcut, it is returned as-is.

Types

type Option

type Option func(*Provider)

Option configures a Provider.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL overrides the default OpenAI API base URL.

type Provider

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

Provider implements judge.Provider using OpenAI's Chat Completions API.

func New

func New(apiKey string, opts ...Option) *Provider

New creates an OpenAI judge provider with the given API key.

func (*Provider) Judge

func (p *Provider) Judge(ctx context.Context, req judge.Request) (judge.Verdict, error)

Judge sends content to OpenAI for evaluation and returns a verdict. It uses structured outputs (json_schema response format) to guarantee valid JSON.

Jump to

Keyboard shortcuts

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