We decided to open-source several components of our architecture, with 3 goals in mind:
- to make it as easy as possible to integrate with Clustaar Platform
- create a community for developers which will help us to improve our open tools
- bring most freedom as possible in the use of our tools
We are focused on making developers lives as easy as possible when they work with the Clustaar Bot Platform.
This library brings you all the JSON schemas necessary to integrate with the platform, and particularly the different actions available in steps.
As an example, here is a button action schema:
It will be very useful to build a webhook, and is used by our clustaar.webhook framework.
A webhook enables you to call an external service each time predefined steps are going to be executed. This service will be able to retrieve data from the bot, query internal services, store data, and customize the live bot answers.
The webhook must implement a handler, which will receive meta-data about the current step & user. You will then be able to implement any behavior you desire, then send back the list of actions you’d like the step to execute. It can be sent as it was configured in the bot builder, or you can change it, to include personalization data from your database and more.
The setup of a webhook using the framework is quite straightforward:
[pastacode lang=”python” manual=”from%20clustaar.webhook%20import%20Webhook%2C%20events%0Afrom%20clustaar.schemas.models%20import%20StepReachedResponse%2C%20ConversationSession%0A%0Adef%20handler(request%2C%20response%2C%20notification)%3A%0A%20%20%20%20session%20%3D%20ConversationSession(values%3D%7B%22name%22%3A%20%22John%22%7D)%0A%20%20%20%20return%20StepReachedResponse(actions%3D%5B%5D%2C%20session%3Dsession)%0A%0A%0Aapp%20%3D%20Webhook()%0Aapp.on(events.CONVERSATION_STEP_REACHED%2C%20handler)” message=”Webhook Setup” highlight=”” provider=”manual”/]
We use this framework ourselves for custom projects: it is frequently updated and improved by our team 🙂
In some cases, our users don’t want to use the Clustaar Webchat in order to go as far as possible in the integration of the bot: full screen bot, search-bar bot, etc…
This could be painful, as you need to build all the rich content interactions possible with our Clustaar Webchat stream… thankfully, we got you covered 😉 With the webchat-components repository, we provide you with all the necessary graphical components so you can build a visual integration quickly.
Button integration then becomes as fast as writing:
Isn’t that cool?
We built an authorization system for our needs! It’s convenient and light, so we decided to share it with you to use it in your own projects.
It integrates very well with Falcon, with a cool @authorize decorator.
[pastacode lang=”python” manual=”class%20ProjectHandler(object)%3A%0A%20%20%20%20%40authorize(view_action)%0A%20%20%20%20def%20on_get(self%2C%20request%2C%20response%2C%20id)%3A%0A%09%20%20%20%20pass” message=”Handler Example” highlight=”” provider=”manual”/]
You can fetch more details from the repository homepage!
If you have any ideas, suggestions or comments regarding our open-sourced projects, or new project ideas: please get in touch with us!