Documentation
¶
Index ¶
- Constants
- Variables
- func FetchModelsDirectly(ctx context.Context, baseURL, apiKey, providerName string, ...) ([]string, error)
- type Client
- func NewClient() (ret *Client)
- func NewClientCompatible(vendorName string, defaultBaseUrl string, configureCustom func() error) (ret *Client)
- func NewClientCompatibleNoSetupQuestions(vendorName string, configureCustom func() error) (ret *Client)
- func NewClientCompatibleWithResponses(vendorName string, defaultBaseUrl string, implementsResponses bool, ...) (ret *Client)
- func (o *Client) ListModels() (ret []string, err error)
- func (o *Client) NeedsRawMode(modelName string) bool
- func (o *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, ...) (ret string, err error)
- func (o *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, ...) (err error)
- func (o *Client) SetResponsesAPIEnabled(enabled bool)
- func (o *Client) TranscribeFile(ctx context.Context, filePath, model string, split bool) (string, error)
- type MessageConversionResult
Constants ¶
const ImageGenerationResponseType = "image_generation_call"
ImageGenerationResponseType is the type used for image generation calls in responses
const ImageGenerationToolType = "image_generation"
const MaxAudioFileSize int64 = 25 * 1024 * 1024
MaxAudioFileSize defines the maximum allowed size for audio uploads (25MB).
Variables ¶
var AllowedTranscriptionModels = []string{ string(openai.AudioModelWhisper1), string(openai.AudioModelGPT4oMiniTranscribe), string(openai.AudioModelGPT4oTranscribe), }
AllowedTranscriptionModels lists the models supported for transcription.
var ImageGenerationSupportedModels = []string{
"gpt-4.1-nano",
"o3",
"gpt-5",
"gpt-5-nano",
"gpt-5.2",
}
ImageGenerationSupportedModels lists all models that support image generation
Functions ¶
func FetchModelsDirectly ¶ added in v1.4.331
func FetchModelsDirectly(ctx context.Context, baseURL, apiKey, providerName string, httpClient *http.Client) ([]string, error)
FetchModelsDirectly is used to fetch models directly from the API when the standard OpenAI SDK method fails due to a nonstandard format. This is useful for providers that return a direct array of models (e.g., GitHub Models) or other OpenAI-compatible implementations. If httpClient is nil, a new client with default settings will be created.
Types ¶
type Client ¶
type Client struct {
*plugins.PluginBase
ApiKey *plugins.SetupQuestion
ApiBaseURL *plugins.SetupQuestion
ApiClient *openai.Client
ImplementsResponses bool // Whether this provider supports the Responses API
// contains filtered or unexported fields
}
func NewClientCompatible ¶
func (*Client) ListModels ¶
func (*Client) NeedsRawMode ¶
func (*Client) Send ¶
func (o *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions) (ret string, err error)
func (*Client) SendStream ¶
func (o *Client) SendStream( msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, channel chan domain.StreamUpdate, ) (err error)
func (*Client) SetResponsesAPIEnabled ¶ added in v1.4.257
SetResponsesAPIEnabled configures whether to use the Responses API
func (*Client) TranscribeFile ¶ added in v1.4.291
func (o *Client) TranscribeFile(ctx context.Context, filePath, model string, split bool) (string, error)
TranscribeFile transcribes the given audio file using the specified model. If the file exceeds the size limit, it can optionally be split into chunks using ffmpeg.
type MessageConversionResult ¶
type MessageConversionResult struct {
Role string
Content string
MultiContent []chat.ChatMessagePart
HasMultiContent bool
}
MessageConversionResult holds the common conversion result