Hi there,
My team has recently started using Microsoft PVA to create a chatbot. The chatbot is quite complicated and results in very large topics, both vertically and horizontally. Having dynamic topic redirection functionality will be a massive help in solving this. Instead of having multiple topic redirects based on a conditional statement, we could use a single topic redirect which redirects to a topic specified by a variable value.
I have tried to get this to work using the code editor. The original topic is shown below:
kind: AdaptiveDialog
beginDialog:
kind: OnRecognizedIntent
id: main
intent:
displayName: temp_main
triggerQueries:
- test dynamic redirect
actions:
- kind: SetVariable
id: setVariable_DO3Gz4
variable: Topic.TopicName
value: temp_1
- kind: BeginDialog
id: zyOpb8
dialog: cr585_bOServiceBot.topic.temp_1
Now to dynamically redirect to the topic specified by the variable "TopicName", I tried to modify the redirect block as follows:
- kind: BeginDialog
id: zyOpb8
dialog: cr585_bOServiceBot.topic.${Topic.TopicName}
However, this (and other similar attempts) causes an error when saving and when testing the chatbot. Is there any work-around for this? Or is there a plan to introduce dynamic topic redirect functionality to PVA?
Any help or information on this would be greatly appreciated.
Thanks!
cvallabh
Thanks @HenryJammes . I finally just set this up right now and it works perfectly for my usecase. I'm also wondering if it's possible to dynamically change a variable in this way.
This code doesn't work
- kind: SetVariable
id: setVariable_98I9xi
variable: |-
=Switch(
Topic.redirectTo,
"upset", Global.Upset,
"emotion", Global.Emotion,
"crc5c_forgivenessAiDemo_WyZVYd.topic.Fallback"
)
value: =Topic.userInput
Actually @wswitzer, @cvallabh, I've learned that dynamic redirects are already possible, but you have to use the code editor view for this. We're looking to see if this can be added to the UX as well.
Here's an example where I go to a different topic based on a variable value:
In the code editor, in the dialog property, can use a Power Fx formula to define the topic to trigger:
kind: AdaptiveDialog
beginDialog:
kind: OnRecognizedIntent
id: main
intent:
triggerQueries:
- Dynamic redirects
actions:
- kind: SetVariable
id: setVariable_7bgfoP
variable: Topic.MyVariable
value: =RandBetween(0,4)
- kind: BeginDialog
id: A4lDAn
dialog: |-
=Switch(
Topic.MyVariable,
1, "cat_MyBot.topic.Lesson1",
2, "cat_MyBot.topic.Lesson2",
3, "cat_MyBot.topic.Lesson3",
"cat_MyBot.topic.Fallback"
)
@wswitzer - I saw the feature request, but it doesn't have any detail on the customer who would benefit from it or the business impact, is there any chance you can add more color to this? Not debating the usefulness of this, but feature requests are often prioritized based on business impact and number and size of the requesting customers.
No, but let me check again.
Did this ever get looked at/implemented in any way?
Hi @cvallabh
I love this idea, and this is also something I had suggested internally.
To help get this prioritized, can you please submit a feature request here?
https://aka.ms/PVAFeatureRequest
Cc. @GaryPrettyMsft