Dialog Transcripts

With DialogTranscriptHelper you can can get all inputs and outputs in a conversation either as a transcript or as an object.

Installation

Add the file DialogTranscriptHelper.groovy to Resources in your solution and set the path to /script_lib.

For more details on managing files in your solution, see Resource File Manager.

Example

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!}
]

Methods

getTranscript(engineAccess, botname)

Returns a transcript of the dialog as a string.

Parameters

  • Pass on engineAccess (or the alias _) to give the method access to EngineAccess.
  • Pass on the name of your bot as a string. If empty, the name 'Bot' will be used.

Result

String with a transcript of the dialog.

getDialog(engineAccess)

Returns a transcript of the dialog as a list of objects.

Parameters

  • Pass on engineAccess (or the alias _) to give the method access to EngineAccess.

Result

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?