如何以字符串而不是音频流的形式从Google Assistant接收答案 [英] How to receive answer from Google Assistant as a String, not as an audio stream

查看:173
本文介绍了如何以字符串而不是音频流的形式从Google Assistant接收答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Assistant SDK中的python库通过gRPC进行语音识别.我已识别语音并将其作为字符串从\googlesamples\assistant\__main__.py调用方法resp.result.spoken_request_text返回,并且答案也从音频(\googlesamples\assistant\__main__.py

I am using the python libraries from the Assistant SDK for speech recognition via gRPC. I have the speech recognized and returned as a string calling the method resp.result.spoken_request_text from \googlesamples\assistant\__main__.py and I have the answer as an audio stream from the assistant API with the method resp.audio_out.audio_data also from \googlesamples\assistant\__main__.py

我想知道是否也可以将服务的答案作为字符串(希望它在服务定义中可用或可以包含在其中),以及如何访问/请求答案作为字符串.

I would like to know if it is possible to have the answer from the service as a string as well (hoping it is available in the service definition or that it could be included), and how I could access/request the answer as string.

谢谢.

推荐答案

更新:针对

google.assistant.embedded.v1alpha2

google.assistant.embedded.v1alpha2

辅助SDK包含字段supplemental_display_text

旨在将辅助响应提取为有助于文本的文本 用户的理解

which is meant to extract the assistant response as text which aids the user's understanding

或显示在屏幕上.仍使文本可供开发人员使用. Goolge助手文档

or to be displayed on screens. Still making the text available to the developer. Goolge assistant documentation

这篇关于如何以字符串而不是音频流的形式从Google Assistant接收答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