Guide to pausing EVI’s responses during a Chat session.

The pausing feature allows you to halt EVI’s audio output while keeping the session active, which is useful for managing conversation flow. For instance, a developer might create a button that lets users pause EVI’s responses if they need time to brainstorm or reflect without interruption. During this pause, EVI continues to listen and transcribe, allowing the user to interject or resume the conversation without disrupting the session. When the user is ready, they can resume EVI’s response to continue the interaction seamlessly.

How to pause responses

To pause EVI’s responses, send a pause_assistant_message, which holds all Assistant messages until a resume_assistant_message is received. When resumed, EVI responds with consideration of any user input received during the pause.

1import React from 'react';
2import { useVoice } from "@humeai/voice-react";
3
4export default function Controls() {
5 const { pauseAssistant, resumeAssistant } = useVoice();
6
7 return (
8 <div>
9 <button onClick={pauseAssistant}>Pause EVI</button>
10 <button onClick={resumeAssistant}>Resume EVI</button>
11 </div>
12 );
13}

EVI while paused

  • Response generation stops: EVI stops the generation and sending of new responses. (assistant_message and audio_output messages will not be received while paused.)
  • Tool use is disabled: Any response involving tool use will also be disabled while paused. (tool_call_message, tool_response_message, and tool_error_message messages will not be received while paused.)
  • Queued messages sent: Messages and audio queued before the pause_assistant_message are still processed and sent.
  • Continued listening: EVI continues to “listen” and transcribe user input during the pause. Transcription of user audio is saved and are sent to the LLM as User messages.

Charges will continue to accrue while EVI is paused. If you wish to completely pause both input and output you should instead disconnect and resume the chat when ready.

EVI when resumed

When EVI receives a resume_assistant_message, it generates a response that takes into account all user input received during the pause.

  • Pausing vs. muting: Pausing EVI’s responses is distinct from muting user input. With muted input, EVI does not “hear” the user’s audio and therefore cannot respond to it. While paused, however, EVI continues to process user input and can respond when resumed.
  • Response to paused input: Upon resuming, EVI may respond to multiple points or questions raised during the pause. However, by default, EVI prioritizes the latest user input rather than attempting to address all earlier points. For instance, if the user asks two questions while EVI is paused, EVI will generally respond to the second question, unless instructed to address each item.

Built with