tock / ai.tock.bot.engine.dialog / Story

Story

data class Story (source)

A Story is a small unit of conversation about a specific topic. It is linked to at least one intent - the starterIntent.

Constructors

<init>

A Story is a small unit of conversation about a specific topic. It is linked to at least one intent - the starterIntent.

Story(definition: StoryDefinition, starterIntent: Intent, step: String? = null, actions: MutableList<Action> = mutableListOf())

Properties

actions

val actions: MutableList<Action>

currentStep

The current step of the story.

val currentStep: StoryStep<*>?

definition

val definition: StoryDefinition

lastAction

The last action of the story.

val lastAction: Action?

lastUserAction

The last user action of the story.

val lastUserAction: Action?

starterIntent

val starterIntent: Intent

Functions

computeCurrentStep

Set the current step form the specified action and new intent.

fun computeCurrentStep(userTimeline: UserTimeline, dialog: Dialog, action: Action, newIntent: Intent?): Unit

handle

Handles a request.

fun handle(bus: BotBus): Unit

support

What is the probability of this request support?

fun support(bus: BotBus): Double

supportAction

Does this story supports the action ?

fun supportAction(userTimeline: UserTimeline, dialog: Dialog, action: Action, intent: Intent): Boolean

supportIntent

Does this story supports the intent ?

fun supportIntent(intent: Intent): Boolean