pub struct CreateTranscriptionRequest {
pub model: String,
pub language: Option<String>,
pub prompt: Option<String>,
pub response_format: Option<TranscriptionResponseFormat>,
pub temperature: Option<f32>,
pub timestamp_granularities: Option<Vec<TimestampGranularity>>,
}Expand description
Request for creating an audio transcription.
§Example
use portkey_sdk::model::{CreateTranscriptionRequest, TranscriptionResponseFormat};
let request = CreateTranscriptionRequest {
model: "whisper-1".to_string(),
language: Some("en".to_string()),
response_format: Some(TranscriptionResponseFormat::Json),
temperature: Some(0.0),
..Default::default()
};Fields§
§model: StringID of the model to use.
Options are gpt-4o-transcribe, gpt-4o-mini-transcribe, and whisper-1.
language: Option<String>The language of the input audio in ISO-639-1 format.
Supplying the input language will improve accuracy and latency.
prompt: Option<String>Optional text to guide the model’s style or continue a previous audio segment.
The prompt should match the audio language.
response_format: Option<TranscriptionResponseFormat>The format of the transcript output.
Options: json, text, srt, verbose_json, or vtt. Defaults to json.
temperature: Option<f32>The sampling temperature, between 0 and 1.
Higher values like 0.8 make output more random, lower values like 0.2 make it more focused. If set to 0, the model will use log probability to automatically increase temperature.
timestamp_granularities: Option<Vec<TimestampGranularity>>The timestamp granularities to populate for this transcription.
response_format must be set to verbose_json to use timestamp granularities.
Either or both of word or segment are supported. Note: word timestamps incur
additional latency.
Trait Implementations§
Source§impl Clone for CreateTranscriptionRequest
impl Clone for CreateTranscriptionRequest
Source§fn clone(&self) -> CreateTranscriptionRequest
fn clone(&self) -> CreateTranscriptionRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more