Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingPrompt = errors.New("openai: prompt not found in workflow graph") ErrRemoteMediaDisabled = errors.New("openai: remote media fetch is disabled by configuration") )
Functions ¶
func ConfigSchema ¶ added in v0.9.0
func ConfigSchema() []engine.ConfigField
ConfigSchema returns the configuration fields required by the OpenAI engine.
func DefaultProvider ¶ added in v0.15.0
DefaultProvider returns preset engine configurations for openai.
func ModelInfos ¶ added in v0.16.0
ModelInfos returns i18n metadata for all OpenAI image models.
func ModelsByCapability ¶ added in v0.7.0
ModelsByCapability returns all known OpenAI models grouped by capability.
Types ¶
type Config ¶
type Config struct {
APIKey string
BaseURL string
Model string
Quality string
Style string
// gpt-image-* 专属可选参数
Background string // transparent | opaque | auto
OutputFormat string // png | jpeg | webp
Moderation string // low | auto
OutputCompression int // 0-100, 仅 jpeg/webp 生效
// AllowRemoteImageFetch 控制 image_url 是否允许 HTTP GET(默认 true)。
DisableRemoteMediaFetch bool
HTTPClient *http.Client
}
Config configures the OpenAI image engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine compiles a workflow graph into an OpenAI image request.
func (*Engine) Capabilities ¶
func (e *Engine) Capabilities() engine.Capability
Capabilities implements engine.Describer.
Click to show internal directories.
Click to hide internal directories.