【问题标题】:Python Library for actions on google用于谷歌操作的 Python 库
【发布时间】:2018-06-13 13:44:57
【问题描述】:

用于谷歌操作的 Node.js 包是here

使用这个,它在获取应用程序和会话表单谷歌应用程序时效果很好。

用于 Google 上的操作的类似 Python 库是什么?

【问题讨论】:

    标签: python node.js actions-on-google


    【解决方案1】:

    Actions on Google 目前没有官方的履行库。可能有一个由社区成员维护。

    如果您想使用 Python,您也可以使用 JSON 消息进行响应。 documentation for Actions on Google 有一个选项卡,描述了您需要发送的直接 JSON 响应。

    这样,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?',
    }));
    

    等价于

    {
      "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"
                }
            ]
        }
    ]}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-28
      • 2017-11-30
      • 1970-01-01
      • 2018-07-20
      • 1970-01-01
      • 1970-01-01
      • 2018-07-13
      • 1970-01-01
      相关资源
      最近更新 更多