With DialogTranscriptHelper you can can get all inputs and outputs in a conversation either as a transcript or as an object.
Add the file DialogTranscriptHelper.groovy to the Resources in your solution and set the path to /script_lib
.
For more details on managing files in your solution, see Resource File Manager.
If the dialog looks like this:
User: Hello
Bot: Hi! It is good to see you!User: Do you know my name?
Bot: I don't think I know your name. What is your name?User: My name is Jack
Bot: It's a pleasure, Jack!
And you get the transcript like this:
def transcript = DialogTranscriptHelper.getTranscript(_,'Flow')
The resulting value of transcript will be:
User: Hello
Flow: Hello. It's good to see you!
User: Do you know my name?
Flow: I don't think I know your name. What is your name?
User: My name is Jack
Flow: It's a pleasure, Jack!
If you get the dialog history like this:
def transcript = DialogTranscriptHelper.getDialog(_)
The resulting value of transcript will be:
[
{userInputText=Hello, answerText=Hello. It's good to see you!},
{userInputText=Do you know my name?, answerText=I don't think I know your name. What is your name?},
{userInputText=My name is Jack, answerText=It's a pleasure, Jack!}
]
Returns a transcript of the dialog as a string.
String with a transcript of the dialog.
Returns a transcript of the dialog as a list of objects.
List of objects. Each object contains a key userInputText with the user's input and a key answerText with the answer text.
Was this page helpful?