-
- All Implemented Interfaces:
-
ai.tock.bot.engine.BotBus,ai.tock.bot.engine.Bus,ai.tock.bot.engine.I18nTranslator,ai.tock.translator.I18nKeyProvider
public interface StoryHandlerDefinition implements BotBus
Story handler definitions are used in StoryHandler to provide custom context and to manage specific connector behaviour.
Implementations should usually use StoryHandlerDefinitionBase.
-
-
Method Summary
Modifier and Type Method Description abstract Unithandle()The main method to implement. UnitanswerWith(CharSequence default, Function0<Object> messageProvider)Answers with the specified parameters. ConnectorStoryHandler<?>getConnector()abstract BotDefinitiongetBotDefinition()The bot definition of the current bot. abstract UserTimelinegetUserTimeline()The user timeline. abstract DialoggetDialog()The initial dialog for this user. abstract DialoggetCurrentDialog()The current dialog for this user (may be different from the initial dialog). IntentAwaregetCurrentIntent()abstract StorygetStory()The current story. abstract ActiongetAction()The user action. abstract ConnectorDatagetConnectorData()The data specific to the connector (if any). abstract UserPreferencesgetUserPreferences()User preferences of the current user. abstract ConnectorgetUnderlyingConnector()The underlying Connector used. abstract Map<String, EntityStateValue>getEntities()The entities in the dialog state. abstract I18nKeyProvidergetI18nProvider()To manage i18n. abstract NextUserActionStategetNextUserActionState()Qualify the next user action. StoryStep<out StoryHandlerDefinition>getStep()StringgetStepName()StringgetUserText()StringgetContextId()BooleangetTest()abstract StringgetApplicationId()The current application id. abstract PlayerIdgetBotId()The current bot id. abstract PlayerIdgetUserId()The current user id. abstract IntentAwaregetIntent()The current intent of the dialog at Bus (ie request) initialization. abstract IntegergetCurrentAnswerIndex()The current answer index of the bot for this action. abstract LocalegetUserLocale()The current user Locale. abstract UserInterfaceTypegetUserInterfaceType()The current user interface type. abstract ConnectorTypegetTargetConnectorType()The ConnectorType used for the response. abstract UnitsetStory(Story story)The current story. abstract UnitsetI18nProvider(I18nKeyProvider i18nProvider)To manage i18n. abstract UnitsetNextUserActionState(NextUserActionState nextUserActionState)Qualify the next user action. UnitsetStep(StoryStep<out StoryHandlerDefinition> step)-
Methods inherited from class ai.tock.bot.definition.StoryHandlerDefinition
booleanChoice, changeContextValue, changeContextValue, changeEntityText, changeEntityValue, changeEntityValue, changeEntityValue, choice, contextValue, contextValue, defaultDelay, end, end, end, end, end, end, end, endRawText, entityText, entityText, entityValue, entityValue, entityValueDetails, entityValueDetails, getBusContextValue, getBusContextValue, handleAndSwitchStory, hasActionEntity, hasActionEntity, hasChoiceValue, i18n, i18nKey, isChoiceAction, isFeatureEnabled, isIntent, markAsUnknown, nlpStats, reloadProfile, removeAllEntityValues, removeEntityValue, removeEntityValue, resetDialogState, send, send, send, send, send, send, send, send, setBusContextValue, setBusContextValue, skipAnswer, switchStory, withMessage, withNotificationType, withPriority, withVisibility -
Methods inherited from class ai.tock.bot.engine.I18nTranslator
i18n -
Methods inherited from class ai.tock.bot.engine.BotBus
sendRawText, withMessage, withMessage -
Methods inherited from class ai.tock.bot.engine.Bus
translate, translate, translate, translateAndReturnBlankAsNull -
Methods inherited from class ai.tock.translator.I18nKeyProvider
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
answerWith
Unit answerWith(CharSequence default, Function0<Object> messageProvider)
Answers with the specified parameters.
- Parameters:
default- used if messageProvider returns nullmessageProvider- provides the answer - a message or a list of messages
-
getConnector
ConnectorStoryHandler<?> getConnector()
-
getBotDefinition
abstract BotDefinition getBotDefinition()
The bot definition of the current bot.
-
getUserTimeline
abstract UserTimeline getUserTimeline()
The user timeline. Gets history and data about the user.
-
getCurrentDialog
abstract Dialog getCurrentDialog()
The current dialog for this user (may be different from the initial dialog).
-
getCurrentIntent
IntentAware getCurrentIntent()
-
getConnectorData
abstract ConnectorData getConnectorData()
The data specific to the connector (if any).
-
getUserPreferences
abstract UserPreferences getUserPreferences()
User preferences of the current user.
-
getUnderlyingConnector
abstract Connector getUnderlyingConnector()
The underlying Connector used. Please do not use this method as it is exposed for third party libraries only.
-
getEntities
abstract Map<String, EntityStateValue> getEntities()
The entities in the dialog state.
-
getI18nProvider
abstract I18nKeyProvider getI18nProvider()
To manage i18n.
-
getNextUserActionState
abstract NextUserActionState getNextUserActionState()
Qualify the next user action.
-
getStep
StoryStep<out StoryHandlerDefinition> getStep()
-
getStepName
String getStepName()
-
getUserText
String getUserText()
-
getContextId
String getContextId()
-
getApplicationId
abstract String getApplicationId()
The current application id.
-
getIntent
abstract IntentAware getIntent()
The current intent of the dialog at Bus (ie request) initialization.
-
getCurrentAnswerIndex
abstract Integer getCurrentAnswerIndex()
The current answer index of the bot for this action.
-
getUserLocale
abstract Locale getUserLocale()
The current user Locale.
-
getUserInterfaceType
abstract UserInterfaceType getUserInterfaceType()
The current user interface type.
-
getTargetConnectorType
abstract ConnectorType getTargetConnectorType()
The ConnectorType used for the response.
-
setI18nProvider
abstract Unit setI18nProvider(I18nKeyProvider i18nProvider)
To manage i18n.
-
setNextUserActionState
abstract Unit setNextUserActionState(NextUserActionState nextUserActionState)
Qualify the next user action.
-
setStep
Unit setStep(StoryStep<out StoryHandlerDefinition> step)
-
-
-
-