pub struct Client {
api_key: Option<String>,
base: String,
}Expand description
ElevenLabs(api_key=os.environ.get("ELEVENLABS_API_KEY")).
Fields§
§api_key: Option<String>§base: StringImplementations§
Source§impl Client
impl Client
pub fn new(api_key: Option<String>) -> Client
pub fn has_key(&self) -> bool
fn request(&self, method: &str, path: &str) -> Request
Sourcepub fn voices_get_all(&self) -> Result<Value, ApiError>
pub fn voices_get_all(&self) -> Result<Value, ApiError>
client.voices.get_all().
Sourcepub fn text_to_speech(
&self,
voice_id: &str,
text: &str,
model_id: &str,
output_format: &str,
voice_settings: Option<Value>,
) -> Result<Vec<u8>, ApiError>
pub fn text_to_speech( &self, voice_id: &str, text: &str, model_id: &str, output_format: &str, voice_settings: Option<Value>, ) -> Result<Vec<u8>, ApiError>
client.text_to_speech.convert(voice_id, text=, model_id=, output_format=, voice_settings=) collected into bytes.
voice_settings: None leaves the field out; Some(Value::Null)
sends null, which is what passing voice_settings=None explicitly
does in the SDK.
Sourcepub fn sound_generation(
&self,
text: &str,
duration_seconds: Option<f64>,
prompt_influence: Option<f64>,
) -> Result<Vec<u8>, ApiError>
pub fn sound_generation( &self, text: &str, duration_seconds: Option<f64>, prompt_influence: Option<f64>, ) -> Result<Vec<u8>, ApiError>
client.text_to_sound_effects.convert(text=, duration_seconds=, prompt_influence=) collected into bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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