Struct openai_api_rs::v1::audio::AudioSpeechRequest
source · pub struct AudioSpeechRequest {
pub model: String,
pub input: String,
pub voice: String,
pub output: String,
}
Fields§
§model: String
§input: String
§voice: String
§output: String
Implementations§
source§impl AudioSpeechRequest
impl AudioSpeechRequest
sourcepub fn new(model: String, input: String, voice: String, output: String) -> Self
pub fn new(model: String, input: String, voice: String, output: String) -> Self
Examples found in repository?
examples/text_to_speech.rs (lines 8-13)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(env::var("OPENAI_API_KEY").unwrap().to_string());
let req = AudioSpeechRequest::new(
TTS_1.to_string(),
String::from("Money is not problem, Problem is no money"),
audio::VOICE_ALLOY.to_string(),
String::from("problem.mp3"),
);
let result = client.audio_speech(req)?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
source§impl Clone for AudioSpeechRequest
impl Clone for AudioSpeechRequest
source§fn clone(&self) -> AudioSpeechRequest
fn clone(&self) -> AudioSpeechRequest
Returns a copy 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 AudioSpeechRequest
impl Debug for AudioSpeechRequest
Auto Trait Implementations§
impl RefUnwindSafe for AudioSpeechRequest
impl Send for AudioSpeechRequest
impl Sync for AudioSpeechRequest
impl Unpin for AudioSpeechRequest
impl UnwindSafe for AudioSpeechRequest
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