GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Why Go
  • Case Studies
  • Use Cases
  • Security
  • Learn
  • Effective Go
  • Go User Manual
  • Standard library
  • Release Notes
  • API
  • Packages
  • Recorded Talks
  • Meetups
  • Conferences

This view

  • Original page
  • New address

GeezerVison is showing pkg.go.dev — openai package - github.com/majorcontext/keep/judge/openai - Go Packages

Details

  • checked Valid go.mod file

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.

  • checked Redistributable license

    Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  • checked Tagged version

    Modules with tagged versions give importers more predictable builds.

  • unchecked Stable version

    When a project reaches major version v1 it is considered stable.

  • Learn more about best practices

Repository

github.com/majorcontext/keep

Links

  • Open Source Insights Logo Open Source Insights

Documentation ¶

Index ¶

  • func ResolveModel(model string) string
  • type Option
    • func WithBaseURL(url string) Option
  • type Provider
    • func New(apiKey string, opts ...Option) *Provider
    • func (p *Provider) Judge(ctx context.Context, req judge.Request) (judge.Verdict, error)

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.

Source Files ¶

View all Source files
  • models.go
  • provider.go
Click to show internal directories.
Click to hide internal directories.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.