openai_struct/models/
create_transcription_request.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11#[allow(unused_imports)]
12use serde_json::Value;
13
14#[derive(Debug, Serialize, Deserialize)]
15pub struct CreateTranscriptionRequest {
16    /// The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
17    #[serde(rename = "file")]
18    pub file: Vec<u8>,
19    /// Additional information to include in the transcription response.  `logprobs` will return the log probabilities of the tokens in the  response to understand the model's confidence in the transcription.  `logprobs` only works with response_format set to `json` and only with  the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
20    #[serde(rename = "include[]")]
21    pub include: Option<Vec<crate::models::TranscriptionInclude>>,
22    /// The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency.
23    #[serde(rename = "language")]
24    pub language: Option<String>,
25    /// ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model).
26    #[serde(rename = "model")]
27    pub model: Value,
28    /// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language.
29    #[serde(rename = "prompt")]
30    pub prompt: Option<String>,
31    #[serde(rename = "response_format")]
32    pub response_format: Option<crate::models::AudioResponseFormat>,
33    /// If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).  See the [Streaming section of the Speech-to-Text guide](/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) for more information.  Note: Streaming is not supported for the `whisper-1` model and will be ignored.
34    #[serde(rename = "stream")]
35    pub stream: Option<bool>,
36    /// The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
37    #[serde(rename = "temperature")]
38    pub temperature: Option<f32>,
39    /// The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are pub supported: `word`, or `segment`. pub Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
40    #[serde(rename = "timestamp_granularities[]")]
41    pub timestamp_granularities: Option<Vec<String>>,
42}