Pause Responses | Hume API

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.

Code Example

import React from 'react';
import { useVoice } from "@humeai/voice-react";

export default function Controls() {
  const { pauseAssistant, resumeAssistant } = useVoice();

return (
    <div>
      <button onClick={pauseAssistant}>Pause EVI</button>
      <button onClick={resumeAssistant}>Resume EVI</button>
    </div>
  );
}

EVI while paused

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.