smart-bot-factory 0.3.3__tar.gz → 0.3.5__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.

Files changed (89) hide show
  1. smart_bot_factory-0.3.5/.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
  2. smart_bot_factory-0.3.5/.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
  3. smart_bot_factory-0.3.5/.github/workflows/ci.yml +59 -0
  4. smart_bot_factory-0.3.5/.github/workflows/publish-private.yml +34 -0
  5. smart_bot_factory-0.3.5/.github/workflows/publish.yml +31 -0
  6. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/.gitignore +0 -5
  7. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/PKG-INFO +1 -2
  8. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/best-valera.py +5 -7
  9. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/final_instructions.txt +1 -1
  10. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/pyproject.toml +1 -2
  11. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/admin_events.py +420 -245
  12. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/admin_logic.py +5 -0
  13. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/bot_utils.py +34 -9
  14. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/decorators.py +41 -26
  15. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/message_sender.py +11 -2
  16. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/router.py +59 -8
  17. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/handlers/handlers.py +25 -6
  18. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/integrations/supabase_client.py +32 -23
  19. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/utils/prompt_loader.py +12 -8
  20. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/uv.lock +1 -24
  21. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/.python-version +0 -0
  22. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/LICENSE +0 -0
  23. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/README.md +0 -0
  24. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/1sales_context.txt +0 -0
  25. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/2product_info.txt +0 -0
  26. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/3objection_handling.txt +0 -0
  27. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/help_message.txt +0 -0
  28. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/prompts/welcome_message.txt +0 -0
  29. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/tests/quick_scenarios.yaml +0 -0
  30. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/tests/realistic_scenarios.yaml +0 -0
  31. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/tests/scenario_examples.yaml +0 -0
  32. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/welcome_files/welcome_file_msg.txt +0 -0
  33. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/best-valera/welcome_files//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
  34. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/prompts/2product_info.txt +0 -0
  35. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/prompts/3objection_handling.txt +0 -0
  36. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/prompts/final_instructions.txt +0 -0
  37. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/prompts/help_message.txt +0 -0
  38. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/prompts/welcome_message.txt +0 -0
  39. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/tests/quick_scenarios.yaml +0 -0
  40. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/tests/realistic_scenarios.yaml +0 -0
  41. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/tests/scenario_examples.yaml +0 -0
  42. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/welcome_files/welcome_file_msg.txt +0 -0
  43. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/bots/valera/welcome_files//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
  44. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/publish.py +0 -0
  45. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/__init__.py +0 -0
  46. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/__init__.py +0 -0
  47. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/admin_manager.py +0 -0
  48. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/admin_migration.sql +0 -0
  49. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/admin_tester.py +0 -0
  50. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/admin/timeout_checker.py +0 -0
  51. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/aiogram_calendar/__init__.py +0 -0
  52. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/aiogram_calendar/common.py +0 -0
  53. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/aiogram_calendar/dialog_calendar.py +0 -0
  54. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/aiogram_calendar/schemas.py +0 -0
  55. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/aiogram_calendar/simple_calendar.py +0 -0
  56. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/analytics/analytics_manager.py +0 -0
  57. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/cli.py +0 -0
  58. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/config.py +0 -0
  59. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +0 -0
  60. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +0 -0
  61. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +0 -0
  62. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +0 -0
  63. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +0 -0
  64. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +0 -0
  65. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +0 -0
  66. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +0 -0
  67. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +0 -0
  68. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +0 -0
  69. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml +0 -0
  70. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml +0 -0
  71. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +0 -0
  72. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/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
  73. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/conversation_manager.py +0 -0
  74. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/router_manager.py +0 -0
  75. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/core/states.py +0 -0
  76. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/creation/__init__.py +0 -0
  77. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/creation/bot_builder.py +0 -0
  78. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/creation/bot_testing.py +0 -0
  79. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/event/__init__.py +0 -0
  80. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/integrations/openai_client.py +0 -0
  81. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/message/__init__.py +0 -0
  82. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/router/__init__.py +0 -0
  83. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/setup_checker.py +0 -0
  84. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/supabase/__init__.py +0 -0
  85. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/supabase/client.py +0 -0
  86. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/utils/__init__.py +0 -0
  87. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/utils/debug_routing.py +0 -0
  88. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/utils/user_prompt_loader.py +0 -0
  89. {smart_bot_factory-0.3.3 → smart_bot_factory-0.3.5}/smart_bot_factory/utm_link_generator.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/*
@@ -213,8 +213,3 @@ cython_debug/
213
213
  marimo/_static/
214
214
  marimo/_lsp/
215
215
  __marimo__/
216
-
217
- # Temporary event files
218
- temp_event_files/
219
- temp_with_msg/
220
- temp_after_msg/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-bot-factory
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Библиотека для создания умных чат-ботов
5
5
  Author-email: Kopatych <eserov73@gmail.com>
6
6
  License: MIT
@@ -25,7 +25,6 @@ Requires-Dist: aiogram>=3.4.1
25
25
  Requires-Dist: click>=8.0.0
26
26
  Requires-Dist: openai>=1.12.0
27
27
  Requires-Dist: project-root-finder>=1.9
28
- Requires-Dist: python-dateutil>=2.9.0.post0
29
28
  Requires-Dist: python-dotenv>=1.0.1
30
29
  Requires-Dist: pytz>=2023.3
31
30
  Requires-Dist: pyyaml>=6.0.2
@@ -69,7 +69,7 @@ async def handle_phone_collection(user_id: int, phone_number: str):
69
69
 
70
70
  return {"status": "success", "phone": phone_number}
71
71
 
72
- @event_router.event_handler("collect_name", once_only=True)
72
+ @event_router.event_handler("collect_name", send_ai_response=False, once_only=False)
73
73
  async def handle_name_collection(user_id: int, client_name: str):
74
74
  """
75
75
  Обрабатывает получение имени клиента
@@ -78,13 +78,11 @@ async def handle_name_collection(user_id: int, client_name: str):
78
78
  """
79
79
  logger.info(f"👤 Получено имя от пользователя {user_id}: {client_name}")
80
80
 
81
- session = await supabase_client.get_active_session(user_id)
82
- if session:
83
- metadata = session.get('metadata', {})
84
- metadata['confirmed_name'] = client_name
85
- await supabase_client.update_session_metadata(session['id'], metadata)
81
+ await send_message_by_human(
82
+ user_id=user_id,
83
+ message_text=f"✅ Спасибо! Ваш номер {client_name} сохранен"
84
+ )
86
85
 
87
- return {"status": "success", "name": client_name}
88
86
 
89
87
  # =============================================================================
90
88
  # ЗАПЛАНИРОВАННЫЕ ЗАДАЧИ (выполняются через время)
@@ -127,7 +127,7 @@ id этапа бери из stages
127
127
  на данном этапе выясни его имя, а также кем он работает и профиль его компании. после этого переходи к этапу consult.
128
128
  если он уже в первом сообщении дал эту информацию - не переспрашивай.
129
129
 
130
- Когда пользователь вписал свое имя впиши событие - тип=send_reminder, инфо=afdf, тип=mass_notification, инфо=ghbdtn, тип=имя инфо=Имя пользователя, тип=booking_reminder
130
+ Когда пользователь вписал свое имя - впиши в служебную информацию событие тип=collect_name, инфо=имя пользователя
131
131
  </stage>
132
132
 
133
133
  <stage id="consult">
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smart-bot-factory"
3
- version = "0.3.3"
3
+ version = "0.3.5"
4
4
  description = "Библиотека для создания умных чат-ботов"
5
5
  authors = [
6
6
  {name = "Kopatych", email = "eserov73@gmail.com"}
@@ -33,7 +33,6 @@ dependencies = [
33
33
  # CLI интерфейс
34
34
  "click>=8.0.0",
35
35
  "project-root-finder>=1.9",
36
- "python-dateutil>=2.9.0.post0",
37
36
  ]
38
37
  requires-python = ">=3.9"
39
38
  readme = "README.md"