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.3.tar.gz (7.2 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.3-py3-none-any.whl (7.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smart_bot_factory-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 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.3.tar.gz
Algorithm Hash digest
SHA256 7cc9f9b9732883c4652a6ca63fca667c96abedb70d5efc47c19642599b69a121
MD5 743218b144f7921f3aef4338d6203f22
BLAKE2b-256 e1bb20f382314d15fc7557fc9766c77e4a4b5d3033d38819cf3a2164dfb4cbcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for smart_bot_factory-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 df021351cff1dbe51002c0a93d1319c6b034d0120cf4bfbd2fead7179d231ec5
MD5 dc4405e40e1d67e13a747ff716f0d715
BLAKE2b-256 8e9772d41ba785cb0cae5568c897f49a6d2a2f01eb274199b9eb0bd58abaa5f6

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