Smart Bot Factory
Smart Bot Factory — это Python CLI и библиотека для создания Telegram AI-ботов с OpenAI, aiogram, персистентностью через Supabase, CRM-интеграциями и опциональными RAG-бэкендами.
Установка
Установите пакет из PyPI:
pip install smart-bot-factory
Опционально: для изоляции окружения сначала создайте и активируйте виртуальное окружение (python -m venv .venv и source .venv/bin/activate), затем выполните pip install.
Проект требует Python >= 3.10.
Быстрый старт
- Проверьте точку входа CLI:
sbf --help
- Создайте каркас бота:
sbf create clinic-bot
Команда создаст bots/clinic-bot/ с каркасом для prompt, message, test, file и .env.
-
Заполните обязательные значения в
bots/clinic-bot/.env, особенноTELEGRAM_BOT_TOKENиOPENAI_API_KEY. -
Запустите бота:
sbf run clinic-bot
Примеры использования
Управление проектами ботов
С помощью sbf CLI можно просматривать, копировать, диагностировать, тестировать и удалять проекты ботов:
sbf list
sbf copy clinic-bot clinic-bot-staging
sbf doctor clinic-bot
sbf test clinic-bot
sbf update
sbf env-sync clinic-bot
sbf rm clinic-bot-staging
Обновление CLI (sbf update)
Команда sbf update работает только в локальном проекте с существующим .venv и завершится с явной ошибкой, если .venv отсутствует.
sbf update
Регистрация бизнес-событий
Сгенерированные лаунчеры ботов используют BotBuilder и EventRouter, чтобы подключать пользовательские бизнес-действия, которые ассистент может вызывать из структурированных AI-метаданных:
from smart_bot_factory.creation import BotBuilder
from smart_bot_factory.message import send_message_by_human
from smart_bot_factory.router import EventRouter
event_router = EventRouter()
bot_builder = BotBuilder()
@event_router.event_handler(once_only=True)
async def collect_contact(user_id: int, contact_data: str) -> dict[str, str]:
await send_message_by_human(
user_id=user_id,
message_text=f"Thanks, your contact is saved: {contact_data}",
)
return {"status": "success", "contact": contact_data}
bot_builder.register_routers(event_router)
Документация
- Начало работы:
docs/GETTING-STARTED.md - Архитектура:
docs/ARCHITECTURE.md - Конфигурация:
docs/CONFIGURATION.md - Тестирование:
docs/TESTING.md - Процесс разработки:
docs/DEVELOPMENT.md - Деплой:
docs/DEPLOYMENT.md - Устранение неполадок:
docs/troubleshooting.md
Лицензия
Проект распространяется по лицензии MIT License.
Metadata
Release files for smart-bot-factory 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smart_bot_factory-2.0.1.tar.gz | 804.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smart_bot_factory-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / smart_bot_factory-2.0.1.tar.gz
| Download URL | smart_bot_factory-2.0.1.tar.gz |
|---|---|
| Size | 804.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d47b9dca06cfa4089dfbb34b02af4442f75b9a3bbd933f8b9ce821615e282487
|
|
BLAKE2b-256 checksum How to use checksums |
6376724e42762548e04b31a88ad336b3fd64d5907e2935b531a3db102ed59ec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logRelease files / smart_bot_factory-2.0.1-py3-none-any.whl
| Download URL | smart_bot_factory-2.0.1-py3-none-any.whl |
|---|---|
| Size | 393.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3306875c873830cde8cfba70f29e1f18dce7f262437d4fe3d12ef61ce9b33959
|
|
BLAKE2b-256 checksum How to use checksums |
93dcdf48c515bfc4c485010316a7401a3e5ea10b91124b93513b7aa0268c5548
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency log