You can use the Extended Streaming feature to stream audio content to Dialogflow and stream human agent suggestions back.
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:
- Call the
streamingAnalyzeContent
method and set the following fields:StreamingAnalyzeContentRequest.audio_config.audio_encoding
:AUDIO_ENCODING_LINEAR_16
orAUDIO_ENCODING_MULAW
enable_extended_streaming
:true
.
- The first
streamingAnalyzeContent
request prepares the stream and sets your audio configuration. - In subsequent requests, you send audio bytes to the stream.
- 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.
- 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.