Talos chatops framework
Project description
🤖 The TALOS Framework
💬 ChatOps made easy
📖 About
With TalosBot, you can build operational bots without struggling with chat APIs or artificial intelligence.
Just focus on your skills —simple Python functions that return the message to send back.
The framework is designed to be:
- 🧩 Easy to use
- 🔧 Fully extensible
- 🚀 Production-ready
🧱 Components
A bot in Talos is composed of three main components:
- Channel: Handles messaging through a communication platform.
- Matcher: Matches an input sentence to an example sentence tied to a skill.
- Parser (optional): Extracts parameters from user input and passes them to the skill without needing to manually parse anything.
🧠 Built-in Models
Talos runs locally —no data is sent to third parties.
Out-of-the-box models include:
BertMatcher: Usessentence-transformersto perform cosine similarity.NERParser: Uses a spaCy pipeline with NER via the defaulten_core_web_lgmodel. You can replace it with a custom one using the CLI trainer (explained below).
🌐 Built-in Channels
Talos supports several channels, so you don’t have to deal with chat platform intricacies:
-
Slack:
Usesslack-boltwith slash commands and no public endpoint required.
Simply:- Create a new Slack App
- Add the
chat:writeOAuth scope - Enable Socket Mode
- Register a slash command (default:
/talos)
You’ll receive the app token and bot token, both required for the connection.
-
Telegram:
Create a bot via Telegram’s @BotFather, and get your bot token.
Plug it into Talos and you're ready to go.
🔄 Workflow Overview
- A user sends a sentence via a supported channel (e.g., a Telegram group).
- The bot matches the sentence against all registered examples.
- If a parser is configured, parameters are extracted into a dictionary.
- The matching skill is executed and the return message is sent back through the channel.
⚡ Quickstart
Install Talos with pip:
pip install talosbot
Then create a simple bot in bot.py:
from talosbot.matchers.bert import BertMatcher
from talosbot.parsers.ner import NERParser
from talosbot.channels.cli import CLIChannel
from talosbot.talos import Bot
channel = CLIChannel()
matcher = BertMatcher(acceptance_threshold=0.6)
parser = NERParser(getenv('MODEL_PATH', './ner_model'))
bot = Bot(matcher=matcher, parser=parser, channel=channel)
@bot.match('Execute the job XXX in the project some/repository', ('PROJECT', 'JOB'))
def check_pipeline(JOB, PROJECT):
return f"Checking pipeline {JOB} for project {PROJECT}..."
@bot.default_match()
def no_skill():
return 'No skill, my bad!'
if __name__ == '__main__':
bot.run()
This launches a CLI channel for quick local testing.
For the NER parser, you’ll need a trained model to detect your entities.
You can download a pre-trained one here.
🧪 Training a New NER Model
Train from a dataset:
talos trainer --trainingset data.json --output ner_model
Train from a specific spaCy model:
talos trainer --trainingset data.json --output ner_model/ --model en_core_web_lg
You’ll find data.json examples in the pretrained models repo.
📁 More Examples
Explore the examples directory in this repo to see how to use Talos in different setups and contexts.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file talosbot-0.2.0.tar.gz.
File metadata
- Download URL: talosbot-0.2.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b05dbf539be47277cf93fd394441b6d85171fefdf64ec135d8b830becc60115
|
|
| MD5 |
6ec07567a880de103f3756d7a74b8b9a
|
|
| BLAKE2b-256 |
203515e77ff7f80e70546eb7cc46c7b2fe3e597d3f5ded513f93749ff812c02a
|
File details
Details for the file talosbot-0.2.0-py3-none-any.whl.
File metadata
- Download URL: talosbot-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b48b87a5ef8ab90b17595302d8d7902d7e3decb42e17c217949791dc93b1c70
|
|
| MD5 |
c33cf83aa4959eae6f288e64ea66b54a
|
|
| BLAKE2b-256 |
671bd395858c181d69f1976604c21a7eadcd025f9f390cee465a145380a17cb7
|