简体   繁体   English

适用于Google的Python库

[英]Python Library for actions on google

The package for Node.js for actions on google is here . 用于在Google上执行操作的Node.js软件包位于此处

Used this, it works fine in getting the app and conversation form google app. 使用此功能,在获取应用程序和对话形式的Google应用程序时效果很好。

What is the similar library for Python for actions on Google? 什么是Python类似的库,用于在Google上执行操作?

There is currently no official fulfillment library for Actions on Google. 目前,Google尚没有正式的Actions履行库。 There might be one that is maintained by community members. 可能有一个由社区成员维护。

If you want to use Python, you could alternatively just respond using JSON messages. 如果要使用Python,则可以选择使用JSON消息进行响应。 The documentation for Actions on Google has a tab describing the direct JSON responses that you would need to send. Google上的Actions文档有一个标签,用于描述您需要发送的直接JSON响应。

In this way, the Node.js code 这样,Node.js代码

conv.ask(new SimpleResponse({
  speech: 'Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?',
  text: 'Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?',
}));

is equivalent to 相当于

{
  "conversationToken": "",
  "expectUserResponse": true,
  "expectedInputs": [
    {
        "inputPrompt": {
            "richInitialPrompt": {
                "items": [
                    {
                        "simpleResponse": {
                            "textToSpeech": "Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?",
                            "displayText": "Howdy! I can tell you fun facts about almost any number. What do you have in mind?"
                        }
                    }
                ],
                "suggestions": []
            }
        },
        "possibleIntents": [
            {
                "intent": "actions.intent.TEXT"
            }
        ]
    }
]}

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

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