openai

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter translates the OpenAI-compatible Chat Completions protocol.

func NewAdapter

func NewAdapter(httpClient *http.Client) *Adapter

NewAdapter creates an adapter that uses httpClient for requests. A nil client uses http.DefaultClient.

func (*Adapter) Protocol

func (a *Adapter) Protocol() llm.Protocol

Protocol returns the registry key for the Chat Completions protocol.

func (*Adapter) Stream

func (a *Adapter) Stream(
	ctx context.Context,
	model llm.Model,
	input llm.Context,
	options llm.StreamOptions,
) (<-chan llm.Event, error)

Stream validates and translates a request, then delegates the asynchronous response lifecycle to consumeStream.

Jump to

Keyboard shortcuts

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