Ferrisbot is a Rust based moderator chat bot, designed to used with the Telegram messenger.
Download and install Ollama
examples:
Llama3.2
ollama run llama3.2:latestor
mistral-nemo 12B
ollama run mistral-nemo:12bRemember: The models must have tool support and if it works well or not depends on the model of your choice!
examples:
export TELEGRAM_TOKEN = <MY_TELEGRAM_BOT_TOKEN>
export OLLAMA_HOST_ADDR = "http:localhost"
export OLLAMA_PORT = 11434
export LLM_MODEL = "llama3.2:latest"
export BOT_NAME = "<Name of the bot>"
export BOT_USERNAME = "<Telegram username of the bot>"
export FILE_DB_PATH = "<Path to store bot memory state file>"Create or adjust the bot role definitions (natural language) in the prompt template role_definition.md
Following placeholders must be used in your role definition prompt template
The name of your bot which has been defined as the environment variable:
{name}This internal flag is important if you define a situation in the template where the bot should not response to a message:
{NO_ACTION}This application requires OpenSSL and pkg-config:
- On Linux:
pkg-config libssl-dev - On Mac: nothing to do!
cargo buildcargo runexport RUST_LOG="debug"
cargo test -- --nocapture- For the Telegram api framework, I'm using my own fork version of mobot, where the missing telegram api capabilities are implemented: Restriction of chat members, forum message support, retrieve chat full information, ban/unban users and get administrator member list. When the features are fully tested and the time allows me, I will create a PR to contribute back if they want.
