tock / ai.tock.bot.definition / StoryDefinition

StoryDefinition

interface StoryDefinition : IntentAware (source)

The definition of a "Story". A story holds a list of actions of the same domain. The story provides a set of starter intents. When theses intents are detected, The story is started.

Story definitions should usually not directly extend this class, but instead extend SimpleStoryHandlerBase or StoryDefinitionBase.

Properties

id

An unique identifier for a given bot.

abstract val id: String

intents

The complete list of intents supported by the story.

abstract val intents: Set<Intent>

starterIntents

One or more intents that start the story. Usually, you don't have the same starter intent in two different story definition.

abstract val starterIntents: Set<Intent>

steps

The root steps of the story.

abstract val steps: Set<StoryStep<*>>

storyHandler

The story handler of the story.

abstract val storyHandler: StoryHandler

tags

The story definition tags that specify different story types or roles.

open val tags: Set<StoryTag>

unsupportedUserInterfaces

When this story does not support all UserInterfaceTypes.

abstract val unsupportedUserInterfaces: Set<UserInterfaceType>

Functions

allSteps

Returns all steps of the story.

open fun allSteps(): Set<StoryStep<*>>

hasTag

Does this story is tagged with specified tag?

open fun hasTag(tag: StoryTag): Boolean

isStarterIntent

Is the specified intent is a starter intent?

open fun isStarterIntent(intent: Intent): Boolean

mainIntent

The "referent" intent for this story.

open fun mainIntent(): Intent

supportIntent

Is the specified intent is supported by this story?

open fun supportIntent(intent: Intent): Boolean

wrappedIntent

Implementation for IntentAware.

open fun wrappedIntent(): Intent

Inheritors

SimpleStoryDefinition

Simple implementation of StoryDefinition.

open class SimpleStoryDefinition : StoryDefinition

StoryDefinitionBase

Default StoryDefinition implementation.

open class StoryDefinitionBase : StoryDefinition

StoryDefinitionExtended

Helper methods for StoryDefinition implementation. Usually direct implementations are enums. This interface add a starter (and main) intent with intent name equals to the property of value name to the StoryDefinition. Warning: advanced usage only.

interface StoryDefinitionExtended : StoryDefinition