IBM Assistant(Conversation) Error: SpelEvaluationException when evaluating dialog node ID - ibm-cloud

I have a flow in my chatBot application where I switch workspaces and its giving me SpelEvaluationException error.
I have a router workspace that determine initial indent of the client, once I know the initial intend I route the next request to appropriate workspaces
Workspace Router :
Bot :- Hey this is an awesome bot, what do you need help with
1. Apples
2. Bananas
3. Oranges
Client :- I need help with my apples
--- I pass a custom JSON from the workspace with tells my app to route next request to apples workspace ----
Apple Workspace :
BOT: Hey what can I help you in apples .
The flow works fine but when I send request to Apples workspace. I get the following error in log_message .
SpelEvaluationException when evaluating dialog node ID [node_2_1517933972148]. The syntax of condition [intents[0].confidence < 0.50] is valid, but cannot be evaluated. Check that objects in expression are not null or out of bounds.\nSpEL evaluation error: EL1025E: The collection has '0' elements, index '0' is invalid\n

So somehow you are asking Watson to evaluate the intents array before actually passing any input, so no intent data is returned, thus the spell expression fails and throws the error.
So however you are calling that second Apples workspace make sure you have input text being sent as well.

The same thing happened to me, you can try to jump by response so that the condition is not evaluated and check if you are not trying to save the intent in a variable inside the JSON. Possibly you already solved it but I leave my proposal hoping it will serve someone else.

Related

'rasa shell' does not intiate a chat session as expected

The command 'rasa shell' is supposed to start a chat session in the terminal itself upon its execution according to the documentation. But in my case, it's acting as given in the below image.
But the output is supposed to be a 2-way communication between the bot and the user as given below.
Your input -> hi
<Bot's response to 'hi'>
Your input -> something
<Bot's response to 'something'>
May I know what the reason for the above matter is? (Please note that I noticed a similar question to mine here). Since I found it not descriptive enough, I have posted this question.
Check if:
There aren't any redundant intent names in domain.yaml file.
There aren't any missing quotation marks in responses.

Defining a new variable in order to make a huge iteration giving me an error

I have an endpoint, you can have informaciĆ³n about products
{{URL_API}}/products/
If i perform a GET method over that endpoint i will obtain the information of every product
BUT i can also specify the product that i want to know about, i.e:
{{URL_API}}/products/9345TERFER (the last code is the id of the product, called SKU)
The problem is that if i want to make a CSV in order to update the information of different products i have to define a variable called sku in the endpoint so i will be able to pass the corresponding SKU
I want to create the variable {{sku}} but i do not understand how to do that.. i tried so many times and i failed, i've searched a lot but i do not really understand
Also, should i use ":" before the declaration of the variable? i mean:
{{URL_API}}/products/:{{sku}}
or simply:
{{URL_API}}/ns/products/{{sku}}
Can you help me?
I'm super lost :(
EDIT:
I want to perform a PUT method, i want to pass different values to the body and then.. send the request (it throws an error: 404 not found)
This is what i did:
PUT|{{URL_API}}/products/{{sku}}
body:
{
"tax_percentage":"{{tax_percentage}}",
"store_code":"{{store_code}}",
"markup_top":"{{markup_top}}",
"status":"{{status}}",
"group_prices": [
{
"group":"{{class_a}}",
"price":"{{price_a}}",
"website":"{{website_a}}"
}
]
}
CSV:
POSTMAN:
Your issue seems to be just a basic understanding of how data files work with variables in Postman, here's a simple example that will work the same way for you too.
This is a basic request I'm using to resolve the variable from the data file - It's a GET request but that doesn't matter as all we're look at here is using a data file to resolve variables. All you need to do is ensure the URL is correct and that you SAVE the request before using the runner.
Here's a simple CSV file created in a text editor. The heading sku in the name on the variable it will reference inside the Postman request. Each value under that is the value that will be used for each iteration.
In the Runner, select your Collection from the list (If you have more than one) then select the CSV file. Once imported, you will be able to see a preview of the data.
If that's correct, press the Run button. The Runner will then iterate through the file and pick up the sku value in the CSV file and use it in the request. I've expanded one of the requests so you can see that the value was used in the request.

IBM Watson Assistant: How to set a 'jump to' target node dynamically (i.e. using context variables)

