Documentation
¶
Overview ¶
Package openai provides an llm.Provider backed by OpenAI's Chat Completions API. It is a thin hand-written client over net/http; it pulls in no third-party deps and lives out of the core so the console binary does not link it (it ships as the console-plugin-openai executable).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAI ¶
OpenAI is an llm.Provider backed by OpenAI's Chat Completions API.
func New ¶
New constructs an OpenAI provider. If apiKey is empty, it falls back to the OPENAI_API_KEY environment variable. Defaults: Model "gpt-4o-mini", BaseURL "https://api.openai.com", and a 60s HTTP client.
type Option ¶
type Option func(*OpenAI)
Option configures an OpenAI provider in New.
func WithBaseURL ¶
WithBaseURL overrides the API base URL (e.g. to point at a test server).
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used for requests.