public class BotRepository
Advanced bot configuration.
ai.tock.bot.registerAndInstallBot method is the preferred way to start a bot in most use cases.
public static BotRepository INSTANCE
Advanced bot configuration.
ai.tock.bot.registerAndInstallBot method is the preferred way to start a bot in most use cases.
@NotNull public RequestTimer getRequestTimer()
Request timer for connectors.
public void setRequestTimer(@NotNull
RequestTimer p)
Request timer for connectors.
@NotNull public kotlin.jvm.functions.Function1<io.vertx.ext.web.RoutingContext,kotlin.Unit> getHealthcheckHandler()
healthcheck handler to answer to GET /healthcheck.
public void setHealthcheckHandler(@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.RoutingContext,kotlin.Unit> h)
healthcheck handler to answer to GET /healthcheck.
public void forEachNlpListener(@NotNull
kotlin.jvm.functions.Function1<? super ai.tock.bot.engine.nlp.NlpListener,kotlin.Unit> action)
Calls the specified action for each registered interface NlpListener.
action,
interface NlpListenerpublic void notify(@NotNull
java.lang.String applicationId,
@NotNull
PlayerId recipientId,
@NotNull
IntentAware intent,
@Nullable
StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step,
@NotNull
java.util.Map<java.lang.String,java.lang.String> parameters,
@NotNull
NotifyBotStateModifier stateModifier,
@Nullable
ActionNotificationType notificationType,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> errorListener)
Sends a notification to the connector.
A interface Bus is created and the corresponding story is called.
applicationId - the configuration connector idrecipientId - the recipient identifierintent - the notification intentstep - the optional step targetparameters - the optional parametersstateModifier - allow the notification to bypass current user statenotificationType - the notification type if anyerrorListener - called when a message has not been deliveredinterface Buspublic void registerBotProvider(@NotNull
BotProvider bot)
Registers a new interface BotProvider.
interface BotProviderpublic void registerBuiltInStoryDefinitions(@NotNull
BotProvider botProvider)
Register built-in story definitions.
public void registerStoryHandlerListener(@NotNull
StoryHandlerListener listener)
Registers a new interface StoryHandlerListener.
interface StoryHandlerListenerpublic void registerBotAnswerInterceptor(@NotNull
BotAnswerInterceptor botAnswerInterceptor)
Registers a new interface BotAnswerInterceptor.
interface BotAnswerInterceptorpublic void registerNlpListener(@NotNull
NlpListener listener)
Registers an new interface NlpListener.
interface NlpListener@Nullable public ConnectorController getController(@NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.admin.bot.BotApplicationConfiguration,java.lang.Boolean> predicate)
Returns the current interface ConnectorController for a given predicate.
interface ConnectorControllerpublic void installBots(@NotNull
java.util.List<? extends kotlin.jvm.functions.Function1<? super io.vertx.ext.web.Router,? extends java.lang.Object>> routerHandlers,
boolean createApplicationIfNotExists,
@Nullable
java.util.concurrent.locks.Lock startupLock)
Installs the bot(s).
routerHandlers - the additional router handlerscreateApplicationIfNotExists - create an nlp application if not existsstartupLock - if not null, wait do listen until the lock is released@Nullable public ConnectorProvider findConnectorProvider(@NotNull ConnectorType connectorType)
Returns the interface ConnectorProvider for the specified class ConnectorType.
interface ConnectorProvider,
class ConnectorType@Synchronized public void checkBotConfigurations(boolean startup)
Checks that configurations are synchronized with the database.