pub struct FallbackCustomTranscriber {
pub provider: ProviderTrue,
pub server: Server,
}Fields§
§provider: ProviderTrueThis is the transcription provider that will be used. Use custom-transcriber for providers that are not natively supported.
server: ServerThis is where the transcription request will be sent. Usage: 1. Vapi will initiate a websocket connection with server.url. 2. Vapi will send an initial text frame with the sample rate. Format: { \"type\": \"start\", \"encoding\": \"linear16\", // 16-bit raw PCM format \"container\": \"raw\", \"sampleRate\": {{sampleRate}}, \"channels\": 2 // customer is channel 0, assistant is channel 1 } 3. Vapi will send the audio data in 16-bit raw PCM format as binary frames. 4. You can read the messages something like this: ws.on('message', (data, isBinary) => { if (isBinary) { pcmBuffer = Buffer.concat([pcmBuffer, data]); console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`); } else { console.log('Received message:', JSON.parse(data.toString())); } }); 5. You will respond with transcriptions as you have them. Format: { \"type\": \"transcriber-response\", \"transcription\": \"Hello, world!\", \"channel\": \"customer\" | \"assistant\" }
Implementations§
Source§impl FallbackCustomTranscriber
impl FallbackCustomTranscriber
pub fn new(provider: ProviderTrue, server: Server) -> FallbackCustomTranscriber
Trait Implementations§
Source§impl Clone for FallbackCustomTranscriber
impl Clone for FallbackCustomTranscriber
Source§fn clone(&self) -> FallbackCustomTranscriber
fn clone(&self) -> FallbackCustomTranscriber
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FallbackCustomTranscriber
impl Debug for FallbackCustomTranscriber
Source§impl Default for FallbackCustomTranscriber
impl Default for FallbackCustomTranscriber
Source§fn default() -> FallbackCustomTranscriber
fn default() -> FallbackCustomTranscriber
Source§impl<'de> Deserialize<'de> for FallbackCustomTranscriber
impl<'de> Deserialize<'de> for FallbackCustomTranscriber
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FallbackCustomTranscriber
impl PartialEq for FallbackCustomTranscriber
Source§fn eq(&self, other: &FallbackCustomTranscriber) -> bool
fn eq(&self, other: &FallbackCustomTranscriber) -> bool
self and other values to be equal, and is used by ==.