How to get the entities value of the previous dialog task in sub intent dialog task

I have created a sub intent dialog task in which i am using the entities from the main dialog task but i cant get/fetch the entities in sub intent task.

Hi @tabish13khan . Sub intents do not exist independently and they were to be called within other intents. Meaning, when the sub intents are invoked within dialog as linked dialog, the context of the parent dialog can be passed to the invoked sub intent by mapping the parameter values.

Below is an example. I have a created a subintent only dialog (This can only be used in other dialog and users canā€™t invoke it directly)

image

I have used an entity node in the sub intent only dialog and below is its configuration.

image

I have created a parent dialog with an entity node in it and am invoking the sub intent only dialog as a linked dialog.

image

Now at the instance properties of the sub intent invoked as dialog in the parent dialog, I am mapping the entity from parent to the subintent as follows:

image

Have executed the dialog and we see the entity data from parent is passed to the entity present in sub intent only dialog.

image

Mentioned below are some useful links to work around linked intents and sub intent:
https://developer.kore.ai/docs/bots/bot-builder/defining-bot-tasks/dialog-tasks/working-with-the-intent-node/

https://developer.kore.ai/docs/bots/bot-builder/defining-bot-tasks/dialog-tasks/creating-dialog-task-flows/

Below are some questions we have for you:

  1. Are you using a sub intent only dialog or create a new intent within the parent dialog?
  2. Are you invoking the dialog within parent dialog as an intent or a dialog?

Could you please provide snapshots of your configuration so that we could debug and suggest further as needed?

2 Likes

Parent Dialog Task
image
sub intent only dialog
image
Sub intent dialog
image
i want to pass all context which i am having in the parent dialog.
is there more effecient way to pass all context value and entities to sub intent or i have to pass key/value for all required context value to be passed as i have logic depending on the parent dialog task value

1 Like

Hi @Subrahmanyam,

I have followed above guidelines to get the values from one dialogue task to another dialogue task.

Please guide me how to get the parent dialogue task values to sub intent dialogue task

and creating the sub intent settings.

Thanks in advance

Jayaprakashhan

While executing a sub-intent, the data captured from the parent should be a part of the context data, so developer need configure any further to pass data.

Could you please explain more on your usecase so that Iā€™d be able to help?

Hi, I am trying to capture Personel details like firstname , email , mobile no etc in 1st dialogue task.

In the second Dialogue Task i wanted to capture those details and like 3rd , 4 th Dialogue task.

In 1st task bot asking personal details i wanted to store and carry forward to next/entire coming tasks

Thanks in advance

Jayaprakashhan

Well, you could always use the session and context variables (Say, BotUserSession) to store values captures at entities of Dialog 1 using script nodes, set values to entities at other Dialogs of your bot referring to the values present in context variables.

Please refer to below link for more details

https://developer.kore.ai/docs/bots/bot-builder-tool/dialog-task/using-session-and-context-variables-in-tasks/

Hi @Subrahmanyam,

Thanks for your Reply i will implement it now and i have another query
can we show the default welcome message where should i write the welcome message like
"Hi ā€˜User Nameā€™ Welcome to Our Application.

Thanks in advance
Jayaprakashhan

@jayaprakash.gurrapu, Yes, you can.
Please refer to the below snips wherein I have configured the onConnect event to show a message to the user.
Configuring the onconnect event to show a message displaying the username:
image

Bot displaying the name of the user in the chat window as configured at the event:
image

Hi @Subrahmanyam,
thanks for reply i have implemented.

Jayaprakashhn

Hi @Subrahmanyam,

When i am trying to enable web/mobile , newly created/developing bot is not visible in the dropdown list.

For this what should i do , is there any further steps i needed to do, to get this web/mobile channel enable.

thanks in advance.
Jayaprakash

image

@jayaprakash.gurrapu WebSDK works on web socket connection and uses the application that the developer could create on Bot Builder.

The developer could use an existing application which by selecting from the above dropdown or create a new application. Creating an application would generate a client ID and client Secret which needs to be configured at the webSDK for generating the JWT.

Please refer to the below link for details on enabling webSDK channel.
https://developer.kore.ai/docs/bots/sdks/kore-ai-web-sdk-tutorial/

