1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Turn audio into text or text into audio.
//!
//! Submodules: `speech` (text-to-speech, binary response),
//! `transcriptions` (speech-to-text in the input language), and
//! `translations` (speech-to-English). Streaming transcriptions (`stream`)
//! and `stream_format` audio streaming are not supported yet.
//!
//! > ![warn] The endpoints in this module are untested!
//! > No OpenAI-compatible provider accessible to this project (DeepSeek,
//! > Alibaba Cloud Model Studio) implements the `/audio/*` endpoints, and
//! > no OpenAI API key was available for testing. If you encounter any
//! > issues, please report them on the repository.
use Serialize;
/// The format of the transcription/translation output, in one of these
/// options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.
///
/// `diarized_json` (for `gpt-4o-transcribe-diarize`) is not covered by this
/// type yet; pass it through the request's `extra_body`-style escape hatch
/// if needed.
/// Serializes a unit-variant enum value to its bare string literal, e.g.
/// `Json` -> `"json"`. Used for multipart text fields.
pub