To get started with InterBot, lets understand the operators
This operator is used to dereference a Bot
Usage : @A where A is Bot.
This operator is used to compose a composite bot. User's can assign a botname to a concatenated set of bots.
Usage: @C = @A | @B
Here, @C is a composite bot of 2 bots A & B concatenated serially.
The pipe operator is an input-output operator. This operator is used concatenate bots serially, where the input to the next bot is the output of the previous bot.
Usage: @D = @A | @B | @C
Bot D is a composed of Bot A, B & C.
Let’s walkthrough an example of how to use the operators and create a bot on InterBot
Assume you have an existing online pizza bot that understands English input and responds to its customers in English too. If the Bot had to cater to Spanish speaking audience, then you would have to build a separate Spanish pizza bot for your Spanish customer base.
With InterBot, you can connect 2 bots to your pizza bot, one that translates Spanish input to English output and then the reverse, English input to Spanish output, and voila! You have your Spanish Pizza bot. This is a classic InterBot usecase.
Hence, the Spanish pizza bot will comprise of 3 bots:
@pizzabot (Pizza ordering bot) - This bot the takes the pizza orders in english
@eng2spbot (English to spanish translator bot) - This bot translates english text inputs to spanish text output
@sp2engbot (Spanish to English translator bot) - This bot translates spanish text input to english text output
To compose your Spanish pizza Bot, you would connect the pizza bot between them. The English output of the spanish to English bot would go as input to the pizza bot and the English output of the pizza bot will be input to the English to spanish bot. Hence, your construct would be:
Spanishpizzabot = spanishtoenglish bot + pizzabot + englishtospanish bot
In the InterBot Console , you would type
> @spanishpizzabot = @sp2engbot | @pizzabot | @eng2spbot
where @spanishpizzabot is ournew Spanish pizza bot, created on InterBot.
Here’s how the messages would flow between the bots.
The @spbot sends the Spanish text message to the @sp2engbot. Let's say the user says 'Hola'
The @sp2engbot takes the Spanish input ‘Hola’ and translates it to english & gives it to the @pizzabot as 'Hello'
The @pizzabot responds in English with "Size of pizza?" & gives this as input to the @eng2spbot.
The @eng2spbot translates the english input to spanish "tamano de la pizza?" and responds back to the @spanishpizzabot
The @spanishpizzabot passes this message to the user
Error messages (Displayed in the shell)
Not Bot Owner - This message is displayed when user is trying to compose a bot with name that is already exists on InterBot
Botname should be more than 5 characters - This message is displayed when Botname is less than 5 characters
Mapped bot <botname> does not exist - This message is displayed when the bot being used in composing a new bot, does not exist)
Invalid Format - Message displayed when the compose syntax is incorrect.