Also, we request you to please post your questions as new topics on community or even reply to related topics which wouldnā€™t deviate other developers on the community referring to this thread.

Hi @Subrahmanyam,

thank you for your reply.
Jayaprakashhan

Hello @Subrahmanyam.

Using a weather bot as an example, if a user simply asks what the weather is in New York, the bot responds with the answer. The user then asks ā€œwhat about Los Angeles?ā€

After the bot initially responds with weather info for New York, I have it set to end the dialog . Does it need to stay open so it recognizes follow up questions like ā€œwhat about Los Angelesā€ or ā€œhow about Miami?ā€ Is this related to context output? Iā€™m having a lot of difficulty finding help on this.

Thanks,
Eddie

Hi @ek2842,

This use case can be achieved both by using sub intents and the context output.

Please refer to the below configuration wherein, I have used sub intent to deal with the follow up utterance .

The dialog ā€œPost Detailsā€ would fetch the user the details of a post if the post number if provided.

image

At the message node, I have added a transition rule on ā€œOn user inputā€ to execute a sub intent if the intent matches ā€œfollowUpPostDetailsā€.

image

image

I have trained the sub intent ā€œFollowUpPostDetailsā€ at ML section to identify the intent based on utterance.

image

Followed by the sub intent, I have added a script node ā€œdeletePreviousEntitiesā€ to delete all the entities which were previously captured and stored in context.

image

The script node "ā€œdeletePreviousEntitiesā€ is now connected to the entity node ā€œpostNumā€

Below are snips of run time execution showing that the follow up question "how about * " is identified
image
image

Note:
At the entity node ā€œpostNumā€, I have selected the option ā€œEvaluate unused text from previous utterancesā€ at entity extraction.

image

I will soon post an other configuration here to demonstrate that the use case can be achieved using context output as well.

Please let us know if you have any further questions.

Please refer to the below configuration wherein I have used the context output of a dialog to handle the follow up question.

Configuration of Post Details dialog which returns the details of post when the post number is provided by the user.

At the intent node ā€œPost Detailsā€, I have configured the NL section to emit the context output as ā€œpostdetailsā€

I have created an other dialog ā€œFollowUp PostDetailsā€ with same configuration as it was at ā€œPost detailsā€ but had the Intent precondition as ā€œpostdetailsā€ (So, the dialog ā€œFollowUp PostDetailsā€ can only be identified when the context contains ā€œpostdetailsā€ which will be emitted when the dialog ā€œPost detailsā€ is executed)

Configured an intent pattern to identify the followup utterance

Below are the snips of run time execution which shows that the follow up question ā€œwhat about 4ā€ is handled based on Context Output.

Thank you very much @Subrahmanyam, this answered my question! I was on the right track and you confirmed it.

You are welcome @ek2842 . Glad, we could answer :slight_smile:

Hi Subramanyam,
I have same issue. In first i.e login task I am asking user for email and passsword. at the end of the task I have invoked another task add beneficiary as dialogue task which ask user- name of the beneficiary and IBAN of the beneficiary. Now I want to use service node to save the data like email, name of the beneficiary and IBAN . But I can only see name of the beneficiary and IBAN in the API data. How to get that email entity called in the add beneficiary task?

Thank you in advance.

Hi @jayaprakash.gurrapu ,

I have same issue just like you -
1st dialog contains user name and I want to use UserName entity in 2nd dialog task.

Iā€™m try to use BotUserSession and implement under 1st dialog

BotAction -->script

var user_name = {

ā€œtitleā€:labels[Welcome_Task],

ā€œvalueā€: context.Name_Entity

};

BotUserSession.put(ā€˜UserNameā€™, user_name, ā€˜20000ā€™);

After this code implementation Bot not able to run

Show this error ā€“ ā€œI am sorry, something went wrong and I had to discard your task. Please retry.ā€

Can you tell me how to fetch values in another dialog ā€“

Iā€™m try to use this syntax ā€“ {{context.session.BotUserSession.UserName}}

{{context.entities.user_name}}

{{context.entities.Name_Entity}}

None of these working.

Can you please help me out.

Thank You