tock / ai.tock.bot.api.client

Package ai.tock.bot.api.client

Bot API Client Definition

Types

ClientBotDefinition

class ClientBotDefinition

ClientBus

Bus implementation for Tock Bot APÏ mode.

interface ClientBus : Bus<ClientBus>

ClientStep

class ClientStep

ClientStoryDefinition

class ClientStoryDefinition : IntentAware

ClientStoryHandler

interface ClientStoryHandler

TockClientBus

class TockClientBus : ClientBus

Functions

newBot

Creates a new bot.

fun newBot(apiKey: String, stories: List<ClientStoryDefinition>, unknownStory: ClientStoryDefinition = defaultUnknownStory()): ClientBotDefinition
fun newBot(apiKey: String, vararg stories: ClientStoryDefinition): ClientBotDefinition

newStory

Creates a new story.

fun newStory(mainIntent: String, otherStarterIntents: Set<IntentAware> = emptySet(), secondaryIntents: Set<IntentAware> = emptySet(), steps: List<ClientStep> = emptyList(), storyId: String = mainIntent, handler: ClientBus.() -> Unit): ClientStoryDefinition
fun newStory(mainIntent: IntentAware, otherStarterIntents: Set<IntentAware> = emptySet(), secondaryIntents: Set<IntentAware> = emptySet(), steps: List<ClientStep> = emptyList(), storyId: String = mainIntent.wrappedIntent().name, handler: ClientBus.() -> Unit): ClientStoryDefinition

newStoryHandler

Creates a new ClientStoryHandler.

fun newStoryHandler(handler: ClientBus.() -> Unit): ClientStoryHandler

toConfiguration

fun ClientBotDefinition.toConfiguration(): ClientConfiguration

unknownStory

Create a story addressing Intent.unknown intent.

fun unknownStory(handler: ClientBus.() -> Unit): ClientStoryDefinition