Reputation: 17999
I don't understand what happens with my bot, at some point during the conversation it loses some context variables.
In the following screenshot, you can see that the variables school
and campus
are empty. That's weird because the reply the bot does is
Voici les bourses disponibles pour
IDRAC
Paris
Where IDRAC
is the school
variable, and Paris
is the campus
.
I don't understand how the bot can both display the proper value (set previously by different Intents), and not have the value set.
Here is the Diagnostic Info
{
"responseId": "759621b6-58cc-417e-a635-46df7627d279",
"queryResult": {
"queryText": "bourses",
"parameters": {
"type": "Bourses",
"school": "",
"campus": ""
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Voici les Bourses disponibles pour IDRAC Paris",
"fulfillmentMessages": [
{
"text": {
"text": [
"Voici les Bourses disponibles pour IDRAC Paris"
]
}
},
{
"text": {
"text": [
"Vous pouvez me demander des détails sur celles qui vous intéressent"
]
}
}
],
"outputContexts": [
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/school_campus_set",
"lifespanCount": 249,
"parameters": {
"school.original": "",
"type": "Bourses",
"school": "",
"type.original": "bourses",
"campus.original": "",
"campus": ""
}
},
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/awaiting_solution_id",
"lifespanCount": 1,
"parameters": {
"school.original": "",
"type": "Bourses",
"school": "",
"campus.original": "",
"type.original": "bourses",
"campus": ""
}
},
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/awaiting_campus",
"lifespanCount": 1,
"parameters": {
"type": "Bourses",
"school": "",
"campus.original": "",
"type.original": "bourses",
"campus": "",
"school.original": ""
}
},
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/current_session",
"lifespanCount": 250,
"parameters": {
"type": "Bourses",
"school": "",
"campus.original": "",
"type.original": "bourses",
"campus": "",
"school.original": ""
}
},
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/type_set",
"lifespanCount": 15,
"parameters": {
"type": "Bourses",
"school": "",
"campus.original": "",
"type.original": "bourses",
"campus": "",
"school.original": ""
}
},
{
"name": "projects/hep-playground/agent/sessions/f69b9423-25d0-bc30-bfff-5f71da18f62d/contexts/school_set",
"lifespanCount": 23,
"parameters": {
"type": "Bourses",
"school": "",
"campus.original": "",
"type.original": "bourses",
"campus": "",
"school.original": ""
}
}
],
"intent": {
"name": "projects/hep-playground/agent/intents/e3236893-676e-4e53-8c87-5b1aa974411e",
"displayName": "UserSetsType"
},
"intentDetectionConfidence": 1,
"languageCode": "fr"
}
}
I don't understand why the same keys are repeated over and over in every contexts, it doesn't make sense.
We tried to put a current_session
as output of every intent, hoping that it would keep the context alive somehow (following this guide: https://miningbusinessdata.com/better-dialogflow-bots-part-4-session-variables/)
More of the bot's configuration:
Upvotes: 2
Views: 641
Reputation: 50701
The issue is that your UserSetsType
Intent has all three parameters defined. The school
and campus
parameters are empty strings if the user doesn't say anything that would fill them, and most of your responses don't include a way for them to be filled.
All Contexts active (both specified in the GUI and defined by you) capture the parameters that are defined for the Intents that are triggered, even if they are not filled by the user. They're filled with the empty string, to indicate they weren't specifically filled Even if they previously had values, indicating that you're attempting to get the value from a particular Intent will replace them with the empty string, indicating you didn't get them from that Intent.
So even if school
and campus
were set in a previous Intent. The fact that you specified them in the UserSetsType
Intent means that those values will be replaced with whatever matched for that Intent, and those new values will be put in the current_session
Context.
While you are on the right track to store the accumulated state in a Context, if you have parameters that may be specified by multiple Intents, then you should be adding them to that session Context under a different parameter name that will be non-conflicting. (So you might map school
to savedSchool
.)
Upvotes: 2