These directories include example snippets for how to do various things with RiveScript-Python.
- brain - The standard default RiveScript brain (
.rivefiles) that implements an Eliza-like bot with added triggers to demonstrate other features of RiveScript.
- json-server - A minimal Flask web server that makes a RiveScript bot available at a JSON POST endpoint.
- twilio - An example that uses the Twilio SMS API to create a bot that can receive SMS text messages from users and reply to them using RiveScript.
- sessions - An example RiveScript bot which manages user session data using RiveScript event callbacks, assuming single user per bot instance scenario. Session continues when the script is run again (as it would happen if the script was a stateless webhook service for example). A simple JSON file-based data store is provided, but it's easy to implement database persistence by subclassing SessionStore class.
- js-objects - Demonstrates adding JavaScript object macro
support to RiveScript-Python. This example assumes a Python RiveScript bot is
serving its responses via a web front-end, so that the JS macros are being
executed in the user's browser via
<script>tags. - perl-objects - Demonstrates adding Perl object macro support to RiveScript-Python. This works by running a Perl script, which uses the Perl version of RiveScript, and passing essential data about the object call into the Perl script and retrieving the output.