2
votes

I'm trying the conversation API service from Watson (using the Python API client available on pypi: watson-developer-cloud.

When I make a request, I am getting the following error:

"output": {
    "text": [],
    "error": "Error when updating output with output of dialog node id:node_3_1470064336636. Fix the dialog node. Node output was:{\"text\":\"El monto que te puedo adelantar lo define el sistema seg\u00fan el an\u00e1lisis que realiza de tu figura crediticia. El primer adelanto ser\u00e1 de hasta $2000 y mientras vayas cumpliendo en tiempo y forma, se ir\u00e1 aumentando el monto que el sistema te ofrece, siendo $4000 el m\u00e1ximo. Si quer\u00e9s saber el monto exacto que puedo otorgarte, registrate o acced\u00e9 a tu cuenta y hac\u00e9 click en la opci\u00f3n \\\"Ped\u00ed un Adelanto\\\".\"}\n**org.springframework.expression.spel.SpelParseException**: EL1049E:(pos 8): Unexpected data after '.': '2000'\n"

The response (in Spanish) is the following:

{
  "output": {
    "text": "El monto que te puedo adelantar lo define el sistema según el análisis que realiza de tu figura crediticia. El primer adelanto será de hasta $2000 y mientras vayas cumpliendo en tiempo y forma, se irá aumentando el monto que el sistema te ofrece, siendo $4000 el máximo. Si querés saber el monto exacto que puedo otorgarte, registrate o accedé a tu cuenta y hacé click en la opción \"Pedí un Adelanto\"."
  }
}

I also get the same error testing the bot on the Watson Conversation Workspace (the dialog icon on the top-right corner). Any ideas how to fix this? Should I escape some part of my input?

2
Seems the problem is '$chars'. I changed te text to be '$ 4000', and it works fine!. Not sure, but maybe (just guessing) the sintax $char is to refer to variables, and since $2000 (2000) is not a variable, it brings that error. - Emiliano Dalla Verde Marcozzi

2 Answers

2
votes

As was alluded to in a comment by Emiliano, the dollar-sign is a character that introduces a reference to a context-variable. So, Conversation is trying to look up the value of, for example, the variable $2000. You need to escape those references. So, you'll need to specify \\$2000. You need the double-backslashes as the string is actually within quotes itself under the covers.

2
votes

I could escape most of the special characters described in the Dialog reference using a single \ character when using the Simple Watson Response editor. For example, \$2000, \#ftw and \@8pm

If you're using the Advanced Watson Response editor, you will need to use a double \\ instead. So for the same examples above, \\$2000, \\#ftw and \\@8pm

Unfortunately I haven't been able to successfully escape the <? and ?> used for more complex expressions, although hopefully those are less likely to cause problems?