简体   繁体   中英

How to get Watson Assistant to response correctly

First of all, sorry for language errors, I'm Brazilian.

I'm trying to create a Watson chatbot and I'm running into this issue.

I'm making chatbot that's take orders.

At the end, the bot responses 'Thank you! You asked for a ["hot dog","big coke","fries"].'

How can i get a response like 'Thank you! You asked for a hot dog, a big coke and fries.'?

Additional information:

the JSON for take the order:

{
  "context": {
    "menu": "@menu.values"
  }
}

I made the response like this:

Thank you! You asked for a $menu.

As you may have noticed, the $menu is a JSON array. Referring just to its values, gives the printed values as shown by you. Take a look at the Watson Assistant expressions for handling JSON data, especially JSONArray.join .

It combines the values of an array into a single string. Something like this should work.

Thank you! You asked for <? $menu.join(', ') ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM