vapi_client/models/
fallback_custom_voice.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FallbackCustomVoice {
16    /// This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    /// This is where the voice request will be sent.  Request Example:  POST https://{server.url} Content-Type: application/json  {   \"message\": {     \"type\": \"voice-request\",     \"text\": \"Hello, world!\",     \"sampleRate\": 24000,     ...other metadata about the call...   } }  Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport: ``` response.on('data', (chunk: Buffer) => {   outputStream.write(chunk); }); ```
20    #[serde(rename = "server")]
21    pub server: models::Server,
22    /// This is the plan for chunking the model output before it is sent to the voice provider.
23    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
24    pub chunk_plan: Option<models::ChunkPlan>,
25}
26
27impl FallbackCustomVoice {
28    pub fn new(provider: Provider, server: models::Server) -> FallbackCustomVoice {
29        FallbackCustomVoice {
30            provider,
31            server,
32            chunk_plan: None,
33        }
34    }
35}
36/// This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Provider {
39    #[serde(rename = "custom-voice")]
40    CustomVoice,
41}
42
43impl Default for Provider {
44    fn default() -> Provider {
45        Self::CustomVoice
46    }
47}
48