【发布时间】:2018-06-13 13:44:57
【问题描述】:
【问题讨论】:
标签: python node.js actions-on-google
【问题讨论】:
标签: python node.js actions-on-google
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"
}
]
}
]}
【讨论】: