简体   繁体   English

我们如何使用 node.js 在 ibm watson 的数据库中记录对话消息

[英]how can we do logging of conversation messages in database in ibm watson using node.js

I have created a watson conversation using assistant-simple github repo in node.js and it is working fine locally and in ibm cloud also.我在 node.js 中使用助手简单的 github 存储库创建了一个 watson 对话,它在本地和 ibm 云中也运行良好。 Now I want to log these conversation messages in a database.现在我想在数据库中记录这些对话消息。 How can I log these conversation messages using database in node.js.如何使用 node.js 中的数据库记录这些对话消息。

Assistant will keep the messages in a log for a small period of time List logs for a workspace and see Log limits .助手会将消息在日志中保留一小段时间列出工作区的日志并查看日志限制

Alternatively you will have to code putting messages into a database inside the NodeJS (or other language) server Orchestrator layer (which the UI communicates with).或者,您必须编码将消息放入 NodeJS(或其他语言)服务器 Orchestrator 层(UI 与之通信)内的数据库中。 This layer gets all the user messages and Assistant responses and so can store them where you want.该层获取所有用户消息和助理响应,因此可以将它们存储在您想要的位置。

I am not aware of a sample which directly communicates with Assistant and stores the user messages in a database.我不知道直接与助手通信并将用户消息存储在数据库中的示例。 You would need to take various pieces of code and put them together to achieve this.您需要采用各种代码并将它们组合在一起才能实现这一目标。

For example this sample shows how to upload information to a Cloudant database running on IBM Cloud, using NodeJS.例如,此示例展示了如何使用 NodeJS 将信息上传到在 IBM Cloud 上运行的 Cloudant 数据库。

Alternatively if you don't want to write the code locally, you can invoke App Connect to store the data in a database.或者,如果您不想在本地编写代码,则可以调用 App Connect 将数据存储在数据库中。 This Assistant and App Connect sample shows how to use Assistant actions to invoke AppConnect at some point in the dialog flow, either from the Assistant service (using a Cloud Function) or from the Orchestrator layer (as a client action).助手和 App Connect 示例展示了如何使用助手操作在对话流中的某个点调用 AppConnect,从助手服务(使用云功能)或从 Orchestrator 层(作为客户端操作)。

The sample passes a user Id found in the utterance, but the approach is to take some data from Assistant, invoke App Connect and pass it to App Connect, and App Connect calls some other external system with the data.该示例传递了一个在话语中找到的用户 ID,但该方法是从 Assistant 获取一些数据,调用 App Connect 并将其传递给 App Connect,然后 App Connect 使用这些数据调用其他一些外部系统。 In your case, the data could be the user utterance and Assistant response, and App Connect could store this in a database.在您的情况下,数据可能是用户话语和助理响应,App Connect 可以将其存储在数据库中。

One option would be to leverage cloud functions to make a call to another service.一种选择是利用云功能调用另一项服务。 Depending on what you want to do with the conversation data.取决于您想对对话数据做什么。 If you wanted to access chatlogs and metrics you could send it to a logging service such as www.chatseer.com so you can access the logs.如果你想访问chatlogs和指标,您可以将它发送到日志服务,如www.chatseer.com这样你就可以访问这些日志。

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

相关问题 IBM Watson对话-无法将node.js连接到Watson对话 - IBM Watson Conversation - Unable to connect node.js to watson conversation Node.js - 结合IBM Watson Discovery和Conversation Services - Node.js - Combine IBM Watson Discovery and Conversation Services 如何使IBM Watson Assistant欢迎节点启动与Node.js或Python的对话? - How to make IBM Watson Assistant welcome node starts the conversation with Node.js or Python? 如何使用Node.js应用程序在IBM Watson对话中定义意图和实体? - how to define intents and entities on IBM watson conversation with Node.js app? 使用node.js将Watson对话与Facebook集成 - Integrate watson conversation with facebook using node.js 使用node.js访问存储在Watson对话中的上下文变量 - Access the context variables stored in watson conversation using node.js 如何使用 Node.js 在 localhost 上播放 IBM Watson Text To Speech 音频 - How to play IBM Watson Text To Speech audio on localhost using Node.js 用于对话服务的Watson Node.js SDK的更新 - Updates to Watson Node.js SDK for Conversation Service Watson IBM语音转文本:无interim_result(Node.JS) - Watson IBM speech to text: no interim_result (Node.JS) Node.js - 连接到 IBM Watson Assistant 失败 - Node.js - connecting to IBM Watson Assistant fails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM