Hi again,
Glad you showed your code since that explains what you were trying to describe. My way to resolve this would be as follows:
1- before calling your webhook, store the "input.text" value in a variable (instead of doing it afterwards)
2- In addition, store in another variable the current intent/intents that are being recognized at that time (presumably these are the intents you want to act on, correct?). Call it something like 'currentIntent'.
3- After your webhook executes, and within your response condition that is associated with 'EN', you need to be able to do 2 things i) (most important one) ensure that somehow you can ensure that the intent/intents that you saved before can be acted upon, and then ii) jump to the beginning of your dialog.
I am aware of 2 different ways of getting i) to work above:
- (more work but doesn't use undocumented features): ensure that every one of your response nodes doesn't just trigger when an intent gets triggered but also when the variable you set in step 2 above (let's call it 'currentIntent') has the associated intent name as the value.
- (less work but uses undocumented features): use the '_eval' function within your json, to tell Watson to set the (evaluated) intents to be exactly what you want them to be (that is, the value of the 'currentIntent' variable you set in step 2). Here's an example of how you could use this feature:
{
"output": {},
"context": {
"_eval": [
"intents[0].intentId = $currentIntent",
"intents[0].confidence = 1"
]
}
}
Hope this helps,
-Patricia
------------------------------
Patricia Goldweic
------------------------------
Original Message:
Sent: Wed September 06, 2023 03:40 AM
From: Gökçe Kuşcu
Subject: Dialogue set up for re-using/classifying previous user input
Thank you both for your answers!
My problem was not so much with setting up the variable itself, but more so about how to use it as if it is a new input so it can get classified as normal.
I do use the user's input as a parameter to the Translator tool webhook, for example, but I don't know how to "transfer" this -either on the same node or in a following node - so that it gets treated as if it is new and proceeds with the intent classification.
Jumping onto another node did not work for me because none of them do intent classification without any input from the user. So, I am wondering if there is a special type of node, function, etc. that can force intent classification.
I will also provide some screenshots below for a little more context:
------------------------------
Gökçe Kuşcu
Original Message:
Sent: Tue September 05, 2023 01:06 PM
From: Patricia Goldweic
Subject: Dialogue set up for re-using/classifying previous user input
Can you say more about why using context variables did not work? This sounds like the way to go.
------------------------------
Patricia Goldweic
Original Message:
Sent: Mon September 04, 2023 07:33 AM
From: Gökçe Kuşcu
Subject: Dialogue set up for re-using/classifying previous user input
Hello everyone!
I am trying to set up language detection for a chatbot using Watson Language Translator. Although the language detection/translation does work, I am having trouble getting the dialogue set up the way I want.
Currently, I have a "Check language" node where I connect to the Language Translator via a webhook. If the webhook result is not equal to "en", I want the chatbot to prompt the user to type their input in English. This works! If the input is English, I want it to proceed as it normally would (go through intent detection and present the flow for that intent). However, I cannot find a way to do this without requesting the user to type their input again.
I tried to do this with context variables, but could not get it to work.
I was hoping that somebody here might have an insight into how to re-use old user input re-evaluate it without any additional effort from the user's side. I am not familiar with the forums but do let me know if I need to share more details and I will be happy to do that as well!
Thank you all!
------------------------------
Gökçe Kuşcu
------------------------------