Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Você pode usar o recurso de streaming estendido para transmitir conteúdo de áudio para o Dialogflow e receber sugestões de agentes humanos.
Normalmente, você fecha parcialmente ou informa à API Dialogflow quando encerrar o stream para gerar a transcrição final e as sugestões do Assistente do agente. Isso acontece em turnos de conversa, quando a API recebe o parâmetro is_final=true do resultado do reconhecimento, StreamingAnalyzeContentResponse.recognition_result.
O streaming estendido reduz a necessidade de fechamento parcial nas rodadas de conversa. Ele estende o tempo limite de conexão para três minutos, durante os quais você pode enviar fluxos de áudio sem fechar pela metade. A API Dialogflow envia automaticamente as transcrições finais e as sugestões do Assistente do agente de volta para o fluxo. Só reinicie o stream se ele expirar.
Princípios básicos de streaming
O recurso de streaming estendido do Agent Assist é semelhante ao streaming de áudio para transcrição da CCAI. Seu sistema
transmite dados de áudio para a API, e o Dialogflow transmite de volta
dados de StreamingAnalyzeContentResponse. Os dados retornados incluem sugestões
para seus agentes humanos.
O Extended Streaming só é compatível com a etapa do Assistente do agente. Consulte etapa da conversa. Para usar este recurso, siga estas etapas:
Chame o método streamingAnalyzeContent e defina os seguintes campos:
StreamingAnalyzeContentRequest.audio_config.audio_encoding:
AUDIO_ENCODING_LINEAR_16 ou AUDIO_ENCODING_MULAW
enable_extended_streaming: true.
A primeira solicitação streamingAnalyzeContent prepara o stream e define
sua configuração de áudio.
Em solicitações subsequentes, você envia bytes de áudio para o stream.
Enquanto você continuar enviando áudio, vai receber sugestões.
Não é necessário fechar o stream manualmente. Ela será fechada automaticamente
quando o Assistente do agente detectar que as frases foram interrompidas.
Reinicie o stream (que inclui o reenvio da configuração inicial de áudio) nos seguintes casos:
O stream está corrompido (ele parou quando não deveria).
Seus dados de áudio estão se aproximando do tempo limite automático de três minutos.
Você recebeu um erro que permite uma nova tentativa. Você pode tentar até três vezes.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eExtended Streaming allows streaming audio content to Dialogflow and receiving human agent suggestions in return, similar to audio streaming for CCAI Transcription.\u003c/p\u003e\n"],["\u003cp\u003eThis feature, available "as is" and with potentially limited support under the Pre-GA Offerings Terms, is accessible via the \u003ccode\u003estreamingAnalyzeContent\u003c/code\u003e method in the RPC API and client libraries.\u003c/p\u003e\n"],["\u003cp\u003eTo initiate Extended Streaming, users must set \u003ccode\u003eenable_extended_streaming\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e and provide appropriate audio configurations (\u003ccode\u003eAUDIO_ENCODING_LINEAR_16\u003c/code\u003e or \u003ccode\u003eAUDIO_ENCODING_MULAW\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe stream remains active as long as audio data is sent, automatically closing when utterances stop, and it will automatically timeout after 3 minutes of activity.\u003c/p\u003e\n"],["\u003cp\u003eUsers should restart the stream if it breaks unexpectedly, if approaching the three-minute timeout, or after receiving a re-tryable error (up to three retries are allowed).\u003c/p\u003e\n"]]],[],null,["# Extended streaming\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can use the extended streaming feature to stream audio content to\nDialogflow and stream human agent suggestions back.\n\nNormally, 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`.\n\nExtended 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.\n| **Note:** Streaming is supported by the RPC API and client libraries only.\n\nStreaming basics\n----------------\n\nThe Agent Assist extended streaming feature is similar to [audio\nstreaming](/agent-assist/docs/transcription) for CCAI Transcription. Your system\nstreams audio data to the API, and Dialogflow streams back\n`StreamingAnalyzeContentResponse` data. The returned data includes suggestions\nfor your human agents.\n| **Note:** Streaming automatically times out after three minutes. If your conversation lasts longer than three minutes, you can handle the timeout by closing and re-opening the stream.\n\nTo use Extended Streaming, call the\n[`streamingAnalyzeContent`](/dialogflow/es/docs/reference/rpc/google.cloud.dialogflow.v2beta1#google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent)\nmethod.\n\nExtended Streaming only supports Agent Assist stage. See [conversation\nstage](/agent-assist/docs/basics). To use this feature:\n\n1. Call the `streamingAnalyzeContent` method and set the following fields:\n - `StreamingAnalyzeContentRequest.audio_config.audio_encoding`: `AUDIO_ENCODING_LINEAR_16` or `AUDIO_ENCODING_MULAW`\n - `enable_extended_streaming`: `true`.\n2. The first `streamingAnalyzeContent` request prepares the stream and sets your audio configuration.\n3. In subsequent requests, you send audio bytes to the stream.\n4. 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.\n5. Restart the stream (which includes resending the initial audio configuration) in the following cases:\n - The stream is broken (the stream stopped when it wasn't supposed to).\n - Your audio data is approaching the automatic timeout at 3 minutes.\n - You received a re-tryable error. You can retry up to three times."]]