Teneo Developers

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

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:

groovy

1def transcript = DialogTranscriptHelper.getTranscript(_,'Flow')
2

The resulting value of transcript will be:

User: Hello
Flow: Hello. It's good to see you!
User: Do you know my name?
I don't think I know your name. What is your name?
My name is Jack
It's a pleasure, Jack!

If you get the dialog history like this:

groovy

1def transcript = DialogTranscriptHelper.getDialog(_)
2

The resulting value of transcript will be:

groovy

1[
2	{userInputText=Hello, answerText=Hello. It's good to see you!}, 
3	{userInputText=Do you know my name?, answerText=I don't think I know your name. What is your name?},
4    {userInputText=My name is Jack, answerText=It's a pleasure, Jack!}
5]
6

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.