Documentation
¶
Overview ¶
Package openai implements chat.Client with the OpenAI Responses API; it also works with endpoints compatible with the Responses API (such as DeepSeek).
Index ¶
Constants ¶
const (
// ModelGPT6Luna is the default model.
ModelGPT6Luna = "gpt-6-luna"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyProvider ¶
APIKeyProvider resolves the API key dynamically, for short-lived tokens.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Responses API of the OpenAI SDK.
type Config ¶
type Config struct {
APIKey string
APIKeyProvider APIKeyProvider
BaseURL string
Model string
MaxInputTokens int
MaxOutputTokens int
Timeout time.Duration
MaxRetries int
Headers map[string]string
HTTPClient *http.Client
// Reasoning means the model is a reasoning model: requests ask for reasoning.summary and for encrypted reasoning content,
// so history can be replayed statelessly. Regular models reject these parameters, so it is off by default.
Reasoning bool
// ImageGeneration enables the built-in image_generation tool so the model can generate images in its replies.
// Images in assistant messages in history (including those generated by other models) are replayed as input_image in a user message regardless of this setting.
ImageGeneration bool
// DisableStoreParams means the endpoint does not recognize the store / include parameters (such as DeepSeek), so they are not sent.
DisableStoreParams bool
// TextOnly means the endpoint accepts no media input.
TextOnly bool
// NoStructuredOutput means the endpoint does not support the json_schema output format; the format requirements go into the system prompt instead.
NoStructuredOutput bool
// HTTPHooks are debugging hooks at the raw HTTP layer.
HTTPHooks chat.HTTPHooks
}
Config configures the Responses API Client.