pub struct CreateTranslationRequest {
pub model: String,
pub prompt: Option<String>,
pub response_format: Option<TranscriptionResponseFormat>,
pub temperature: Option<f32>,
}Expand description
Request for translating audio to English.
§Example
use portkey_sdk::model::{CreateTranslationRequest, TranscriptionResponseFormat};
let request = CreateTranslationRequest {
model: "whisper-1".to_string(),
prompt: Some("Optional prompt in English".to_string()),
response_format: Some(TranscriptionResponseFormat::Json),
temperature: Some(0.0),
};Fields§
§model: StringID of the model to use.
Options are gpt-4o-transcribe, gpt-4o-mini-transcribe, and whisper-1.
prompt: Option<String>Optional text to guide the model’s style.
The prompt should be in English.
response_format: Option<TranscriptionResponseFormat>The format of the translation 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.
Trait Implementations§
Source§impl Clone for CreateTranslationRequest
impl Clone for CreateTranslationRequest
Source§fn clone(&self) -> CreateTranslationRequest
fn clone(&self) -> CreateTranslationRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateTranslationRequest
impl Debug for CreateTranslationRequest
Source§impl Default for CreateTranslationRequest
impl Default for CreateTranslationRequest
Source§fn default() -> CreateTranslationRequest
fn default() -> CreateTranslationRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CreateTranslationRequest
impl<'de> Deserialize<'de> for CreateTranslationRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CreateTranslationRequest
impl RefUnwindSafe for CreateTranslationRequest
impl Send for CreateTranslationRequest
impl Sync for CreateTranslationRequest
impl Unpin for CreateTranslationRequest
impl UnwindSafe for CreateTranslationRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more