-
Notifications
You must be signed in to change notification settings - Fork 22
Xatkit Options
Xatkit supports several options that can be set through its Configuration object. This botConfiguration
object is passed together with the bot model when running the desired bot.
XatkitCore xatkitCore = new XatkitCore(botModel, botConfiguration);
xatkitCore.run();
The type of this object is org.apache.commons.configuration2.Configuration. You can use any of the methods and classes of that Apache library to modify the properties you're interested in.
For instance, you can modify one single property or load a complete .properties file
Configuration botConfiguration = new BaseConfiguration();
botConfiguration.setProperty("xatkit.server.port", 5008); //example to change the port
Configurations configurations = new Configurations();
try {
botConfiguration =
configurations.properties(YOURBot.class.getClassLoader().getResource("bot" +
".properties"));
} catch (ConfigurationException e) {
e.printStackTrace();
System.out.println("file not found");
}
The rest of the article describes the available options of the Xatkit Runtime component and their possible values (note that platform-specific options are detailed in the corresponding platforms' wiki articles, see for instance the DialogFlow options).
These options affect Xatkit behavior independently of the selected intent recognition provider and platforms.
Key | Values | Description | Constraint |
---|---|---|---|
xatkit.message.delay |
Integer | The delay (in milliseconds) to wait before sending message | Optional (default 0 ) |
xatkit.recognition.enable_monitoring |
Boolean | Allows to enable/disable intent recognition monitoring | Optional (default false ) |
xatkit.recognition.preprocessors |
List of comma-separated Strings | The name of the pre-processors to activate for the bot (unqualified class names) | Optional (default: empty list) |
xatkit.data.directory |
String | The path of the directory used to store execution data when using the internal MapDB for monitoring | Optional (default ./data ) |
xatkit.recognition.postprocessors |
List of comma-separated Strings | The name of the post-processors to activate for the bot (unqualified class names) | Optional (default: empty list) |
xatkit.server.port |
Integer | The port used by the Xatkit server to receive events and expose services | Optional (default 5000) |
xatkit.server.public_url |
String | The public URL of the deployed Xatkit server. This value is used to deploy the admin test bot and connect it to the running Xatkit instance. | Optional (the bot will be accessible at http://localhost:5000 if not specified) |
xatkit.event.matcher.print_builder |
Boolean | Debug option that can be enabled to log the content of the EventInstanceBuilder before building the matched EventInstance . This method allows to check the received JSON payload representing the event. |
Optional (default false ) |
You can specify Xatkit options as command line arguments, which may be interesting if you want to start multiple versions of the same bot, or to ease the configuration of a Docker image containing your bot.
The syntax for command line arguments is as follows: -D<option key>=<option value>
, as an example, the snippet below will start MyBot.jar on the port 5010 (instead of the default 5000).
java -Dxatkit.server.port=5010 -jar MyBot.jar
Note that command line arguments can be used for any Xatkit option, including DialogFlow and platform-specific options. Multiple options can be provided with the following syntax:
java -D<option1>=<value1> -D<option2>=<value2> [...] -jar MyBot.jar
⚠ Command line arguments override the Configuration content.
- Getting Started
- Configuring your bot
- Integrating an Intent Recognition Provider
- Adding a bot to your website
- Deploying on Slack
- Basic concepts
- Intents and Entities
- States, Transitions, and Context
- Default and Local Fallbacks
- Core Library