pub struct ServerMessageVoiceRequest {
pub phone_number: Option<Box<ServerMessageAssistantRequestPhoneNumber>>,
pub type: Type,
pub timestamp: Option<String>,
pub artifact: Option<Box<Artifact>>,
pub assistant: Option<Box<CreateAssistantDto>>,
pub customer: Option<Box<CreateCustomerDto>>,
pub call: Option<Box<Call>>,
pub text: String,
pub sample_rate: f64,
}Fields§
§phone_number: Option<Box<ServerMessageAssistantRequestPhoneNumber>>§type: TypeThis is the type of the message. "voice-request" is sent when using assistant.voice={ \"type\": \"custom-voice\" }. Here is what the request will look like: POST https://{assistant.voice.server.url} Content-Type: application/json { "messsage": { "type": "voice-request", "text": "Hello, world!", "sampleRate": 24000, …other metadata about the call… } } The expected response is 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); });
timestamp: Option<String>This is the ISO-8601 formatted timestamp of when the message was sent.
artifact: Option<Box<Artifact>>This is a live version of the call.artifact. This matches what is stored on call.artifact after the call.
assistant: Option<Box<CreateAssistantDto>>This is the assistant that is currently active. This is provided for convenience. This matches one of the following: - call.assistant, - call.assistantId, - call.squad[n].assistant, - call.squad[n].assistantId, - call.squadId->[n].assistant, - call.squadId->[n].assistantId.
customer: Option<Box<CreateCustomerDto>>This is the customer associated with the call. This matches one of the following: - call.customer, - call.customerId.
call: Option<Box<Call>>This is the call object. This matches what was returned in POST /call. Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id.
text: StringThis is the text to be synthesized.
sample_rate: f64This is the sample rate to be synthesized.
Implementations§
Trait Implementations§
Source§impl Clone for ServerMessageVoiceRequest
impl Clone for ServerMessageVoiceRequest
Source§fn clone(&self) -> ServerMessageVoiceRequest
fn clone(&self) -> ServerMessageVoiceRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more