I want to jump from a dialog node to a node the ID of which is stored in a context variable.
I'm trying to solve a problem that has to do with a digression and which has been described here:
Conditionally return from digression in watson assistant
Especially this chart visualizes the problem:
In my opinion, A.H. posed a very reasonable and relevant question that has got no viable answer.
As far as I can see the problem can not be solved by digression settings. Either the root level node (triggered by matching the intent # Want_to_speak_to_someone) is set to 'return after digression' or it is not.
If the digression setting of this digression node is set to 'return' it will always return - no matter what happens further down in the dialog flow of this digression. Even if the user confirms that he wants to speak to a person (i.e. he does not want to return) the dialog will return to the node where the digression started.
This even happens when I jump from the yes-node (user confirms that he wants to speak to a person) out to any other node. As soon as the branch (or the branch the user jumped to) ends the dialog returns to the node where digression started.
If the digression setting of this digression node is set to 'does not return' however, a return is not possible - even if the user decides against speaking to a person and opts for returning to where he was.
What A.H. and I want is that the user can digress from a dialog flow and can still decide whether he wants to return or not. I think this is a pretty natural and important feature of a dialog. People like to reverse their decision or maybe they even digressed unintentionally from the given dialog flow.
Akaykay proposed to have two different nodes - a 'yes-node' which allows returning and a 'no-node' that does not allow returning. But this doesn't work, because before that I must have another node that asks the user for confirmation - and this 'confirmation-node' has to be set either to 'return' or 'does not return' (yielding the problems described above).
For this reason, I tried to figure out a workaround: I store the dialog node ID from which the dialog digresses in a context variable.
It is a context variable
"context": {
"last_node": "<? output.nodes_visited [0]?>",
...
},
which gets updated in every node of a dialog flow which allows digression.
In the example I could then jump back to the $last_node if the user wants to return and I could jump to another (fixed) node if the user wants to speak to a person - digressions settings of the 'digression node' would not interfere and could be set to 'does not return'.
Then I tried to edit the respective node (from which to return to the $last_node) in the json file of my skill:
"next_step": {
"behavior": "jump_to",
"selector": "user_input",
"dialog_node": "$last_node"
},
But when I reimport the skill-json-file again I get this error message:
I would be fine with either solution - one that uses digression settings or one that allows setting the 'jump to' target node dynamically. I deeply appriciate any help - thanks!
If you want to prevent Watson Assistent from returning from digression just call <? clearDialogStack() ?> function in the node where you don't want Watson Assistant to return from digression and that's it.
In your chart you would write "Ok, click here. <?clearDialogStack()?>" in the output text of the node "Ok, click here." and that should do the trick.
Here it is in the doc in this section: https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-runtime#dialog-runtime-digressions
Also note that currently it is not possible to create dynamic gotos with Watson Assistant. Only thing you can do is to create a dialog node with all the needed gotos conditioned by something underneath it and then you would goto this node. It is hard to create this manually but it can be generated automatically. For more magic with WA check out this project:
https://github.com/IBM/watson-assistant-workbench
It is possible to develop chatbots with WA completely without UI.

Undefined parameter in Google Action

I have a DialogFlow agent I am trying to test on Google Assistant. I've created a relatively simple Intent called "Set name" with the following Training phrases:
My name is Ryan.
Bill
I'm Steve
The name's Bond. James Bond.
It has two parameters:
Required: given-name with the Entity #sys.given-name and the value stored as $given-name
last-name with the Entity #sys.last-name and the value $last-name
I'm able to test in just fine in the DialogFlow test console. But when I try to "See how it works in Google Assistant." I get the following error:
Request contains an invalid argument. The query pattern 'The name's
Bond. $SchemaOrg_Person:given-name $SchemaOrg_Person:last-name.'
contains an undefined parameter 'last-name.'
If I delete the "James Bond" training phrase, it works okay. But I would like to include that. What am I doing wrong?
Here is a screenshot of the intent that is causing the problem:
Here is the link I'm clicking to try in Google Assistant:
And finally, here is the error message that appears in the bottom-right corner of the screen when I click that link:
I suddenly got a few of these error messages when both clicking the "See how it works in Google Assistant" link and submitting the app for production.
It seems like characters like apostrophes and hyphens in the training phrases creates trouble and can give that error message.
In addition it complained about a variant of the training phrases that I could not find anywhere no matter how much I looked at all languages, all pages of the phrases and all intents. I finally found the phrase in question by exporting the project and searching through the JSON files. Then I could delete the phrase locally, delete the intent in Dialogflow and do an import back to Dialogflow. (From my understanding it had messed up a follow-up intent which it also in the JSON (nowhere in the UI) had attached parts of some training phrases.)
Try to remove the dot from the sentence. So it will be:
"The name's Bond. James Bond"
I ran into same error and finally it was found to be an issue with the additional language I have added.
There was default "en" language and "en-IN" added by me. The issue was with training phrases in "en-IN" language. I didn't need it so removed it and it worked fine.
So, do check how many languages are enabled in your agent and whether training phrases are set properly for them or not.

Get Status of Driver Inside Visual Basic

I'm currently trying to detect which drivers appear as "not working" in visual basic.
This unknown device is a good example of what I'm trying to grab (notice how it has the flag DN_HAS_PROBLEM).
I've tried using searches such as:
Dim searcher As New ManagementObjectSearcher( "root\CIMV2", "SELECT * FROM Win32_SystemDriver")
And running a loop in the searcher.Get() through this documentation
However, none of these seem to return what I am looking for.
Would anyone happen to know how I can get the DN_ statuses within Visual Basic?
Thanks!
The Win32_SystemDriver class documentation lists these Status properties:
OK
Error
Degraded
Unknown
Pred Fail
Starting
Stopping
Service
Stressed
NonRecover
No Contact
Lost Comm
...whereas DN_HAS_PROBLEM comes from the CM_Get_DevNode_Status function, or perhaps also from other system calls.
There may not be a way to get that specific code from the API you're using, but perhaps the existing Status properties will suffice for your needs if you don't need to know more specific failure reasons.
If you do need to know that specific status, you'll have to call other APIs, like the one I called out.