Skip to main content

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.

Быстрый старт

  1. Проверьте точку входа CLI:
sbf --help
  1. Создайте каркас бота:
sbf create clinic-bot

Команда создаст bots/clinic-bot/ с каркасом для prompt, message, test, file и .env.

  1. Заполните обязательные значения в bots/clinic-bot/.env, особенно TELEGRAM_BOT_TOKEN и OPENAI_API_KEY.

  2. Запустите бота:

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)

Source distribution for smart-bot-factory 2.0.1
File Size Uploaded
smart_bot_factory-2.0.1.tar.gz 804.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smart-bot-factory 2.0.1
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

1.1.63

2 release files

1.1.62

2 release files

1.1.61

2 release files

1.1.60

2 release files

1.1.59

2 release files

1.1.58

2 release files

1.1.57

2 release files

1.1.56

2 release files

1.1.55

2 release files

1.1.54

2 release files

1.1.53

2 release files

1.1.52

2 release files

1.1.51

2 release files

1.1.50

2 release files

1.1.48

2 release files

1.1.47

2 release files

1.1.46

2 release files

1.1.45

2 release files

1.1.44

2 release files

1.1.43

2 release files

1.1.42

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.11

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page