[英]IBM Watson Assistant: How to make API calls from dialog
We have integrated IBM Watson Assistant skill/workspace with a Facebook page using the Watson features. 我们使用Watson功能将IBM Watson Assistant技能/工作区与Facebook页面集成在一起。 We did this using an integrated approach from Virtual Assistants tab.
我们使用“虚拟助手”选项卡中的集成方法进行了此操作。
We are able to get the response in Facebook Messenger from Watson skill/workspace FAQS. 我们可以从Watson技能/工作区常见问题解答中在Facebook Messenger中获得答复。 Now we want to add a few more questions to skill/workspace and get the response from a database.
现在,我们想向技能/工作区添加更多问题,并从数据库中获得响应。
We know that we can use IBM Cloud Functions to get DB data and respond back with the data, but Cloud Functions action types (web_action and cloud_function or server) incur a cost, hence we are looking for another approach. 我们知道我们可以使用IBM Cloud Functions来获取数据库数据并用数据进行响应,但是Cloud Functions操作类型(web_action和cloud_function或服务器)会产生成本,因此我们正在寻找另一种方法。
We have our own APIs developed for the DB and want use those in Watson Assistant dialogue node actions. 我们为数据库开发了自己的API,并希望在Watson Assistant对话节点操作中使用这些API。 Please let us know how we can add it in actions and get a response from the API without using client application/cloud functions.
请让我们知道如何在不使用客户端应用程序/云功能的情况下将其添加到操作中并从API获得响应。
Note: we haven't developed any application for this chatbot, we directly integrated Watson skill/workspace with the Facebook page and trying to call API calls wherever we require them from the dialogue nodes. 注意:我们尚未为该聊天机器人开发任何应用程序,我们直接将Watson技能/工作区与Facebook页面集成在一起,并尝试在对话节点中需要它们的任何地方调用API调用。
As you can see, IBM Watson Assistant allows to invoke three different types of actions from a dialog node . 如您所见, IBM Watson Assistant允许从对话框节点调用三种不同类型的操作 。
Because for cloud_function and web_action the action is hosted as Cloud Function on IBM Cloud, the computing resources are charged. 因为对于cloud_function和web_action,该操作作为IBM Cloud上的Cloud Function托管,所以需要对计算资源进行收费。 For type client, your app would handle the API call and the charges depend on where your app is hosted.
对于类型客户端,您的应用将处理API调用,并且费用取决于您的应用托管的位置。 Thus, there are always costs.
因此,总有成本。
What you could do is to write a wrapper function that is deployed as web_action or cloud_function. 您可以做的是编写一个包装函数,将其包装为web_action或cloud_function。 Thus, there isn't much of computing resource needed and the charges would be minimal.
因此,不需要太多的计算资源,并且费用将最小。 But again, independent of the action type, there are always costs (maybe not charges) - one way or another...
但是同样,与动作类型无关,总是有成本(也许不是费用)-一种或另一种方式...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.