VAPI only text-mode
# support
p
Is there a way to tell the VAPI agent to not generate audio? I would like to implement a chat-based interface to go along with the voice-based interface. Right now I am able to send messages through the .send() function and display the chat response by listening to the "message" event, however I still get the audio back, which definetly slows down the response time. Is there a way to opt-out from it like in the OpenAI Realtime API? This how I do it with the Realtime Client:
Copy code
client.updateSession({
            modalities: isEnabled ? ['text'] : ['text', 'audio'],
            input_audio_transcription: isEnabled ? null : { model: 'whisper-1' },
            turn_detection: isEnabled ? null : turnDetectionType === 'server_vad' ? { type: 'server_vad' } : null,
            input_audio_format: isEnabled ? undefined : 'pcm16',
            output_audio_format: isEnabled ? undefined : 'pcm16',
            voice: isEnabled ? undefined : 'alloy',
        });
v
@PaoloG Currently, VAPI does not provide a direct method to disable audio generation like the OpenAI Realtime API does. However, you can implement a workaround by intercepting the audio messages on the client side and not playing them. Since you are already listening to the "message" event, you can filter out audio messages and process only text-based responses for your chat interface. Here's an example of how you might modify your message event listener to ignore audio messages:
Copy code
javascript
vapi.on("message", (msg) => {
  if (msg.type === "audio") {
    // Ignore audio messages
    return;
  }
  if (msg.type === "transcript") {
    // Handle text transcript messages
    // Update your chat interface with the text response
  }
  // Handle other message types as needed
});
By doing this, you can effectively create a chat-only interface without modifying the VAPI agent's behavior. The audio is still generated but not utilized in your chat interface. If you're looking for a more efficient solution that prevents audio generation altogether, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
p
Thanks! @Vapi how can I make a feature requests? Going through the TTS service and then ending up not using it seems quite wasteful (money-wise and processing-wise)
v
@PaoloG To make a feature request for VAPI, you can follow these steps: 1. **Support Portal**: Visit the official support portal or website where VAPI is hosted and look for a 'Feature Request' or 'Feedback' section. 2. **Contact Support**: Reach out to the customer support team directly via email, phone, or a contact form provided on the website. 3. **Community Forums**: If VAPI has community forums or discussion boards, you can post your feature request there. This can also help you gauge interest from other users who might benefit from the same feature. 4. **Social Media**: Sometimes, reaching out through social media platforms where the VAPI team is active can be an effective way to make a feature request. 5. **Direct Contact**: If you have a contact within the company or a dedicated account manager, you can directly communicate your feature request to them. When making your request, be sure to explain the benefits of the feature, how it can improve efficiency, and why it's important for users like yourself. Providing clear use cases and potential impact can help prioritize your request. If you need assistance with submitting the feature request or if you have any other questions, please let me know, and I'll be happy to help further.
s
@PaoloG as of now there is no way to implement text based chat using Vapi.
2 Views