async_openai/audio/
audio_.rs1#![allow(deprecated)]
2use crate::{config::Config, Client, RequestOptions};
3
4use super::{Speech, Transcriptions, Translations, VoiceConsents, Voices};
5
6pub struct Audio<'c, C: Config> {
9 client: &'c Client<C>,
10 pub(crate) request_options: RequestOptions,
11}
12
13impl<'c, C: Config> Audio<'c, C> {
14 pub fn new(client: &'c Client<C>) -> Self {
15 Self {
16 client,
17 request_options: RequestOptions::new(),
18 }
19 }
20
21 pub fn speech(&self) -> Speech<'_, C> {
23 Speech::new(self.client)
24 }
25
26 pub fn transcription(&self) -> Transcriptions<'_, C> {
28 Transcriptions::new(self.client)
29 }
30
31 pub fn translation(&self) -> Translations<'_, C> {
33 Translations::new(self.client)
34 }
35
36 pub fn voice_consents(&self) -> VoiceConsents<'_, C> {
38 VoiceConsents::new(self.client)
39 }
40
41 pub fn voices(&self) -> Voices<'_, C> {
43 Voices::new(self.client)
44 }
45}