smart-bot-factory 0.1.0__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.0/.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.0/.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.0/.github/workflows/ci.yml +59 -0
- smart_bot_factory-0.1.0/.github/workflows/publish-private.yml +34 -0
- smart_bot_factory-0.1.0/.github/workflows/publish.yml +31 -0
- smart_bot_factory-0.1.0/.gitignore +214 -0
- smart_bot_factory-0.1.0/.python-version +1 -0
- smart_bot_factory-0.1.0/CLI_README.md +170 -0
- smart_bot_factory-0.1.0/Dockerfile +36 -0
- smart_bot_factory-0.1.0/LICENSE +21 -0
- smart_bot_factory-0.1.0/PKG-INFO +125 -0
- smart_bot_factory-0.1.0/README.md +93 -0
- smart_bot_factory-0.1.0/README_SMART_BOT_FACTORY.md +216 -0
- smart_bot_factory-0.1.0/admin_logic.py +408 -0
- smart_bot_factory-0.1.0/admin_manager.py +141 -0
- smart_bot_factory-0.1.0/admin_migration.sql +136 -0
- smart_bot_factory-0.1.0/admin_test.py +490 -0
- smart_bot_factory-0.1.0/analytics_manager.py +359 -0
- smart_bot_factory-0.1.0/bot_testing.py +912 -0
- smart_bot_factory-0.1.0/bot_utils.py +666 -0
- smart_bot_factory-0.1.0/check_timeouts.py +306 -0
- smart_bot_factory-0.1.0/config.py +235 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/env_example.txt +1 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/1sales_context.txt +9 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/2product_info.txt +582 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/3objection_handling.txt +66 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/final_instructions.txt +232 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/help_message.txt +28 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/prompts/welcome_message.txt +7 -0
- smart_bot_factory-0.1.0/configs/growthmed-helper/welcome_file/welcome_file_msg.txt +16 -0
- smart_bot_factory-0.1.0/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.0/configs/growthmed-october-24/prompts/1sales_context.txt +16 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/prompts/2product_info.txt +582 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/prompts/3objection_handling.txt +66 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/prompts/final_instructions.txt +212 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/prompts/help_message.txt +28 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/prompts/welcome_message.txt +8 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/challenging_scenarios.yaml +108 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/final_scenarios.yaml +80 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/fixes_elina.yaml +14 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/quick_scenarios.yaml +66 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/realistic_scenarios.yaml +108 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/tests/scenario_examples.yaml +46 -0
- smart_bot_factory-0.1.0/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +16 -0
- smart_bot_factory-0.1.0/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.0/configs/test-bot/env_example.txt +1 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/1sales_context.txt +9 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/2product_info.txt +582 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/3objection_handling.txt +66 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/final_instructions.txt +232 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/help_message.txt +28 -0
- smart_bot_factory-0.1.0/configs/test-bot/prompts/welcome_message.txt +7 -0
- smart_bot_factory-0.1.0/configs/test-bot/welcome_file/welcome_file_msg.txt +16 -0
- smart_bot_factory-0.1.0/configs/test-bot/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.0/configs/valera/files//320/265/321/211/320/265_/320/272/320/276/321/202.jpg +0 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/1sales_context.txt +9 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/2product_info.txt +582 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/3objection_handling.txt +66 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/final_instructions.txt +216 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/help_message.txt +28 -0
- smart_bot_factory-0.1.0/configs/valera/prompts/welcome_message.txt +9 -0
- smart_bot_factory-0.1.0/configs/valera/tests/challenging_scenarios.yaml +108 -0
- smart_bot_factory-0.1.0/configs/valera/tests/final_scenarios.yaml +168 -0
- smart_bot_factory-0.1.0/configs/valera/welcome_file/welcome_file_msg.txt +12 -0
- smart_bot_factory-0.1.0/configs/valera/welcome_file//320/247/320/265/320/272-/320/273/320/270/321/201/321/202 /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.0/configs/valera//321/201/320/272/320/270/320/264/320/272/320/270/mixkit-pet-owner-playing-with-a-cute-cat-1779-hd-ready.mp4 +0 -0
- smart_bot_factory-0.1.0/configs/valera//321/201/320/272/320/270/320/264/320/272/320/270//320/277/320/276/320/272/320/260.pdf +0 -0
- smart_bot_factory-0.1.0/configs/valera//321/201/320/272/320/270/320/264/320/272/320/270//320/277/321/200/320/270/320/262/320/265/321/202.pdf +0 -0
- smart_bot_factory-0.1.0/conversation_manager.py +536 -0
- smart_bot_factory-0.1.0/create_bot.py +294 -0
- smart_bot_factory-0.1.0/create_tag.sh +143 -0
- smart_bot_factory-0.1.0/database_structure.sql +57 -0
- smart_bot_factory-0.1.0/debug_routing.py +95 -0
- smart_bot_factory-0.1.0/debug_timeout.py +244 -0
- smart_bot_factory-0.1.0/docker-compose.yml +18 -0
- smart_bot_factory-0.1.0/env.example +40 -0
- smart_bot_factory-0.1.0/growthmed-helper.py +65 -0
- smart_bot_factory-0.1.0/growthmed-october-24.py +65 -0
- smart_bot_factory-0.1.0/handlers.py +592 -0
- smart_bot_factory-0.1.0/launcher.py +37 -0
- smart_bot_factory-0.1.0/main.py +120 -0
- smart_bot_factory-0.1.0/new-bot.py +78 -0
- smart_bot_factory-0.1.0/openai_client.py +435 -0
- smart_bot_factory-0.1.0/prompt_loader.py +422 -0
- smart_bot_factory-0.1.0/pyproject.toml +46 -0
- smart_bot_factory-0.1.0/quick_json_test.py +234 -0
- smart_bot_factory-0.1.0/requirements.txt +8 -0
- smart_bot_factory-0.1.0/save_backup.sh +3 -0
- smart_bot_factory-0.1.0/save_fixes.sh +3 -0
- smart_bot_factory-0.1.0/schema.sql +1094 -0
- smart_bot_factory-0.1.0/setup_check.py +506 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/__init__.py +30 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/cli.py +624 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/core/__init__.py +7 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/core/bot_builder.py +337 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/events/__init__.py +27 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/events/decorators.py +229 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/integrations/__init__.py +83 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/integrations/bot_utils_integration.py +224 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/services/__init__.py +12 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/services/message_sender.py +235 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/services/telegram_integration.py +246 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/tools/__init__.py +19 -0
- smart_bot_factory-0.1.0/src/smart_bot_factory/tools/decorators.py +140 -0
- smart_bot_factory-0.1.0/supabase_client.py +592 -0
- smart_bot_factory-0.1.0/system_prompt_example.txt +84 -0
- smart_bot_factory-0.1.0/test-bot.py +65 -0
- smart_bot_factory-0.1.0/utm_link_generator.py +106 -0
- smart_bot_factory-0.1.0/uv.lock +1576 -0
- smart_bot_factory-0.1.0/valera-new.py +65 -0
- smart_bot_factory-0.1.0/valera.py +65 -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,214 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.env-old
|
|
140
|
+
.envrc
|
|
141
|
+
.venv
|
|
142
|
+
env/
|
|
143
|
+
venv/
|
|
144
|
+
ENV/
|
|
145
|
+
env.bak/
|
|
146
|
+
venv.bak/
|
|
147
|
+
|
|
148
|
+
# Добавить в .gitignore
|
|
149
|
+
configs/*/env
|
|
150
|
+
configs/*/.env
|
|
151
|
+
configs/*/.env-old
|
|
152
|
+
configs/*/reports/
|
|
153
|
+
|
|
154
|
+
# Spyder project settings
|
|
155
|
+
.spyderproject
|
|
156
|
+
.spyproject
|
|
157
|
+
|
|
158
|
+
# Rope project settings
|
|
159
|
+
.ropeproject
|
|
160
|
+
|
|
161
|
+
# mkdocs documentation
|
|
162
|
+
/site
|
|
163
|
+
|
|
164
|
+
# mypy
|
|
165
|
+
.mypy_cache/
|
|
166
|
+
.dmypy.json
|
|
167
|
+
dmypy.json
|
|
168
|
+
|
|
169
|
+
# Pyre type checker
|
|
170
|
+
.pyre/
|
|
171
|
+
|
|
172
|
+
# pytype static type analyzer
|
|
173
|
+
.pytype/
|
|
174
|
+
|
|
175
|
+
# Cython debug symbols
|
|
176
|
+
cython_debug/
|
|
177
|
+
|
|
178
|
+
# PyCharm
|
|
179
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
180
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
181
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
182
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
183
|
+
#.idea/
|
|
184
|
+
|
|
185
|
+
# Abstra
|
|
186
|
+
# Abstra is an AI-powered process automation framework.
|
|
187
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
188
|
+
# Learn more at https://abstra.io/docs
|
|
189
|
+
.abstra/
|
|
190
|
+
|
|
191
|
+
# Visual Studio Code
|
|
192
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
193
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
194
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
195
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
196
|
+
# .vscode/
|
|
197
|
+
|
|
198
|
+
# Ruff stuff:
|
|
199
|
+
.ruff_cache/
|
|
200
|
+
|
|
201
|
+
# PyPI configuration file
|
|
202
|
+
.pypirc
|
|
203
|
+
|
|
204
|
+
# Cursor
|
|
205
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
206
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
207
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
208
|
+
.cursorignore
|
|
209
|
+
.cursorindexingignore
|
|
210
|
+
|
|
211
|
+
# Marimo
|
|
212
|
+
marimo/_static/
|
|
213
|
+
marimo/_lsp/
|
|
214
|
+
__marimo__/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Smart Bot Factory CLI
|
|
2
|
+
|
|
3
|
+
CLI система для управления ботами на основе Smart Bot Factory.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv pip install -e .
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Использование
|
|
12
|
+
|
|
13
|
+
### Через запускалку (рекомендуется)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Показать список ботов
|
|
17
|
+
python launcher.py list
|
|
18
|
+
|
|
19
|
+
# Создать нового бота
|
|
20
|
+
python launcher.py create my-bot minimal-bot
|
|
21
|
+
|
|
22
|
+
# Запустить бота
|
|
23
|
+
python launcher.py run my-bot
|
|
24
|
+
|
|
25
|
+
# Запустить тесты
|
|
26
|
+
python launcher.py test my-bot
|
|
27
|
+
|
|
28
|
+
# Настроить конфигурацию
|
|
29
|
+
python launcher.py config my-bot
|
|
30
|
+
|
|
31
|
+
# Управление промптами
|
|
32
|
+
python launcher.py prompts my-bot --list
|
|
33
|
+
python launcher.py prompts my-bot --edit system_prompt
|
|
34
|
+
python launcher.py prompts my-bot --add new_prompt
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Прямо через CLI
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Показать список ботов
|
|
41
|
+
uv run python -m smart_bot_factory.cli list
|
|
42
|
+
|
|
43
|
+
# Создать нового бота
|
|
44
|
+
uv run python -m smart_bot_factory.cli create my-bot minimal-bot
|
|
45
|
+
|
|
46
|
+
# Запустить бота
|
|
47
|
+
uv run python -m smart_bot_factory.cli run my-bot
|
|
48
|
+
|
|
49
|
+
# Запустить тесты
|
|
50
|
+
uv run python -m smart_bot_factory.cli test my-bot
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Структура бота
|
|
54
|
+
|
|
55
|
+
При создании бота создается следующая структура:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
bots/
|
|
59
|
+
└── my-bot/
|
|
60
|
+
├── my-bot.py # Основной файл бота
|
|
61
|
+
├── .env # Конфигурация
|
|
62
|
+
├── prompts/ # Промпты
|
|
63
|
+
│ ├── system_prompt.txt
|
|
64
|
+
│ ├── welcome_message.txt
|
|
65
|
+
│ └── final_instructions.txt
|
|
66
|
+
├── tests/ # Тесты
|
|
67
|
+
├── reports/ # Отчеты
|
|
68
|
+
└── welcome_files/ # Приветственные файлы
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Команды
|
|
72
|
+
|
|
73
|
+
### `list`
|
|
74
|
+
Показать список доступных ботов
|
|
75
|
+
|
|
76
|
+
### `create <bot_id> [template]`
|
|
77
|
+
Создать нового бота на основе шаблона
|
|
78
|
+
|
|
79
|
+
**Шаблоны:**
|
|
80
|
+
- `base` (по умолчанию) - базовый шаблон на основе growthmed-october-24
|
|
81
|
+
- `<bot_name>` - копия существующего бота из папки bots/
|
|
82
|
+
|
|
83
|
+
### `run <bot_id>`
|
|
84
|
+
Запустить бота
|
|
85
|
+
|
|
86
|
+
### `test <bot_id>`
|
|
87
|
+
Запустить тесты бота
|
|
88
|
+
|
|
89
|
+
**Опции:**
|
|
90
|
+
- `--file <filename>` - запустить тесты только из указанного файла
|
|
91
|
+
- `-v, --verbose` - подробный вывод
|
|
92
|
+
- `--max-concurrent <number>` - максимальное количество потоков
|
|
93
|
+
|
|
94
|
+
### `config <bot_id>`
|
|
95
|
+
Открыть конфигурацию бота в редакторе
|
|
96
|
+
|
|
97
|
+
### `prompts <bot_id>`
|
|
98
|
+
Управление промптами бота
|
|
99
|
+
|
|
100
|
+
**Опции:**
|
|
101
|
+
- `--list` - показать список промптов
|
|
102
|
+
- `--edit <prompt_name>` - редактировать промпт
|
|
103
|
+
- `--add <prompt_name>` - добавить новый промпт
|
|
104
|
+
|
|
105
|
+
## Примеры
|
|
106
|
+
|
|
107
|
+
### Создание и запуск бота
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# 1. Создать бота (с базовым шаблоном)
|
|
111
|
+
uv run sbf create support-bot
|
|
112
|
+
|
|
113
|
+
# Или создать копию существующего бота
|
|
114
|
+
uv run sbf create support-bot2 support-bot
|
|
115
|
+
|
|
116
|
+
# 2. Настроить конфигурацию
|
|
117
|
+
uv run sbf config support-bot
|
|
118
|
+
|
|
119
|
+
# 3. Запустить бота
|
|
120
|
+
uv run sbf run support-bot
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Управление промптами
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Показать список промптов
|
|
127
|
+
uv run sbf prompts support-bot --list
|
|
128
|
+
|
|
129
|
+
# Редактировать системный промпт
|
|
130
|
+
uv run sbf prompts support-bot --edit system_prompt
|
|
131
|
+
|
|
132
|
+
# Добавить новый промпт
|
|
133
|
+
uv run sbf prompts support-bot --add help_prompt
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Тестирование
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Запустить все тесты
|
|
140
|
+
uv run sbf test support-bot
|
|
141
|
+
|
|
142
|
+
# Запустить тесты с подробным выводом
|
|
143
|
+
uv run sbf test support-bot --verbose
|
|
144
|
+
|
|
145
|
+
# Запустить тесты из конкретного файла
|
|
146
|
+
uv run sbf test support-bot --file test_scenarios.yaml
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Требования
|
|
150
|
+
|
|
151
|
+
- Python 3.9+
|
|
152
|
+
- uv (для управления зависимостями)
|
|
153
|
+
- Настроенные .env файлы для каждого бота
|
|
154
|
+
|
|
155
|
+
## Структура проекта
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
chat-bots/
|
|
159
|
+
├── launcher.py # Запускалка
|
|
160
|
+
├── src/smart_bot_factory/ # Библиотека
|
|
161
|
+
│ ├── cli.py # CLI интерфейс
|
|
162
|
+
│ ├── core/ # Основные компоненты
|
|
163
|
+
│ ├── events/ # Система событий
|
|
164
|
+
│ ├── integrations/ # Интеграции
|
|
165
|
+
│ └── services/ # Сервисы
|
|
166
|
+
├── bots/ # Папка с ботами
|
|
167
|
+
│ ├── minimal-bot/ # Пример бота
|
|
168
|
+
│ └── my-bot/ # Ваш бот
|
|
169
|
+
└── bot_testing.py # Система тестирования
|
|
170
|
+
```
|
|
@@ -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,21 @@
|
|
|
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.
|