Reminder codings in Watson Conversation Service

孤人 提交于 2019-12-07 09:47:29

I think you can combine the days with the product...

You will need to create one context variable and save the name of your product... Or create one entity with all products and save within one context variable, like:

"context": {
       "product": "<? @product ?>"
 },

Like:

function searchRequest(data, req, res){
   if(data.context.verifiedDate && data.context.product === 'milk'){
       var sendRequest = "Thanks for wait, , the validate for the product is 14 days, product: " + data.context.product;
       return data;
   } else if(data.context.verifiedDate && data.context.product === 'egg'){
       var sendRequest = "Thanks for wait, the validate for the product is 7 days, product::" + data.context.product;
       data.output.text[0] = sendRequest;
       return data;
   }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!