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


(Tabish Khan) #1

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.


(Subrahmanyam Donepudi) #2

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?


(Tabish Khan) #3

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


(Jaya Prakash Gurrapu) #4

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


(Subrahmanyam Donepudi) #5

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?


(Jaya Prakash Gurrapu) #6

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


(Subrahmanyam Donepudi) #7

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/


(Jaya Prakash Gurrapu) #8

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


(Subrahmanyam Donepudi) #9

@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


(Jaya Prakash Gurrapu) #10

Hi @Subrahmanyam,
thanks for reply i have implemented.

Jayaprakashhn


(Jaya Prakash Gurrapu) #11

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


(Subrahmanyam Donepudi) #12

@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.


(Jaya Prakash Gurrapu) #13

Hi @Subrahmanyam,

thank you for your reply.
Jayaprakashhan


(Eddie Kuse) #14

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


(Subrahmanyam Donepudi) #15

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.


(Subrahmanyam Donepudi) #16

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.

image

At the intent node “Post Details”, I have configured the NL section to emit the context output as “postdetails”

image

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)

image

image

Configured an intent pattern to identify the followup utterance

image

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

image

image


(Eddie Kuse) #17

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


(Subrahmanyam Donepudi) #18

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