创建类似于 Watson Virtual Agents 的东西
Create something of similar to Watson Virtual Agents
我在这个页面上看到了 gif:
https://github.com/watson-virtual-agents/chat-widget
我想用 IBM Watson Conversation 工具创建一些类似的东西
其中用户可以选择插入圆形底部的一些选项。你知道怎么可能吗?
很确定你可以做这个例子。
您需要了解的摘要:Watson Conversation 是一个端点 REST API,因此,您可以在后端调用此服务,也可以在前端调用此服务,以便为您的用户显示消息不同的形式(前端)。
在这种情况下,您的示例是一个网页,因此,可能在 Watson 对话中,您需要为响应中的 buttons
添加 html
。
您可以从一位 IBM 开发人员 - Ashley 那里看到 this example 在 Watson 中使用按钮。
Conversation simple is one awesome example that you can use to understand how Watson Conversation works and one based for your projects using this API. This project is built in Node.js.
- 有关使用 IBM Watson Conversation 的信息,请参阅官方 API Reference。
好的。
我已插入此代码
<script>
function yesBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("yes", context);
}
function noBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("no", context);
}
</script>
在 /ui/index.html 里面(他建议我用 ' 代替 " 然后我做到了)
此代码
#button-yes {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#66B266;
color: white;
}
#button-no {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#ff3232;
color: white;
}
在 /ui/css/conversation.css 和 /ui/css/main.css
内
和这段代码
"text": "Would you link to end our conversation?\n\n<button id=\"button-yes\" onclick=\"yesBye();\">Yes</button> <button id=\"button-no\" onclick=\"noBye();\">No</button>"
单节点代码js编辑器里面
情况是这样
image
这意味着该页面识别按钮但不识别其 css 样式。
我的项目结构与此 (https://github.com/watson-developer-cloud/car-dashboard) 相同,每次编辑后我都会再次部署该项目。哪里错了?
好的,但这不是 CSS 问题。通过丢失按钮,我对 index.html 文件所做的任何类型的修改都不会出现。
即使我尝试替换底部框中的 "Type something" 字符串也不行。
我尝试清空缓存,在每次修改时恢复部署,检查 manifest.yml 文件的服务名称和内容是否正确,但没有任何结果。工作 space 和环境变量是正确的。
每次我点击 eclipse ID 中的播放按钮时,我都会看到这个
带有 "Failed to read application content" 错误消息。
代码中是否有任何内容(您可以在此处找到 https://github.com/watson-developer-cloud/car-dashboard)阻止任何类型的修改?
我在这个页面上看到了 gif: https://github.com/watson-virtual-agents/chat-widget
我想用 IBM Watson Conversation 工具创建一些类似的东西
其中用户可以选择插入圆形底部的一些选项。你知道怎么可能吗?
很确定你可以做这个例子。
您需要了解的摘要:Watson Conversation 是一个端点 REST API,因此,您可以在后端调用此服务,也可以在前端调用此服务,以便为您的用户显示消息不同的形式(前端)。
在这种情况下,您的示例是一个网页,因此,可能在 Watson 对话中,您需要为响应中的 buttons
添加 html
。
您可以从一位 IBM 开发人员 - Ashley 那里看到 this example 在 Watson 中使用按钮。
Conversation simple is one awesome example that you can use to understand how Watson Conversation works and one based for your projects using this API. This project is built in Node.js.
- 有关使用 IBM Watson Conversation 的信息,请参阅官方 API Reference。
好的。
我已插入此代码
<script>
function yesBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("yes", context);
}
function noBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("no", context);
}
</script>
在 /ui/index.html 里面(他建议我用 ' 代替 " 然后我做到了)
此代码
#button-yes {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#66B266;
color: white;
}
#button-no {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#ff3232;
color: white;
}
在 /ui/css/conversation.css 和 /ui/css/main.css
内和这段代码
"text": "Would you link to end our conversation?\n\n<button id=\"button-yes\" onclick=\"yesBye();\">Yes</button> <button id=\"button-no\" onclick=\"noBye();\">No</button>"
单节点代码js编辑器里面
情况是这样
image
这意味着该页面识别按钮但不识别其 css 样式。 我的项目结构与此 (https://github.com/watson-developer-cloud/car-dashboard) 相同,每次编辑后我都会再次部署该项目。哪里错了?
好的,但这不是 CSS 问题。通过丢失按钮,我对 index.html 文件所做的任何类型的修改都不会出现。 即使我尝试替换底部框中的 "Type something" 字符串也不行。 我尝试清空缓存,在每次修改时恢复部署,检查 manifest.yml 文件的服务名称和内容是否正确,但没有任何结果。工作 space 和环境变量是正确的。 每次我点击 eclipse ID 中的播放按钮时,我都会看到这个
带有 "Failed to read application content" 错误消息。 代码中是否有任何内容(您可以在此处找到 https://github.com/watson-developer-cloud/car-dashboard)阻止任何类型的修改?