public ConnectorController
Controller to connect interface Connector and interface BotDefinition.
interface Connector,
interface BotDefinition@NotNull BotDefinition getBotDefinition()
The bot definition served by the controller.
@NotNull Connector getConnector()
The connector used by the controller.
@NotNull ConnectorType getConnectorType()
The type of connector used by the controller.
void notify(@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,
@Nullable
ActionNotificationType notificationType,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> errorListener)
Sends a notification to the connector.
A interface BotBus is created and the corresponding story is called.
recipientId - the recipient identifierintent - the notification intentstep - the optional step targetparameters - the optional parametersnotificationType - notification type if anyerrorListener - called when a message has not been deliveredinterface BotBusvoid handle(@NotNull
Event event,
@NotNull
ConnectorData data)
Handles an event sent by the connector. the primary goal of this controller.
event - the event to handledata - the optional additional data from the connectordouble support(@NotNull
Action action,
@NotNull
ConnectorData data)
Return a probability of the support by the bot of this action
by default returns the nlp intent probability.
void registerServices(@NotNull
java.lang.String serviceIdentifier,
@NotNull
kotlin.jvm.functions.Function1<? super io.vertx.ext.web.Router,kotlin.Unit> installer)
Register services at startup.
void unregisterServices()
Unregister services when interface Connector is unregistered.
interface Connector@NotNull Action errorMessage(@NotNull PlayerId playerId, @NotNull java.lang.String applicationId, @NotNull PlayerId recipientId)
Returns an error message (technical error).
@NotNull kotlin.jvm.functions.Function1<java.lang.String,ai.tock.bot.definition.StoryDefinition> storyDefinitionLoader()
Return a story definition provider for this controller.