Package ai.tock.bot.engine
Interface ConnectorController
-
- All Implemented Interfaces:
public interface ConnectorControllerController to connect Connector and BotDefinition.
-
-
Method Summary
Modifier and Type Method Description Unitnotify(PlayerId recipientId, IntentAware intent, StoryStep<out StoryHandlerDefinition> step, Map<String, String> parameters, ActionNotificationType notificationType, Function1<Throwable, Unit> errorListener)Sends a notification to the connector. abstract Unithandle(Event event, ConnectorData data)Handles an event sent by the connector. abstract Doublesupport(Action action, ConnectorData data)Return a probability of the support by the bot of this action by default returns the nlp intent probability.
abstract UnitregisterServices(String serviceIdentifier, Function1<Router, Unit> installer)Register services at startup. abstract UnitunregisterServices()Unregister services when Connector is unregistered. ActionerrorMessage(PlayerId playerId, String applicationId, PlayerId recipientId)Returns an error message (technical error). Function1<String, StoryDefinition>storyDefinitionLoader(String applicationId)Return a story definition provider for this controller. abstract BotDefinitiongetBotDefinition()The bot definition served by the controller. abstract ConnectorgetConnector()The connector used by the controller. ConnectorTypegetConnectorType()abstract BotApplicationConfigurationgetBotConfiguration()-
-
Method Detail
-
notify
Unit notify(PlayerId recipientId, IntentAware intent, StoryStep<out StoryHandlerDefinition> step, Map<String, String> parameters, ActionNotificationType notificationType, Function1<Throwable, Unit> errorListener)
Sends a notification to the connector. A BotBus is created and the corresponding story is called.
- Parameters:
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 delivered
-
handle
abstract Unit handle(Event event, ConnectorData data)
Handles an event sent by the connector. the primary goal of this controller.
- Parameters:
event- the event to handledata- the optional additional data from the connector
-
support
abstract Double support(Action action, ConnectorData data)
Return a probability of the support by the bot of this action
by default returns the nlp intent probability.
- Returns:
a probability between 0.0 (not supported) and 1.0 (supported!)
-
registerServices
abstract Unit registerServices(String serviceIdentifier, Function1<Router, Unit> installer)
Register services at startup.
-
unregisterServices
abstract Unit unregisterServices()
Unregister services when Connector is unregistered.
-
errorMessage
Action errorMessage(PlayerId playerId, String applicationId, PlayerId recipientId)
Returns an error message (technical error).
-
storyDefinitionLoader
Function1<String, StoryDefinition> storyDefinitionLoader(String applicationId)
Return a story definition provider for this controller.
-
getBotDefinition
abstract BotDefinition getBotDefinition()
The bot definition served by the controller.
-
getConnector
abstract Connector getConnector()
The connector used by the controller.
-
getConnectorType
ConnectorType getConnectorType()
-
getBotConfiguration
abstract BotApplicationConfiguration getBotConfiguration()
-
-
-