Extended streaming

You can use the extended streaming feature to stream audio content to Dialogflow and stream human agent suggestions back.

Normally, you half-close or tell the Dialogflow API when to end the stream to generate the final transcript and Agent Assist suggestions. This happens at conversation turns, where the API receives the parameter is_final=true from the recognition result, StreamingAnalyzeContentResponse.recognition_result.

Extended streaming reduces the need for half-closing at conversation turns. It extends the connection timeout to three minutes, during which you can send audio streams without half-closing. The Dialogflow API automatically sends the final transcripts and Agent Assist suggestions back to the stream. You only restart the stream if it times out.

Streaming basics

The Agent Assist extended streaming feature is similar to audio streaming for CCAI Transcription. Your system streams audio data to the API, and Dialogflow streams back StreamingAnalyzeContentResponse data. The returned data includes suggestions for your human agents.

To use Extended Streaming, call the streamingAnalyzeContent method.

Extended Streaming only supports Agent Assist stage. See conversation stage. To use this feature:

  1. Call the streamingAnalyzeContent method and set the following fields:
    • StreamingAnalyzeContentRequest.audio_config.audio_encoding: AUDIO_ENCODING_LINEAR_16 or AUDIO_ENCODING_MULAW
    • enable_extended_streaming: true.
  2. The first streamingAnalyzeContent request prepares the stream and sets your audio configuration.
  3. In subsequent requests, you send audio bytes to the stream.
  4. As long as you continue to send audio, you will keep receiving suggestions. You don't need to manually close the stream. It will close automatically once Agent Assist detects that utterances have stopped.
  5. Restart the stream (which includes resending the initial audio configuration) in the following cases:
    • The stream is broken (the stream stopped when it wasn't supposed to).
    • Your audio data is approaching the automatic timeout at 3 minutes.
    • You received a re-tryable error. You can retry up to three times.