openai

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package openai provides access to the OpenAI Chat Completions API and any OpenAI-compatible API (e.g. local models via llama.cpp server).

Index

Constants

View Source
const (
	ProviderName = "openai"
	DefaultModel = "gpt-4o"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	APIKey  string
	BaseURL string
	// contains filtered or unexported fields
}

func New

func New(apiKey, baseURL string) *Provider

func (*Provider) Complete

func (p *Provider) Complete(ctx context.Context, prompt string, opts provider.Options) (*provider.Result, error)

func (*Provider) DefaultModel

func (p *Provider) DefaultModel() string

func (*Provider) Name

func (p *Provider) Name() string

Jump to

Keyboard shortcuts

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