openai

package
v0.0.0-...-9dee9fb Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package openai provides an AIProvider implementation for the OpenAI API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey  string // Defaults to OPENAI_API_KEY env var
	Model   string // Defaults to gpt-4o
	BaseURL string // Defaults to https://api.openai.com/v1
}

Config holds configuration for the OpenAI provider.

type Provider

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

Provider implements ai.AIProvider for OpenAI models.

func New

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

New creates a new OpenAI AIProvider.

func (*Provider) Complete

func (*Provider) CompleteStream

func (p *Provider) CompleteStream(_ context.Context, _ ai.CompletionRequest) (<-chan ai.StreamChunk, error)

func (*Provider) Models

func (p *Provider) Models() []ai.ModelInfo

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) SupportsToolUse

func (p *Provider) SupportsToolUse() bool

func (*Provider) ToolComplete

Jump to

Keyboard shortcuts

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