Documentation
¶
Overview ¶
Package openaitranscriptions implements the speech-to-text shape OpenAI defined and the compatible servers copied: a multipart POST to {base}/audio/transcriptions carrying file and model, answering {text}, or {text, segments} when response_format is verbose_json.
response_format is the one optional field that matters, and it differs by model: gpt-4o-transcribe and gpt-4o-mini-transcribe accept only json, whisper-1 also serves verbose_json, SiliconFlow documents no such field at all. json is the default everywhere it is documented, so nothing is sent unless api.TranscriptionsSettings names a format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks the OpenAI transcription shape to one endpoint.
func (*Client) FormFields ¶
FormFields is the golden-test entry point: the text parts of the form, in the order they are written.
func (*Client) Transcribe ¶
func (c *Client) Transcribe(ctx context.Context, req api.TranscriptionRequest) (*api.Transcription, error)
Transcribe sends one audio file.
type Config ¶
type Config struct {
Endpoint api.Endpoint
Settings api.TranscriptionsSettings
Retry api.RetryPolicy
}
Config is everything the client needs, already resolved by the api.