Documentation
¶
Overview ¶
Package openai implements agent.ChatModel against the OpenAI Chat Completions API. The package uses only net/http and encoding/json.
Wire reference:
Index ¶
Constants ¶
const DefaultBaseURL = "https://api.openai.com"
DefaultBaseURL is the production OpenAI API endpoint. Override via Option WithBaseURL for tests, proxies, or OpenAI-compatible endpoints (Azure OpenAI, vLLM, llama.cpp, Ollama in OpenAI mode).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider during construction.
func WithHTTPClient ¶
WithHTTPClient overrides the HTTP client.
func WithOrganization ¶
WithOrganization sets the OpenAI-Organization header.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements agent.ChatModel against the OpenAI Chat Completions API. Construct with New; do not zero-value.
func (*Provider) Generate ¶
func (p *Provider) Generate(ctx context.Context, req agent.ChatRequest) (agent.ChatResponse, error)
Generate dispatches a synchronous Chat Completions request.