Zoozl services for chatbots
Project description
zoozl
Server for chatbot services
Usage
For basic example a chatbot plugin is provided in zoozl.plugins
package. It is a simple chatbot that allows to play bulls & cows game. It is also a plugin that is loaded in case no configuration file is provided.
Run websocket server
python -m zoozl 1601 --conf chatbot.toml
where 1601
is the port number and chatbot.toml
is optional configuration file.
Architecture
zoozl package contains modules that handle various input interfaces like websocket or http POST and a chatbot interface that must be extended by plugins. Without plugin zoozl is not able to respond to any input. Plugin can be considered as a single chat assistant to handle a specific task. Plugin can be huge and complex or simple and small. It is up to the developer to decide how to structure plugins.
Plugin
Mimimal setup
- Create new toml configuration file (e.g. myconfig.toml)
extensions = ['my_plugin_module']
- Make sure
my_plugin_module
is importable from within python that will run zoozl server - Create file
my_plugin_module.py
from zoozl.chatbot import Interface
class MyPlugin(Interface):
aliases = ("call myplugin",)
def consume(self, context: , package: Package):
package.callback("Hello this is my plugin response")
- Start zoozl server with your configuration file and asking to bot
call myplugin
it will respondHello this is my plugin response
python -m zoozl 1601 --conf myconfig.toml
Configuration file
Configuration file must conform to TOML format. Example of configuration:
title = "Global configuration for Chatbot"
extensions = ["chatbot_fifa_extension", "zoozl.plugins.greeter"]
[chatbot_fifa_extension]
database_path = "tests/tmp"
administrator = "admin"
Root objects like title, extensions are configuration options for chatbot system wide setup, you can pass unlimited objects in configuration, however suggested is to add a component for each plugin and separate those within components.
- TODO: Describe plugin interface and creation
- TODO: Add authentication and authorization interaction between chatbot and plugin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zoozl-0.0.25.tar.gz
.
File metadata
- Download URL: zoozl-0.0.25.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec298c684657214c66c0efeaaf4e227d7987567a296723e306f3419c85dd000 |
|
MD5 | 47c985bf446225d17ad02cd156e9525d |
|
BLAKE2b-256 | ca4c5e8828b1fb4fdb15bcd70b13cf8b77a1546935d0c6cd615ca7a82aedefe3 |
File details
Details for the file zoozl-0.0.25-py3-none-any.whl
.
File metadata
- Download URL: zoozl-0.0.25-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db4403dabb981f9aa8d5faa3e49e410efd8222d069d7065215f395630ca6bbe |
|
MD5 | 8332778bc57d9f406199a5c92d17623e |
|
BLAKE2b-256 | f2d4a7de810fb755a8297846ada347ba572cdbe593de2120b5c1d340818f0c7e |