openai

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultModel is the recommended default model (fast and capable)
	DefaultModel = "gpt-4o-mini"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements the OpenAI LLM backend.

func New

func New(apiKey string) *Provider

New creates a new OpenAI provider.

func (*Provider) CreateStream

func (p *Provider) CreateStream(ctx context.Context, opts llm.StreamOptions) (<-chan llm.StreamEvent, error)

func (*Provider) DefaultModel

func (p *Provider) DefaultModel() string

DefaultModel returns the configured default model ID.

func (*Provider) Models

func (p *Provider) Models() []llm.Model

Models returns a curated list of popular OpenAI models.

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) WithDefaultModel

func (p *Provider) WithDefaultModel(modelID string) *Provider

WithDefaultModel sets the default model to use.

Jump to

Keyboard shortcuts

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