-
Notifications
You must be signed in to change notification settings - Fork 22
Core Intent Library
Many bots share some common intents (to say hello, to thank you, to ask for help, to say no,...) that you don't want to repeat every single time. To save you some time, Xatkit includes a Core Intent Library, integrated in the runtime, which you can directly reuse in your new bot project.
A couple of examples of predefined intents in the library
public static IntentDefinition No = intent("No")
.trainingSentence("No")
.trainingSentence("no")
.trainingSentence("nope")
.trainingSentence("negative")
.getIntentDefinition();
public static IntentDefinition Help = intent("Help")
.trainingSentence("Help")
.trainingSentence("help")
.trainingSentence("Assist")
.trainingSentence("I need support")
.trainingSentence("I need some help")
.trainingSentence("I need some assistance")
.getIntentDefinition();
To use any of these intents in your bot you just need to import the library.
import com.xatkit.library.core.CoreLibrary;
Once imported, feel free to add the intents in any state transition. For instance, in this SimpleQA bot you'll find several examples where Core Library intents are used throughout the bot, as for the Greetings intent in this case:
awaitingInput
.next()
.when(intentIs(CoreLibrary.Greetings)).moveTo(handleGreetings)
.when(intentIs(xatkitInfo)).moveTo(giveInfo)
.when(intentIs(wantBot)).moveTo(askBotSize);
Note that we prefix the core library intents with CoreLibrary.
If you need to develop bots in several languages, we have also released an internationalized version of the library. See this repository for more details
Same as we have created this core library, you can extend or create your own library optimized for the typical intents in your domain.
- 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