简体   繁体   English

如何使用 Python 启用 Google Assistant API 的新“阅读”function?

[英]How to enable new “read it” function of Google Assistant API with Python?

Recently Google released a new "Read it" function of Google Assistant.最近谷歌发布了谷歌助手的新“阅读” function。

How can I try it with Python?如何使用 Python 进行尝试? I enabled Google Assistant API in console and created service account credentials.我在控制台中启用了 Google Assistant API 并创建了服务帐户凭据。 The documentation does not provide any Python implementation.文档不提供任何 Python 实现。

I'd like to run a simple "Hello world" example: send a text and get a wav file.我想运行一个简单的“Hello world”示例:发送文本并获取 wav 文件。

Google uses the term "Assistant" somewhat loosely, and a feature being available on the Assistant for one platform isn't always available on others, even if there is no obvious reason for it not to be.谷歌使用“助手”这个词有点松散,一个平台的助手上可用的功能并不总是在其他平台上可用,即使没有明显的理由不可用。

Reading long-form audio may seem to make sense to be available on all audio Assistant platforms - but it isn't.在所有音频助手平台上都可以阅读长格式的音频似乎是有意义的——但事实并非如此。 At least as of this writing, it seems to only be available on Assistant for Android platforms.至少在撰写本文时,它似乎仅适用于 Android 平台的 Assistant。 This suggests that it is a feature of that implementation specifically, and not a full Assistant feature.这表明它是该实现的一个特性,而不是一个完整的助手特性。

Also note that the Assistant SDK is officially listed for hobbyist use only.另请注意,官方列出的助手 SDK 仅供业余爱好者使用。 Production hardware with the Assistant seems to use a different development platform that handles other features including streaming audio.带有 Assistant 的生产硬件似乎使用了不同的开发平台来处理包括流式音频在内的其他功能。

It is an interesting question!这是一个有趣的问题!

I am not sure if I help you completely, but I found this Google Assistant Service documentation .我不确定我是否能完全帮助你,但我找到了这个 Google Assistant Service 文档

According to the documentation, "The Google Assistant Service gives you full control over the integration with the Assistant by providing a streaming endpoint . Stream a user audio query to this endpoint to receive a Google Assistant audio response. "根据文档,“Google 助理服务通过提供流式端点让您完全控制与助理的集成。Stream 用户对此端点的音频查询接收 Google 助理音频响应。

What I understand : you can bind to the API via gRPC call using python language to call Google Assistant API.我的理解是:您可以通过 gRPC 调用绑定到 API,使用 python 语言调用 Google 助理 API。 The documentation gives a step by step about the integration.该文档逐步介绍了集成。

I hope this could help you.我希望这可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM