Skip to content

allenday/botlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 27, 2024
e3839a1 · Dec 27, 2024

History

36 Commits
Dec 27, 2024
Dec 27, 2024
Dec 27, 2024
Dec 27, 2024
Dec 22, 2024
Dec 20, 2024
Dec 20, 2024
Dec 20, 2024
Dec 20, 2024

Repository files navigation

BotLab

A Telegram bot framework for experimenting with LLM agents. BotLab provides a flexible XML-based configuration system for defining agent behaviors, conversation momentum, and interaction patterns.

Features

  • XML-based agent configuration
  • Momentum-based conversation management
  • Topic-based filtering
  • Rate limiting and timing control
  • Conversation history tracking
  • DTD validation for configurations

Installation

pip install -e ".[dev]"  # Install with development dependencies
# or
pip install -e .         # Install only runtime dependencies

Configuration

  1. Create a .env file with your API keys:
ALLOWED_TOPIC_NAME=your_topic
ANTHROPIC_API_VERSION=2023-06-01
SPEAKER_MODEL=claude-3-sonnet-latest
INHIBITOR_MODEL=claude-3-haiku-latest
ANTHROPIC_API_KEY=your_key
TELEGRAM_TOKEN=your_token

SPEAKER_PROMPT_FILE=config/agents/odv.xml
INHIBITOR_PROMPT_FILE=config/agents/inhibitor.xml
  1. Configure your agents in config/agents/:
  • odv.xml - Main speaker agent configuration
  • inhibitor.xml - Conversation flow control agent
  • Additional agents as needed

Usage

  1. Start the bot:
python -m botlab.bot
  1. Add the bot to a Telegram group

  2. Create a topic named as specified in ALLOWED_TOPIC_NAME

  3. Interact with the bot in the designated topic

Development

Run tests:

pytest

Project Structure

botlab/
├── src/
│   └── botlab/
│       ├── __init__.py
│       ├── bot.py
│       └── xml_handler.py
├── config/
│   ├── agents/
│   │   ├── odv.xml
│   │   └── inhibitor.xml
│   └── dtd/
│       ├── agent.dtd
│       └── messages.dtd
├── tests/
│   ├── integration/
│   │   └── test_bot.py
│   └── unit/
│       └── test_xml_handler.py
├── setup.py
└── README.md

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages