Skip to main content

Библиотека для создания умных чат-ботов

Project description

Smart Bot Factory

Библиотека для создания умных чат-ботов с использованием OpenAI, Telegram и Supabase.

Установка

pip install smart-bot-factory

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

  1. Создайте нового бота:
sbf create my-bot
  1. Настройте конфигурацию в bots/my-bot/.env

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

sbf run my-bot

Возможности

  • 🤖 Интеграция с OpenAI GPT для умных ответов
  • 📱 Поддержка Telegram Bot API через aiogram
  • 💾 Хранение данных в Supabase
  • 🔄 Система событий и обработчиков
  • ⏰ Планировщик задач
  • 🧪 Встроенная система тестирования
  • 📝 Управление промптами
  • 🛠️ Удобный CLI интерфейс

CLI команды

# Создать нового бота
sbf create my-bot

# Запустить бота
sbf run my-bot

# Показать список ботов
sbf list

# Управление промптами
sbf prompts my-bot --list
sbf prompts my-bot --edit welcome_message
sbf prompts my-bot --add new_prompt

# Запустить тесты
sbf test my-bot

Пример использования

from smart_bot_factory import BotBuilder, event_handler, schedule_task

# Обработчик события
@event_handler("book_appointment", "Запись на прием")
async def handle_booking(user_id: int, event_data: dict):
    # Логика обработки записи на прием
    return {"status": "success"}

# Запланированная задача
@schedule_task("send_reminder", "Отправка напоминания")
async def send_reminder(user_id: int, message: str):
    # Логика отправки напоминания
    return {"status": "sent"}

# Запуск бота
async def main():
    bot = BotBuilder("my-bot")
    await bot.build()
    await bot.start()

if __name__ == "__main__":
    asyncio.run(main())

Требования

  • Python 3.9+
  • OpenAI API ключ
  • Telegram Bot Token
  • Supabase проект

Лицензия

MIT

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

smart_bot_factory-0.1.4.tar.gz (13.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_bot_factory-0.1.4-py3-none-any.whl (7.0 MB view details)

Uploaded Python 3

File details

Details for the file smart_bot_factory-0.1.4.tar.gz.

File metadata

  • Download URL: smart_bot_factory-0.1.4.tar.gz
  • Upload date:
  • Size: 13.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for smart_bot_factory-0.1.4.tar.gz
Algorithm Hash digest
SHA256 11228a36de68e163b8f6e1b764b182ec0456b1f559dc2cc3d295280507f47946
MD5 eadfa938eedbacce48274115a2d2076b
BLAKE2b-256 589d9cec89c4427e42ac834462eef63fbed6a886ad1d89a470e359a4dc53f9c7

See more details on using hashes here.

File details

Details for the file smart_bot_factory-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_bot_factory-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6b845b23912f8ed59ac6e2d737187e5429672850570ddd65c032d118a7b1df54
MD5 ceb2135a8accdac21ab46542b53d6823
BLAKE2b-256 c5fc5de53b578504fae6e34f1af8b560c675188ebae0c151f3a845fdb7c6ff29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page