Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a Provider for the given model.
The model's Provider field determines which implementation to use:
- "anthropic": Anthropic API (Claude models)
- "openai": OpenAI API (GPT/o-series models). Uses OAuth constructor when IsOAuth=true.
Returns error for unsupported or empty provider names.
Types ¶
type Config ¶
type Config struct {
APIKey string // API key or OAuth access token
IsOAuth bool // Whether APIKey is an OAuth token
AccountID string // OpenAI OAuth account ID (required when IsOAuth=true for OpenAI)
AuthKind AuthKind
// RefreshOAuth is called only by consumer transports after a rejected OAuth
// access token. API-key transports never invoke it.
RefreshOAuth func(rejectedToken string) (string, error)
}
Config holds credentials needed to create a provider.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package openai implements core.Provider for the OpenAI Responses API.
|
Package openai implements core.Provider for the OpenAI Responses API. |
|
Package responses implements the provider-neutral Responses API wire codec.
|
Package responses implements the provider-neutral Responses API wire codec. |
|
Package retry provides HTTP retry logic with exponential backoff for LLM provider API calls.
|
Package retry provides HTTP retry logic with exponential backoff for LLM provider API calls. |
|
Package sseutil provides shared utilities for SSE stream handling across LLM provider implementations.
|
Package sseutil provides shared utilities for SSE stream handling across LLM provider implementations. |
|
Package xai implements the public xAI Responses API transport.
|
Package xai implements the public xAI Responses API transport. |
Click to show internal directories.
Click to hide internal directories.