smart-bot-factory 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of smart-bot-factory might be problematic. Click here for more details.
- smart_bot_factory-0.1.3/.github/ISSUE_TEMPLATE//342/234/250-/320/267/320/260/320/277/321/200/320/276/321/201-/321/204/321/203/320/275/320/272/321/206/320/270/320/270.md +20 -0
- smart_bot_factory-0.1.3/.github/ISSUE_TEMPLATE//360/237/220/233-/320/261/320/260/320/263-/321/200/320/265/320/277/320/276/321/200/321/202.md +26 -0
- smart_bot_factory-0.1.3/.github/workflows/ci.yml +59 -0
- smart_bot_factory-0.1.3/.github/workflows/publish-private.yml +34 -0
- smart_bot_factory-0.1.3/.github/workflows/publish.yml +31 -0
- smart_bot_factory-0.1.3/.python-version +1 -0
- smart_bot_factory-0.1.3/Dockerfile +36 -0
- smart_bot_factory-0.1.3/LICENSE +24 -0
- smart_bot_factory-0.1.3/PKG-INFO +126 -0
- smart_bot_factory-0.1.3/README.md +93 -0
- smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_140730.txt +209 -0
- smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_141530.txt +178 -0
- smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_143539.txt +180 -0
- smart_bot_factory-0.1.3/bots/new-valera/tests/final_scenarios.yaml +80 -0
- smart_bot_factory-0.1.3/create_bot.py +294 -0
- smart_bot_factory-0.1.3/create_tag.sh +143 -0
- smart_bot_factory-0.1.3/docker-compose.yml +18 -0
- smart_bot_factory-0.1.3/env.example +40 -0
- smart_bot_factory-0.1.3/main.py +120 -0
- smart_bot_factory-0.1.3/new-valera.py +71 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3}/pyproject.toml +2 -2
- smart_bot_factory-0.1.3/requirements.txt +8 -0
- smart_bot_factory-0.1.3/save_backup.sh +3 -0
- smart_bot_factory-0.1.3/save_fixes.sh +3 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/__init__.py +0 -2
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +16 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +582 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +66 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +212 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +28 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +8 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +818 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +32 -0
- smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +35 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/integrations/__init__.py +1 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/setup_checker.py +476 -476
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/uv.lock +1 -1
- smart_bot_factory-0.1.3/system_prompt_example.txt +84 -0
- smart_bot_factory-0.1.3/test_library_integration.py +109 -0
- smart_bot_factory-0.1.3/utm_link_generator.py +106 -0
- smart_bot_factory-0.1.3/uv.lock +1589 -0
- smart_bot_factory-0.1.2/PKG-INFO +0 -31
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3}/.gitignore +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/bots/new-valera}/prompts/1sales_context.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-helper → smart_bot_factory-0.1.3/bots/new-valera}/prompts/2product_info.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-helper → smart_bot_factory-0.1.3/bots/new-valera}/prompts/3objection_handling.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/bots/new-valera}/prompts/final_instructions.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-helper → smart_bot_factory-0.1.3/bots/new-valera}/prompts/help_message.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/bots/new-valera}/prompts/welcome_message.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/__init__.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/admin_logic.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/admin_manager.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/admin_migration.sql +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/admin_tester.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/admin/timeout_checker.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/analytics/__init__.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/analytics/analytics_manager.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/cli.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/config.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/env_example.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/prompts/1sales_context.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper}/prompts/2product_info.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper}/prompts/3objection_handling.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/prompts/final_instructions.txt +0 -0
- {smart_bot_factory-0.1.2/configs/growthmed-october-24 → smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper}/prompts/help_message.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/prompts/welcome_message.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/welcome_file/welcome_file_msg.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-helper/welcome_file//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf" +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-october-24/tests/quick_scenarios.yaml +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-october-24/tests/realistic_scenarios.yaml +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-october-24/tests/scenario_examples.yaml +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/configs/growthmed-october-24/welcome_file//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf" +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/__init__.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/bot_utils.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/conversation_manager.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/decorators.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/message_sender.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/core/states.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/creation/__init__.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/creation/bot_builder.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/creation/bot_testing.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/database/database_structure.sql +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/database/schema.sql +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/handlers/handlers.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/integrations/openai_client.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/integrations/supabase_client.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/utils/__init__.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/utils/debug_routing.py +0 -0
- {smart_bot_factory-0.1.2 → smart_bot_factory-0.1.3/smart_bot_factory}/utils/prompt_loader.py +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "✨ Запрос функции"
|
|
3
|
+
about: Предложить новую функцию или улучшение
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🎯 Описание функции
|
|
11
|
+
Что вы хотите добавить/улучшить?
|
|
12
|
+
|
|
13
|
+
## 💡 Мотивация
|
|
14
|
+
Какую проблему это решит?
|
|
15
|
+
|
|
16
|
+
## 📋 Детали реализации
|
|
17
|
+
Как вы видите это решение?
|
|
18
|
+
|
|
19
|
+
## 🔄 Альтернативы
|
|
20
|
+
Рассматривали ли другие варианты?
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "\U0001F41B Баг репорт"
|
|
3
|
+
about: Сообщить об ошибке
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🐛 Описание проблемы
|
|
11
|
+
Опишите что пошло не так
|
|
12
|
+
|
|
13
|
+
## 🔄 Как воспроизвести
|
|
14
|
+
1. Пользователь написал...
|
|
15
|
+
2. Бот ответил...
|
|
16
|
+
3. Произошла ошибка...
|
|
17
|
+
|
|
18
|
+
## ✅ Ожидаемое поведение
|
|
19
|
+
Что должно было произойти
|
|
20
|
+
|
|
21
|
+
## 📱 Окружение
|
|
22
|
+
- **Bot ID:** (например, growthmed-october-24)
|
|
23
|
+
- **Время:** (когда произошло)
|
|
24
|
+
- **User ID:** (если известен)
|
|
25
|
+
|
|
26
|
+
## 📋 Логи
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -e .
|
|
28
|
+
|
|
29
|
+
- name: Run tests
|
|
30
|
+
run: |
|
|
31
|
+
pytest --cov=smart_bot_factory tests/
|
|
32
|
+
|
|
33
|
+
- name: Upload coverage to Codecov
|
|
34
|
+
uses: codecov/codecov-action@v4
|
|
35
|
+
with:
|
|
36
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
37
|
+
fail_ci_if_error: true
|
|
38
|
+
|
|
39
|
+
lint:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
|
|
45
|
+
- name: Set up Python
|
|
46
|
+
uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
|
|
50
|
+
- name: Install dependencies
|
|
51
|
+
run: |
|
|
52
|
+
python -m pip install --upgrade pip
|
|
53
|
+
pip install flake8 black isort
|
|
54
|
+
|
|
55
|
+
- name: Check code style
|
|
56
|
+
run: |
|
|
57
|
+
flake8 src/smart_bot_factory tests
|
|
58
|
+
black --check src/smart_bot_factory tests
|
|
59
|
+
isort --check-only src/smart_bot_factory tests
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Publish to GitHub Packages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
packages: write
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v4
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.9"
|
|
21
|
+
|
|
22
|
+
- name: Install build tools
|
|
23
|
+
run: |
|
|
24
|
+
python -m pip install --upgrade pip
|
|
25
|
+
pip install build twine
|
|
26
|
+
|
|
27
|
+
- name: Build package
|
|
28
|
+
run: python -m build
|
|
29
|
+
|
|
30
|
+
- name: Publish to GitHub Packages
|
|
31
|
+
env:
|
|
32
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
33
|
+
run: |
|
|
34
|
+
python -m twine upload --repository-url https://maven.pkg.github.com/${{ github.repository }} dist/*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Set up Python
|
|
14
|
+
uses: actions/setup-python@v4
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.9"
|
|
17
|
+
|
|
18
|
+
- name: Install build tools
|
|
19
|
+
run: |
|
|
20
|
+
python -m pip install --upgrade pip
|
|
21
|
+
pip install build twine
|
|
22
|
+
|
|
23
|
+
- name: Build package
|
|
24
|
+
run: python -m build
|
|
25
|
+
|
|
26
|
+
- name: Publish to PyPI
|
|
27
|
+
env:
|
|
28
|
+
TWINE_USERNAME: __token__
|
|
29
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
30
|
+
run: |
|
|
31
|
+
twine upload dist/*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Базовый образ Python
|
|
2
|
+
FROM python:3.11-slim
|
|
3
|
+
|
|
4
|
+
# Установка системных зависимостей
|
|
5
|
+
RUN apt-get update && apt-get install -y \
|
|
6
|
+
gcc \
|
|
7
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
# Создание рабочей директории
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
|
|
12
|
+
# Копирование файлов зависимостей
|
|
13
|
+
COPY requirements.txt .
|
|
14
|
+
|
|
15
|
+
# Установка Python зависимостей
|
|
16
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
17
|
+
|
|
18
|
+
# Копирование исходного кода
|
|
19
|
+
COPY . .
|
|
20
|
+
|
|
21
|
+
# Создание пользователя для запуска приложения
|
|
22
|
+
RUN useradd --create-home --shell /bin/bash bot_user && \
|
|
23
|
+
chown -R bot_user:bot_user /app
|
|
24
|
+
USER bot_user
|
|
25
|
+
|
|
26
|
+
# Установка переменных окружения
|
|
27
|
+
ENV PYTHONPATH=/app
|
|
28
|
+
ENV PYTHONUNBUFFERED=1
|
|
29
|
+
|
|
30
|
+
# Команда запуска
|
|
31
|
+
CMD ["python", "main.py"]
|
|
32
|
+
|
|
33
|
+
# Метаданные
|
|
34
|
+
LABEL maintainer="your-email@example.com"
|
|
35
|
+
LABEL description="Telegram Sales Bot with AI"
|
|
36
|
+
LABEL version="1.0.0"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kopatych
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: smart-bot-factory
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Библиотека для создания умных чат-ботов
|
|
5
|
+
Author-email: Kopatych <kopatych@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: chatbot,cli,openai,supabase,telegram
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Framework :: AsyncIO
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Communications :: Chat
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: aiofiles>=23.0.0
|
|
24
|
+
Requires-Dist: aiogram>=3.4.1
|
|
25
|
+
Requires-Dist: click>=8.0.0
|
|
26
|
+
Requires-Dist: openai>=1.12.0
|
|
27
|
+
Requires-Dist: project-root-finder>=1.9
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
29
|
+
Requires-Dist: pytz>=2023.3
|
|
30
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
31
|
+
Requires-Dist: supabase>=2.3.4
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Smart Bot Factory
|
|
35
|
+
|
|
36
|
+
Библиотека для создания умных чат-ботов с использованием OpenAI, Telegram и Supabase.
|
|
37
|
+
|
|
38
|
+
## Установка
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install smart-bot-factory
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Быстрый старт
|
|
45
|
+
|
|
46
|
+
1. Создайте нового бота:
|
|
47
|
+
```bash
|
|
48
|
+
sbf create my-bot
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
2. Настройте конфигурацию в `bots/my-bot/.env`
|
|
52
|
+
|
|
53
|
+
3. Запустите бота:
|
|
54
|
+
```bash
|
|
55
|
+
sbf run my-bot
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Возможности
|
|
59
|
+
|
|
60
|
+
- 🤖 Интеграция с OpenAI GPT для умных ответов
|
|
61
|
+
- 📱 Поддержка Telegram Bot API через aiogram
|
|
62
|
+
- 💾 Хранение данных в Supabase
|
|
63
|
+
- 🔄 Система событий и обработчиков
|
|
64
|
+
- ⏰ Планировщик задач
|
|
65
|
+
- 🧪 Встроенная система тестирования
|
|
66
|
+
- 📝 Управление промптами
|
|
67
|
+
- 🛠️ Удобный CLI интерфейс
|
|
68
|
+
|
|
69
|
+
## CLI команды
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Создать нового бота
|
|
73
|
+
sbf create my-bot
|
|
74
|
+
|
|
75
|
+
# Запустить бота
|
|
76
|
+
sbf run my-bot
|
|
77
|
+
|
|
78
|
+
# Показать список ботов
|
|
79
|
+
sbf list
|
|
80
|
+
|
|
81
|
+
# Управление промптами
|
|
82
|
+
sbf prompts my-bot --list
|
|
83
|
+
sbf prompts my-bot --edit welcome_message
|
|
84
|
+
sbf prompts my-bot --add new_prompt
|
|
85
|
+
|
|
86
|
+
# Запустить тесты
|
|
87
|
+
sbf test my-bot
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Пример использования
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from smart_bot_factory import BotBuilder, event_handler, schedule_task
|
|
94
|
+
|
|
95
|
+
# Обработчик события
|
|
96
|
+
@event_handler("book_appointment", "Запись на прием")
|
|
97
|
+
async def handle_booking(user_id: int, event_data: dict):
|
|
98
|
+
# Логика обработки записи на прием
|
|
99
|
+
return {"status": "success"}
|
|
100
|
+
|
|
101
|
+
# Запланированная задача
|
|
102
|
+
@schedule_task("send_reminder", "Отправка напоминания")
|
|
103
|
+
async def send_reminder(user_id: int, message: str):
|
|
104
|
+
# Логика отправки напоминания
|
|
105
|
+
return {"status": "sent"}
|
|
106
|
+
|
|
107
|
+
# Запуск бота
|
|
108
|
+
async def main():
|
|
109
|
+
bot = BotBuilder("my-bot")
|
|
110
|
+
await bot.build()
|
|
111
|
+
await bot.start()
|
|
112
|
+
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
asyncio.run(main())
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Требования
|
|
118
|
+
|
|
119
|
+
- Python 3.9+
|
|
120
|
+
- OpenAI API ключ
|
|
121
|
+
- Telegram Bot Token
|
|
122
|
+
- Supabase проект
|
|
123
|
+
|
|
124
|
+
## Лицензия
|
|
125
|
+
|
|
126
|
+
MIT
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Smart Bot Factory
|
|
2
|
+
|
|
3
|
+
Библиотека для создания умных чат-ботов с использованием OpenAI, Telegram и Supabase.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install smart-bot-factory
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Быстрый старт
|
|
12
|
+
|
|
13
|
+
1. Создайте нового бота:
|
|
14
|
+
```bash
|
|
15
|
+
sbf create my-bot
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Настройте конфигурацию в `bots/my-bot/.env`
|
|
19
|
+
|
|
20
|
+
3. Запустите бота:
|
|
21
|
+
```bash
|
|
22
|
+
sbf run my-bot
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Возможности
|
|
26
|
+
|
|
27
|
+
- 🤖 Интеграция с OpenAI GPT для умных ответов
|
|
28
|
+
- 📱 Поддержка Telegram Bot API через aiogram
|
|
29
|
+
- 💾 Хранение данных в Supabase
|
|
30
|
+
- 🔄 Система событий и обработчиков
|
|
31
|
+
- ⏰ Планировщик задач
|
|
32
|
+
- 🧪 Встроенная система тестирования
|
|
33
|
+
- 📝 Управление промптами
|
|
34
|
+
- 🛠️ Удобный CLI интерфейс
|
|
35
|
+
|
|
36
|
+
## CLI команды
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Создать нового бота
|
|
40
|
+
sbf create my-bot
|
|
41
|
+
|
|
42
|
+
# Запустить бота
|
|
43
|
+
sbf run my-bot
|
|
44
|
+
|
|
45
|
+
# Показать список ботов
|
|
46
|
+
sbf list
|
|
47
|
+
|
|
48
|
+
# Управление промптами
|
|
49
|
+
sbf prompts my-bot --list
|
|
50
|
+
sbf prompts my-bot --edit welcome_message
|
|
51
|
+
sbf prompts my-bot --add new_prompt
|
|
52
|
+
|
|
53
|
+
# Запустить тесты
|
|
54
|
+
sbf test my-bot
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Пример использования
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from smart_bot_factory import BotBuilder, event_handler, schedule_task
|
|
61
|
+
|
|
62
|
+
# Обработчик события
|
|
63
|
+
@event_handler("book_appointment", "Запись на прием")
|
|
64
|
+
async def handle_booking(user_id: int, event_data: dict):
|
|
65
|
+
# Логика обработки записи на прием
|
|
66
|
+
return {"status": "success"}
|
|
67
|
+
|
|
68
|
+
# Запланированная задача
|
|
69
|
+
@schedule_task("send_reminder", "Отправка напоминания")
|
|
70
|
+
async def send_reminder(user_id: int, message: str):
|
|
71
|
+
# Логика отправки напоминания
|
|
72
|
+
return {"status": "sent"}
|
|
73
|
+
|
|
74
|
+
# Запуск бота
|
|
75
|
+
async def main():
|
|
76
|
+
bot = BotBuilder("my-bot")
|
|
77
|
+
await bot.build()
|
|
78
|
+
await bot.start()
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
asyncio.run(main())
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Требования
|
|
85
|
+
|
|
86
|
+
- Python 3.9+
|
|
87
|
+
- OpenAI API ключ
|
|
88
|
+
- Telegram Bot Token
|
|
89
|
+
- Supabase проект
|
|
90
|
+
|
|
91
|
+
## Лицензия
|
|
92
|
+
|
|
93
|
+
MIT
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
ОТЧЕТ ТЕСТИРОВАНИЯ: NEW-VALERA
|
|
2
|
+
Время: 2025-09-30 14:07:30
|
|
3
|
+
Сценариев: 8
|
|
4
|
+
|
|
5
|
+
УСПЕШНОСТЬ СЦЕНАРИЕВ: 0.0% (0/8)
|
|
6
|
+
УСПЕШНОСТЬ ШАГОВ: 0.0% (0/16)
|
|
7
|
+
|
|
8
|
+
═══════════════════════════════════════════════════════════════
|
|
9
|
+
СПИСОК ОШИБОК:
|
|
10
|
+
═══════════════════════════════════════════════════════════════
|
|
11
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Простое знакомство и вопрос о цене
|
|
12
|
+
СТАТУС: 0/2 шагов пройдено
|
|
13
|
+
|
|
14
|
+
ШАГ 1 ❌:
|
|
15
|
+
Ввод: "Здравствуйте"
|
|
16
|
+
Ожидаемые: ['здравствуйте', 'рад']
|
|
17
|
+
Запрещенные: ['до свидания']
|
|
18
|
+
|
|
19
|
+
Полный ответ бота:
|
|
20
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
21
|
+
|
|
22
|
+
❌ НЕ НАЙДЕНЫ: здравствуйте, рад
|
|
23
|
+
|
|
24
|
+
ШАГ 2 ❌:
|
|
25
|
+
Ввод: "Сколько стоит участие?"
|
|
26
|
+
Ожидаемые: ['стоимость', 'рубл']
|
|
27
|
+
Запрещенные: ['бесплатно']
|
|
28
|
+
|
|
29
|
+
Полный ответ бота:
|
|
30
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
31
|
+
|
|
32
|
+
❌ НЕ НАЙДЕНЫ: стоимость, рубл
|
|
33
|
+
|
|
34
|
+
-------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Врач интересуется развитием
|
|
37
|
+
СТАТУС: 0/3 шагов пройдено
|
|
38
|
+
|
|
39
|
+
ШАГ 1 ❌:
|
|
40
|
+
Ввод: "Привет, я врач"
|
|
41
|
+
Ожидаемые: ['привет', 'врач']
|
|
42
|
+
Запрещенные: ['не для врачей']
|
|
43
|
+
|
|
44
|
+
Полный ответ бота:
|
|
45
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
46
|
+
|
|
47
|
+
❌ НЕ НАЙДЕНЫ: привет, врач
|
|
48
|
+
|
|
49
|
+
ШАГ 2 ❌:
|
|
50
|
+
Ввод: "Хочу развиваться в медицинском бизнесе"
|
|
51
|
+
Ожидаемые: ['развива', 'бизнес']
|
|
52
|
+
Запрещенные: ['не стоит']
|
|
53
|
+
|
|
54
|
+
Полный ответ бота:
|
|
55
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
56
|
+
|
|
57
|
+
❌ НЕ НАЙДЕНЫ: развива, бизнес
|
|
58
|
+
|
|
59
|
+
ШАГ 3 ❌:
|
|
60
|
+
Ввод: "Что даст мне конференция?"
|
|
61
|
+
Ожидаемые: ['конференция', 'получите']
|
|
62
|
+
Запрещенные: ['ничего не даст']
|
|
63
|
+
|
|
64
|
+
Полный ответ бота:
|
|
65
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
66
|
+
|
|
67
|
+
❌ НЕ НАЙДЕНЫ: конференция, получите
|
|
68
|
+
|
|
69
|
+
-------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Директор клиники с проблемами
|
|
72
|
+
СТАТУС: 0/2 шагов пройдено
|
|
73
|
+
|
|
74
|
+
ШАГ 1 ❌:
|
|
75
|
+
Ввод: "Добрый день, я директор клиники"
|
|
76
|
+
Ожидаемые: ['добрый день', 'директор']
|
|
77
|
+
Запрещенные: ['не интересно']
|
|
78
|
+
|
|
79
|
+
Полный ответ бота:
|
|
80
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
81
|
+
|
|
82
|
+
❌ НЕ НАЙДЕНЫ: добрый день, директор
|
|
83
|
+
|
|
84
|
+
ШАГ 2 ❌:
|
|
85
|
+
Ввод: "У нас падает прибыль"
|
|
86
|
+
Ожидаемые: ['понимаю', 'проблем']
|
|
87
|
+
Запрещенные: ['не помогу']
|
|
88
|
+
|
|
89
|
+
Полный ответ бота:
|
|
90
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
91
|
+
|
|
92
|
+
❌ НЕ НАЙДЕНЫ: понимаю, проблем
|
|
93
|
+
|
|
94
|
+
-------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Быстрая регистрация на мероприятие
|
|
97
|
+
СТАТУС: 0/1 шагов пройдено
|
|
98
|
+
|
|
99
|
+
ШАГ 1 ❌:
|
|
100
|
+
Ввод: "Можно быстро зарегистрироваться?"
|
|
101
|
+
Ожидаемые: ['регистрац', 'можно']
|
|
102
|
+
Запрещенные: ['нельзя', 'сложно']
|
|
103
|
+
|
|
104
|
+
Полный ответ бота:
|
|
105
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
106
|
+
|
|
107
|
+
❌ НЕ НАЙДЕНЫ: регистрац, можно
|
|
108
|
+
|
|
109
|
+
-------------------------------------------------------------------
|
|
110
|
+
|
|
111
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Стоматолог планирует клинику
|
|
112
|
+
СТАТУС: 0/2 шагов пройдено
|
|
113
|
+
|
|
114
|
+
ШАГ 1 ❌:
|
|
115
|
+
Ввод: "Я стоматолог, планирую свою клинику"
|
|
116
|
+
Ожидаемые: ['стоматолог', 'клинику']
|
|
117
|
+
Запрещенные: ['не ваша сфера']
|
|
118
|
+
|
|
119
|
+
Полный ответ бота:
|
|
120
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
121
|
+
|
|
122
|
+
❌ НЕ НАЙДЕНЫ: стоматолог, клинику
|
|
123
|
+
|
|
124
|
+
ШАГ 2 ❌:
|
|
125
|
+
Ввод: "Боюсь не справиться с управлением"
|
|
126
|
+
Ожидаемые: ['поможем', 'управлени']
|
|
127
|
+
Запрещенные: ['сложно будет']
|
|
128
|
+
|
|
129
|
+
Полный ответ бота:
|
|
130
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
131
|
+
|
|
132
|
+
❌ НЕ НАЙДЕНЫ: поможем, управлени
|
|
133
|
+
|
|
134
|
+
-------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Проверка IT направления
|
|
137
|
+
СТАТУС: 0/2 шагов пройдено
|
|
138
|
+
|
|
139
|
+
ШАГ 1 ❌:
|
|
140
|
+
Ввод: "Работаю с технологиями в медицине"
|
|
141
|
+
Ожидаемые: ['технологи', 'медицин']
|
|
142
|
+
Запрещенные: ['не ваша тема']
|
|
143
|
+
|
|
144
|
+
Полный ответ бота:
|
|
145
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
146
|
+
|
|
147
|
+
❌ НЕ НАЙДЕНЫ: технологи, медицин
|
|
148
|
+
|
|
149
|
+
ШАГ 2 ❌:
|
|
150
|
+
Ввод: "Интересуют цифровые решения"
|
|
151
|
+
Ожидаемые: ['цифров', 'решени']
|
|
152
|
+
Запрещенные: ['только бизнес']
|
|
153
|
+
|
|
154
|
+
Полный ответ бота:
|
|
155
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
156
|
+
|
|
157
|
+
❌ НЕ НАЙДЕНЫ: цифров, решени
|
|
158
|
+
|
|
159
|
+
-------------------------------------------------------------------
|
|
160
|
+
|
|
161
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Скептичный клиент требует доказательств
|
|
162
|
+
СТАТУС: 0/2 шагов пройдено
|
|
163
|
+
|
|
164
|
+
ШАГ 1 ❌:
|
|
165
|
+
Ввод: "Не очень верю в такие мероприятия"
|
|
166
|
+
Ожидаемые: ['понимаю', 'скептицизм']
|
|
167
|
+
Запрещенные: ['согласен', 'действительно']
|
|
168
|
+
|
|
169
|
+
Полный ответ бота:
|
|
170
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
171
|
+
|
|
172
|
+
❌ НЕ НАЙДЕНЫ: понимаю, скептицизм
|
|
173
|
+
|
|
174
|
+
ШАГ 2 ❌:
|
|
175
|
+
Ввод: "Докажите, что это не пустая трата времени"
|
|
176
|
+
Ожидаемые: ['докаж', 'результат']
|
|
177
|
+
Запрещенные: ['пустая трата', 'согласен']
|
|
178
|
+
|
|
179
|
+
Полный ответ бота:
|
|
180
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
181
|
+
|
|
182
|
+
❌ НЕ НАЙДЕНЫ: докаж, результат
|
|
183
|
+
|
|
184
|
+
-------------------------------------------------------------------
|
|
185
|
+
|
|
186
|
+
ФАЙЛ: final_scenarios.yaml | СЦЕНАРИЙ: Иностранный участник
|
|
187
|
+
СТАТУС: 0/2 шагов пройдено
|
|
188
|
+
|
|
189
|
+
ШАГ 1 ❌:
|
|
190
|
+
Ввод: "Hello, I work in Moscow medical center"
|
|
191
|
+
Ожидаемые: ['hello', 'moscow', 'medical']
|
|
192
|
+
Запрещенные: ['только на русском']
|
|
193
|
+
|
|
194
|
+
Полный ответ бота:
|
|
195
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
196
|
+
|
|
197
|
+
❌ НЕ НАЙДЕНЫ: hello, moscow, medical
|
|
198
|
+
|
|
199
|
+
ШАГ 2 ❌:
|
|
200
|
+
Ввод: "Can I participate in Russian conference?"
|
|
201
|
+
Ожидаемые: ['russian', 'participate']
|
|
202
|
+
Запрещенные: ['impossible']
|
|
203
|
+
|
|
204
|
+
Полный ответ бота:
|
|
205
|
+
"ОШИБКА: Файл промпта не найден: C:\Users\kopatych\Projects\chat-bots\bots\new-valera\prompts\system_prompt.txt"
|
|
206
|
+
|
|
207
|
+
❌ НЕ НАЙДЕНЫ: russian, participate
|
|
208
|
+
|
|
209
|
+
-------------------------------------------------------------------
|