smart-bot-factory 0.1.3__tar.gz → 0.1.4__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 (105) hide show
  1. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/PKG-INFO +1 -1
  2. smart_bot_factory-0.1.3/new-valera.py → smart_bot_factory-0.1.4/best-valera.py +3 -3
  3. smart_bot_factory-0.1.4/bots/valera/tests/quick_scenarios.yaml +66 -0
  4. smart_bot_factory-0.1.4/bots/valera/tests/realistic_scenarios.yaml +108 -0
  5. smart_bot_factory-0.1.4/bots/valera/tests/scenario_examples.yaml +46 -0
  6. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/pyproject.toml +1 -1
  7. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/__init__.py +1 -19
  8. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/cli.py +168 -42
  9. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-helper/welcome_file/welcome_file_msg.txt +16 -0
  10. smart_bot_factory-0.1.4/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
  11. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +582 -0
  12. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +66 -0
  13. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +212 -0
  14. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +28 -0
  15. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +8 -0
  16. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +66 -0
  17. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml +108 -0
  18. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml +46 -0
  19. smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +16 -0
  20. smart_bot_factory-0.1.4/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
  21. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/bot_utils.py +22 -12
  22. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/decorators.py +61 -60
  23. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4/smart_bot_factory}/utm_link_generator.py +8 -8
  24. smart_bot_factory-0.1.4/valera.py +71 -0
  25. smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_140730.txt +0 -209
  26. smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_141530.txt +0 -178
  27. smart_bot_factory-0.1.3/bots/new-valera/reports/test_20250930_143539.txt +0 -180
  28. smart_bot_factory-0.1.3/bots/new-valera/tests/final_scenarios.yaml +0 -80
  29. smart_bot_factory-0.1.3/create_bot.py +0 -294
  30. smart_bot_factory-0.1.3/main.py +0 -120
  31. smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +0 -16
  32. smart_bot_factory-0.1.3/smart_bot_factory/uv.lock +0 -2004
  33. smart_bot_factory-0.1.3/test_library_integration.py +0 -109
  34. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.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" +0 -0
  35. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.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" +0 -0
  36. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.github/workflows/ci.yml +0 -0
  37. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.github/workflows/publish-private.yml +0 -0
  38. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.github/workflows/publish.yml +0 -0
  39. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.gitignore +0 -0
  40. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/.python-version +0 -0
  41. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/Dockerfile +0 -0
  42. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/LICENSE +0 -0
  43. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/README.md +0 -0
  44. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/bots/best-valera}/prompts/2product_info.txt +0 -0
  45. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/bots/best-valera}/prompts/3objection_handling.txt +0 -0
  46. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/bots/best-valera}/prompts/final_instructions.txt +0 -0
  47. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/bots/best-valera}/prompts/help_message.txt +0 -0
  48. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/bots/best-valera}/prompts/welcome_message.txt +0 -0
  49. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/bots/best-valera}/tests/quick_scenarios.yaml +0 -0
  50. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/bots/best-valera}/tests/realistic_scenarios.yaml +0 -0
  51. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/bots/best-valera}/tests/scenario_examples.yaml +0 -0
  52. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper/welcome_file → smart_bot_factory-0.1.4/bots/best-valera/welcome_files}/welcome_file_msg.txt +0 -0
  53. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper/welcome_file → smart_bot_factory-0.1.4/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
  54. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper → smart_bot_factory-0.1.4/bots/valera}/prompts/2product_info.txt +0 -0
  55. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper → smart_bot_factory-0.1.4/bots/valera}/prompts/3objection_handling.txt +0 -0
  56. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/bots/valera}/prompts/final_instructions.txt +0 -0
  57. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-helper → smart_bot_factory-0.1.4/bots/valera}/prompts/help_message.txt +0 -0
  58. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/bots/valera}/prompts/welcome_message.txt +0 -0
  59. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/welcome_file → smart_bot_factory-0.1.4/bots/valera/welcome_files}/welcome_file_msg.txt +0 -0
  60. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24/welcome_file → smart_bot_factory-0.1.4/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
  61. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/create_tag.sh +0 -0
  62. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/docker-compose.yml +0 -0
  63. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/env.example +0 -0
  64. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/requirements.txt +0 -0
  65. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/save_backup.sh +0 -0
  66. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/save_fixes.sh +0 -0
  67. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/__init__.py +0 -0
  68. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/admin_logic.py +0 -0
  69. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/admin_manager.py +0 -0
  70. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/admin_migration.sql +0 -0
  71. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/admin_tester.py +0 -0
  72. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/admin/timeout_checker.py +0 -0
  73. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/analytics/__init__.py +0 -0
  74. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/analytics/analytics_manager.py +0 -0
  75. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/config.py +0 -0
  76. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-helper/env_example.txt +0 -0
  77. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-helper/prompts/1sales_context.txt +0 -0
  78. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-helper}/prompts/2product_info.txt +0 -0
  79. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-helper}/prompts/3objection_handling.txt +0 -0
  80. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-helper/prompts/final_instructions.txt +0 -0
  81. {smart_bot_factory-0.1.3/smart_bot_factory/configs/growthmed-october-24 → smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-helper}/prompts/help_message.txt +0 -0
  82. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-helper/prompts/welcome_message.txt +0 -0
  83. {smart_bot_factory-0.1.3/bots/new-valera → smart_bot_factory-0.1.4/smart_bot_factory/configs/growthmed-october-24}/prompts/1sales_context.txt +0 -0
  84. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +0 -0
  85. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +0 -0
  86. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +0 -0
  87. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/__init__.py +0 -0
  88. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/conversation_manager.py +0 -0
  89. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/message_sender.py +0 -0
  90. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/core/states.py +0 -0
  91. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/creation/__init__.py +0 -0
  92. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/creation/bot_builder.py +0 -0
  93. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/creation/bot_testing.py +0 -0
  94. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/database/database_structure.sql +0 -0
  95. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/database/schema.sql +0 -0
  96. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/handlers/handlers.py +0 -0
  97. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/integrations/__init__.py +0 -0
  98. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/integrations/openai_client.py +0 -0
  99. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/integrations/supabase_client.py +0 -0
  100. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/setup_checker.py +0 -0
  101. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/utils/__init__.py +0 -0
  102. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/utils/debug_routing.py +0 -0
  103. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/smart_bot_factory/utils/prompt_loader.py +0 -0
  104. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/system_prompt_example.txt +0 -0
  105. {smart_bot_factory-0.1.3 → smart_bot_factory-0.1.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-bot-factory
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Библиотека для создания умных чат-ботов
5
5
  Author-email: Kopatych <kopatych@example.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- Бот new-valera - создан с помощью Smart Bot Factory
3
+ Бот valera - создан с помощью Smart Bot Factory
4
4
  """
5
5
 
6
6
  import asyncio
@@ -9,7 +9,7 @@ from smart_bot_factory import (
9
9
  BotBuilder,
10
10
  event_handler,
11
11
  schedule_task,
12
- send_message_by_human,
12
+ send_message_by_human
13
13
  )
14
14
 
15
15
  # =============================================================================
@@ -57,7 +57,7 @@ async def main():
57
57
  """Основная функция запуска бота"""
58
58
  try:
59
59
  # Создаем и собираем бота
60
- bot_builder = BotBuilder("new-valera")
60
+ bot_builder = BotBuilder("best-valera")
61
61
  await bot_builder.build()
62
62
 
63
63
  # Запускаем бота
@@ -0,0 +1,66 @@
1
+ scenarios:
2
+ - name: "Быстрое решение по участию"
3
+ steps:
4
+ - user_input: "Привет, срочно нужна информация о конференции"
5
+ expected_keywords: ["привет", "информация", "конференци"]
6
+ forbidden_keywords: ["не спешите"]
7
+
8
+ - user_input: "Завтра улетаю в командировку, успею зарегистрироваться?"
9
+ expected_keywords: ["успеете", "регистрация", "быстро"]
10
+ forbidden_keywords: ["поздно", "не успеете"]
11
+
12
+ - name: "Студент медвуза интересуется будущим"
13
+ steps:
14
+ - user_input: "Здравствуйте, я студент 5 курса медуниверситета"
15
+ expected_keywords: ["здравствуйте", "студент", "медицин"]
16
+ forbidden_keywords: ["рано для вас"]
17
+
18
+ - user_input: "Стоит ли уже сейчас думать о бизнесе в медицине?"
19
+ expected_keywords: ["стоит", "перспектив", "будущее"]
20
+ forbidden_keywords: ["рано думать"]
21
+
22
+ - user_input: "Есть ли льготы для студентов?"
23
+ expected_keywords: ["льготы", "студент", "скидк"]
24
+ forbidden_keywords: ["полная стоимость"]
25
+
26
+ - name: "Иностранный врач в России"
27
+ steps:
28
+ - user_input: "Hello, I am foreign doctor working in Moscow"
29
+ expected_keywords: ["hello", "добро пожаловать", "moscow"]
30
+ forbidden_keywords: ["только на русском"]
31
+
32
+ - user_input: "Is conference in English or Russian language?"
33
+ expected_keywords: ["language", "english", "translation"]
34
+ forbidden_keywords: ["только русский"]
35
+
36
+ - user_input: "I want to understand Russian medical business"
37
+ expected_keywords: ["business", "russian", "understand"]
38
+ forbidden_keywords: ["сложно будет"]
39
+
40
+ - name: "Пенсионер-врач ищет активность"
41
+ steps:
42
+ - user_input: "Добрый день, я врач на пенсии уже 3 года"
43
+ expected_keywords: ["добрый день", "пенси", "врач"]
44
+ forbidden_keywords: ["не актуально"]
45
+
46
+ - user_input: "Хочу быть в курсе современных тенденций"
47
+ expected_keywords: ["современн", "тенденци", "актуальн"]
48
+ forbidden_keywords: ["устарело"]
49
+
50
+ - user_input: "Подходит ли конференция для неработающих врачей?"
51
+ expected_keywords: ["подходит", "для всех", "врачей"]
52
+ forbidden_keywords: ["только для практикующих"]
53
+
54
+ - name: "Технический директор медцентра"
55
+ steps:
56
+ - user_input: "Здравствуйте, я отвечаю за IT в медицинском центре"
57
+ expected_keywords: ["здравствуйте", "it", "медицинск"]
58
+ forbidden_keywords: ["не ваша тема"]
59
+
60
+ - user_input: "Есть ли секции по цифровизации медицины?"
61
+ expected_keywords: ["цифровизация", "технологи", "it"]
62
+ forbidden_keywords: ["только бизнес"]
63
+
64
+ - user_input: "Интересуют телемедицина и электронные карты"
65
+ expected_keywords: ["телемедицина", "электронн", "карты"]
66
+ forbidden_keywords: ["не рассматриваем"]
@@ -0,0 +1,108 @@
1
+ scenarios:
2
+ - name: "Директор клиники интересуется эффективностью"
3
+ steps:
4
+ - user_input: "Здравствуйте, я директор частной клиники в Казани"
5
+ expected_keywords: ["здравствуйте", "директор", "клиника"]
6
+ forbidden_keywords: ["не понял", "непонятно"]
7
+
8
+ - user_input: "У нас 15 врачей, выручка падает уже полгода"
9
+ expected_keywords: ["понимаю", "проблема", "выручка"]
10
+ forbidden_keywords: ["не знаю", "ничем не помогу"]
11
+
12
+ - user_input: "Поможет ли ваша конференция решить финансовые проблемы?"
13
+ expected_keywords: ["поможет", "финансов", "решени"]
14
+ forbidden_keywords: ["не уверен", "может быть"]
15
+
16
+ - user_input: "Сколько это стоит и когда окупится?"
17
+ expected_keywords: ["стоимость", "рубл", "окупаемость"]
18
+ forbidden_keywords: ["дорого", "не окупится"]
19
+
20
+ - name: "Молодой врач сомневается в пользе"
21
+ steps:
22
+ - user_input: "Привет, я врач-терапевт, работаю 2 года"
23
+ expected_keywords: ["привет", "врач", "терапевт"]
24
+ forbidden_keywords: ["не интересно"]
25
+
26
+ - user_input: "Честно говоря, не верю в подобные мероприятия"
27
+ expected_keywords: ["понимаю", "скептицизм"]
28
+ forbidden_keywords: ["согласен", "действительно"]
29
+
30
+ - user_input: "Что конкретно я получу за эти деньги?"
31
+ expected_keywords: ["получите", "конкретно", "знания"]
32
+ forbidden_keywords: ["ничего особенного"]
33
+
34
+ - user_input: "А если мне не понравится?"
35
+ expected_keywords: ["гарантии", "возврат"]
36
+ forbidden_keywords: ["ничего не вернем"]
37
+
38
+ - name: "Руководитель сети клиник ищет масштабирование"
39
+ steps:
40
+ - user_input: "Добрый день! У меня сеть из 8 клиник в Москве"
41
+ expected_keywords: ["добрый день", "сеть", "клиник"]
42
+ forbidden_keywords: ["не подходит"]
43
+
44
+ - user_input: "Хочу открыть еще 5 филиалов в следующем году"
45
+ expected_keywords: ["масштабирование", "развитие", "филиал"]
46
+ forbidden_keywords: ["рано", "не стоит"]
47
+
48
+ - user_input: "Есть ли на конференции кейсы по франчайзингу?"
49
+ expected_keywords: ["франчайзинг", "кейсы", "масштаб"]
50
+ forbidden_keywords: ["нет таких"]
51
+
52
+ - user_input: "Можно ли получить персональную консультацию?"
53
+ expected_keywords: ["консультация", "персональн", "индивидуальн"]
54
+ forbidden_keywords: ["только общая"]
55
+
56
+ - name: "Главврач государственной больницы с ограниченным бюджетом"
57
+ steps:
58
+ - user_input: "Здравствуйте, я главврач областной больницы"
59
+ expected_keywords: ["здравствуйте", "главврач", "больниц"]
60
+ forbidden_keywords: ["частная практика"]
61
+
62
+ - user_input: "У нас государственное финансирование, бюджет ограничен"
63
+ expected_keywords: ["понимаю", "бюджет", "ограничен"]
64
+ forbidden_keywords: ["не подходит"]
65
+
66
+ - user_input: "Есть ли льготные условия для госучреждений?"
67
+ expected_keywords: ["льготы", "скидк", "условия"]
68
+ forbidden_keywords: ["льгот нет"]
69
+
70
+ - user_input: "Можно ли отправить нескольких врачей от больницы?"
71
+ expected_keywords: ["можно", "группов", "врачей"]
72
+ forbidden_keywords: ["только одного"]
73
+
74
+ - name: "Стоматолог планирует открытие собственной клиники"
75
+ steps:
76
+ - user_input: "Привет! Я стоматолог, работаю в найме 5 лет"
77
+ expected_keywords: ["привет", "стоматолог", "лет"]
78
+ forbidden_keywords: ["не для вас"]
79
+
80
+ - user_input: "Планирую открыть свою клинику в следующем году"
81
+ expected_keywords: ["открыти", "клинику", "планы"]
82
+ forbidden_keywords: ["не советую"]
83
+
84
+ - user_input: "Боюсь не справиться с управлением и маркетингом"
85
+ expected_keywords: ["поможем", "управлени", "маркетинг"]
86
+ forbidden_keywords: ["сложно будет"]
87
+
88
+ - user_input: "Есть ли программа для начинающих предпринимателей?"
89
+ expected_keywords: ["программа", "начинающ", "предпринимател"]
90
+ forbidden_keywords: ["только для опытных"]
91
+
92
+ - name: "Опытный бизнесмен ищет новые возможности"
93
+ steps:
94
+ - user_input: "Здравствуйте, у меня успешный бизнес в IT"
95
+ expected_keywords: ["здравствуйте", "бизнес", "успешн"]
96
+ forbidden_keywords: ["не подходит"]
97
+
98
+ - user_input: "Думаю инвестировать в медицину, перспективно ли?"
99
+ expected_keywords: ["перспективн", "медицина", "инвестици"]
100
+ forbidden_keywords: ["не стоит"]
101
+
102
+ - user_input: "Какие направления сейчас самые прибыльные?"
103
+ expected_keywords: ["прибыльн", "направлени", "доходн"]
104
+ forbidden_keywords: ["не знаю"]
105
+
106
+ - user_input: "Сколько нужно вложить для старта?"
107
+ expected_keywords: ["вложени", "стартов", "капитал"]
108
+ forbidden_keywords: ["очень много"]
@@ -0,0 +1,46 @@
1
+ scenarios:
2
+ - name: "Первое знакомство с потенциальным клиентом"
3
+ steps:
4
+ - user_input: "Здравствуйте"
5
+ expected_keywords: ["здравствуйте", "зовут"]
6
+ forbidden_keywords: ["пока", "до свидания"]
7
+
8
+ - user_input: "Сколько стоит участие?"
9
+ expected_keywords: ["рубл", "пакет", "минимум"]
10
+ forbidden_keywords: ["бесплатно", "даром"]
11
+
12
+ - user_input: "Это дорого для меня"
13
+ expected_keywords: ["понимаю", "инвестиция"]
14
+ forbidden_keywords: ["согласен", "дешево"]
15
+
16
+ - name: "Скептично настроенный клиент"
17
+ steps:
18
+ - user_input: "Привет, расскажите про конференцию"
19
+ expected_keywords: ["конференция", "growthmed"]
20
+ forbidden_keywords: ["не знаю", "отмена"]
21
+
22
+ - user_input: "А точно ли это поможет моему бизнесу?"
23
+ expected_keywords: ["поможет", "результат", "опыт"]
24
+ forbidden_keywords: ["не уверен", "гарантий нет"]
25
+
26
+ - user_input: "Думаю, это пустая трата времени"
27
+ expected_keywords: ["понимаю", "ценность"]
28
+ forbidden_keywords: ["пустая трата", "согласен", "действительно"]
29
+
30
+ - name: "Клиент интересуется деталями"
31
+ steps:
32
+ - user_input: "Добрый день, можете помочь?"
33
+ expected_keywords: ["помочь", "рад"]
34
+ forbidden_keywords: ["не могу", "отказ"]
35
+
36
+ - user_input: "Где будет проходить конференция?"
37
+ expected_keywords: ["москв", "адрес"]
38
+ forbidden_keywords: ["не знаю где"]
39
+
40
+ - user_input: "Кто будет выступать?"
41
+ expected_keywords: ["эксперт", "спикер"]
42
+ forbidden_keywords: ["не знаем", "секрет"]
43
+
44
+ - user_input: "Какие гарантии результата?"
45
+ expected_keywords: ["результат", "опыт"]
46
+ forbidden_keywords: ["никаких гарантий"]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smart-bot-factory"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Библиотека для создания умных чат-ботов"
5
5
  authors = [
6
6
  {name = "Kopatych", email = "kopatych@example.com"}
@@ -28,24 +28,6 @@ __all__ = [
28
28
  'schedule_task',
29
29
  'send_message_by_ai',
30
30
  'send_message_by_human',
31
- 'Config',
32
31
  'OpenAIClient',
33
- 'SupabaseClient',
34
- 'ConversationManager',
35
- 'AdminManager',
36
- 'PromptLoader',
37
- 'setup_handlers',
38
- 'setup_admin_handlers',
39
- 'setup_utils_handlers',
40
- 'parse_ai_response',
41
- 'process_events',
42
- 'setup_debug_handlers',
43
- 'UserStates',
44
- 'AdminStates',
45
- 'bot_testing_main',
46
- 'AnalyticsManager',
47
- 'check_timeouts',
48
- 'setup_bot_environment',
49
- 'check_setup',
50
- 'test_admin_system',
32
+ 'SupabaseClient'
51
33
  ]
@@ -295,18 +295,58 @@ def rm(bot_id: str, force: bool = False):
295
295
  sys.exit(1)
296
296
 
297
297
 
298
+ @cli.command()
299
+ @click.argument("source_bot_id")
300
+ @click.argument("new_bot_id")
301
+ @click.option("--force", "-f", is_flag=True, help="Перезаписать существующего бота без подтверждения")
302
+ def copy(source_bot_id: str, new_bot_id: str, force: bool = False):
303
+ """Скопировать существующего бота как шаблон"""
304
+ try:
305
+ # Проверяем существование исходного бота
306
+ source_bot_path = PROJECT_ROOT / "bots" / source_bot_id
307
+ if not source_bot_path.exists():
308
+ raise click.ClickException(f"Исходный бот {source_bot_id} не найден в папке bots/")
309
+
310
+ # Проверяем наличие файла запускалки исходного бота
311
+ source_bot_file = PROJECT_ROOT / f"{source_bot_id}.py"
312
+ if not source_bot_file.exists():
313
+ raise click.ClickException(f"Файл запускалки {source_bot_id}.py не найден в корневой директории")
314
+
315
+ # Проверяем, не существует ли уже новый бот
316
+ new_bot_path = PROJECT_ROOT / "bots" / new_bot_id
317
+ new_bot_file = PROJECT_ROOT / f"{new_bot_id}.py"
318
+
319
+ if new_bot_path.exists() or new_bot_file.exists():
320
+ if not force:
321
+ if not click.confirm(f"Бот {new_bot_id} уже существует. Перезаписать?"):
322
+ click.echo("Копирование отменено")
323
+ return
324
+ else:
325
+ click.echo(f"⚠️ Перезаписываем существующего бота {new_bot_id}")
326
+
327
+ # Копируем бота
328
+ click.echo(f"📋 Копируем бота {source_bot_id} → {new_bot_id}...")
329
+ copy_bot_template(source_bot_id, new_bot_id)
330
+
331
+ click.echo(f"✅ Бот {new_bot_id} успешно скопирован из {source_bot_id}")
332
+ click.echo(f"📝 Не забудьте настроить .env файл для нового бота")
333
+
334
+ except Exception as e:
335
+ click.echo(f"Ошибка при копировании бота: {e}", err=True)
336
+ sys.exit(1)
337
+
298
338
  @cli.command()
299
339
  def link():
300
340
  """Создать UTM-ссылку для бота"""
301
341
  try:
302
342
  # Проверяем наличие скрипта генерации ссылок
303
- link_script = Path("utm_link_generator.py")
343
+ link_script = Path(__file__).parent / "utm_link_generator.py"
304
344
  if not link_script.exists():
305
345
  raise click.ClickException("Скрипт utm_link_generator.py не найден")
306
346
 
307
- # Запускаем ваш скрипт генерации ссылок
308
- click.echo("Запускаем генератор UTM-ссылок...")
309
- subprocess.run([sys.executable, "utm_link_generator.py"], check=True)
347
+ # Запускаем скрипт генерации ссылок
348
+ click.echo("🔗 Запускаем генератор UTM-ссылок...")
349
+ subprocess.run([sys.executable, str(link_script)], check=True)
310
350
 
311
351
  except subprocess.CalledProcessError as e:
312
352
  click.echo(f"Ошибка при запуске генератора ссылок: {e}", err=True)
@@ -335,6 +375,7 @@ def create_new_bot_structure(template: str, bot_id: str) -> bool:
335
375
  (bot_dir / "tests").mkdir()
336
376
  (bot_dir / "reports").mkdir()
337
377
  (bot_dir / "welcome_files").mkdir()
378
+ (bot_dir / "files").mkdir()
338
379
 
339
380
  if template == "base":
340
381
  # Используем growthmed-october-24 как базовый шаблон
@@ -372,31 +413,6 @@ def create_bot_template(bot_id: str) -> str:
372
413
  """
373
414
 
374
415
  import asyncio
375
- import sys
376
- import os
377
- from pathlib import Path
378
-
379
- # Добавляем корень проекта в путь
380
- project_root = Path(__file__).parent
381
- sys.path.insert(0, str(project_root))
382
-
383
- # Устанавливаем переменные окружения ДО импорта библиотеки
384
- bot_id = "{bot_id}"
385
- config_dir = Path("bots") / bot_id
386
- prompts_dir = config_dir / "prompts"
387
-
388
- if prompts_dir.exists():
389
- os.environ["PROMT_FILES_DIR"] = str(prompts_dir)
390
- print(f"📁 Установлен путь к промптам: {{prompts_dir}}")
391
-
392
- # Загружаем .env файл ДО импорта библиотеки
393
- env_file = config_dir / ".env"
394
- if env_file.exists():
395
- from dotenv import load_dotenv
396
- load_dotenv(env_file)
397
- print(f"📄 Загружен .env файл: {{env_file}}")
398
- else:
399
- print(f"⚠️ .env файл не найден: {{env_file}}")
400
416
 
401
417
  from smart_bot_factory import (
402
418
  BotBuilder,
@@ -516,12 +532,12 @@ def copy_from_growthmed_template(bot_dir: Path, bot_id: str):
516
532
  bot_file = PROJECT_ROOT / Path(f"{bot_id}.py")
517
533
  bot_file.write_text(create_bot_template(bot_id), encoding='utf-8')
518
534
 
519
- # Копируем .env файл в папку бота
535
+ # Создаем .env файл в папке бота (НЕ копируем из шаблона)
520
536
  env_file = bot_dir / ".env"
521
537
  env_file.write_text(create_env_template(bot_id), encoding='utf-8')
522
538
 
523
539
  # Копируем промпты из growthmed-october-24
524
- source_prompts = Path("configs/growthmed-october-24/prompts")
540
+ source_prompts = Path(__file__).parent / "configs" / "growthmed-october-24" / "prompts"
525
541
  target_prompts = bot_dir / "prompts"
526
542
 
527
543
  if source_prompts.exists():
@@ -529,17 +545,134 @@ def copy_from_growthmed_template(bot_dir: Path, bot_id: str):
529
545
  shutil.copy2(prompt_file, target_prompts / prompt_file.name)
530
546
  click.echo("Промпты скопированы из growthmed-october-24")
531
547
  else:
548
+ click.echo(f"⚠️ Папка промптов не найдена: {source_prompts}")
532
549
  # Fallback к базовым промптам
533
550
  create_basic_prompts(target_prompts)
534
551
  click.echo("Созданы базовые промпты")
552
+
553
+ # Копируем тесты из growthmed-october-24
554
+ source_tests = Path(__file__).parent / "configs" / "growthmed-october-24" / "tests"
555
+ target_tests = bot_dir / "tests"
556
+
557
+ if source_tests.exists():
558
+ for test_file in source_tests.glob("*"):
559
+ if test_file.is_file():
560
+ shutil.copy2(test_file, target_tests / test_file.name)
561
+ click.echo("Тесты скопированы из growthmed-october-24")
562
+
563
+ # Копируем welcome_files из growthmed-october-24
564
+ source_welcome = Path(__file__).parent / "configs" / "growthmed-october-24" / "welcome_file"
565
+ target_welcome = bot_dir / "welcome_files"
566
+
567
+ if source_welcome.exists():
568
+ for welcome_file in source_welcome.glob("*"):
569
+ if welcome_file.is_file():
570
+ shutil.copy2(welcome_file, target_welcome / welcome_file.name)
571
+ click.echo("Welcome файлы скопированы из growthmed-october-24")
572
+
573
+ # Копируем files из growthmed-october-24
574
+ source_files = Path(__file__).parent / "configs" / "growthmed-october-24" / "files"
575
+ target_files = bot_dir / "files"
576
+
577
+ if source_files.exists():
578
+ for file_item in source_files.glob("*"):
579
+ if file_item.is_file():
580
+ shutil.copy2(file_item, target_files / file_item.name)
581
+ click.echo("Файлы скопированы из growthmed-october-24")
535
582
 
536
583
  except Exception as e:
537
584
  click.echo(f"Ошибка при копировании шаблона: {e}")
538
585
  # Fallback к базовым промптам
539
586
  create_basic_prompts(bot_dir / "prompts")
540
587
 
588
+ def copy_bot_template(source_bot_id: str, new_bot_id: str):
589
+ """Копирует существующего бота как шаблон для нового бота"""
590
+ try:
591
+ source_dir = PROJECT_ROOT / "bots" / source_bot_id
592
+ new_dir = PROJECT_ROOT / "bots" / new_bot_id
593
+
594
+ # Создаем папку для нового бота
595
+ new_dir.mkdir(exist_ok=True)
596
+
597
+ # Создаем структуру папок
598
+ (new_dir / "prompts").mkdir(exist_ok=True)
599
+ (new_dir / "tests").mkdir(exist_ok=True)
600
+ (new_dir / "reports").mkdir(exist_ok=True)
601
+ (new_dir / "welcome_files").mkdir(exist_ok=True)
602
+ (new_dir / "files").mkdir(exist_ok=True)
603
+
604
+ # Копируем основной файл бота в корневую директорию
605
+ source_bot_file = PROJECT_ROOT / f"{source_bot_id}.py"
606
+ new_bot_file = PROJECT_ROOT / f"{new_bot_id}.py"
607
+
608
+ if source_bot_file.exists():
609
+ shutil.copy2(source_bot_file, new_bot_file)
610
+
611
+ # Заменяем название бота в файле
612
+ content = new_bot_file.read_text(encoding='utf-8')
613
+ content = content.replace(f'BotBuilder("{source_bot_id}")', f'BotBuilder("{new_bot_id}")')
614
+ content = content.replace(f'bot_id="{source_bot_id}"', f'bot_id="{new_bot_id}"')
615
+ new_bot_file.write_text(content, encoding='utf-8')
616
+ click.echo(f" 📄 Файл запускалки скопирован: {new_bot_id}.py")
617
+
618
+ # Копируем .env файл
619
+ source_env = source_dir / ".env"
620
+ new_env = new_dir / ".env"
621
+
622
+ if source_env.exists():
623
+ shutil.copy2(source_env, new_env)
624
+
625
+ # Заменяем BOT_ID в .env
626
+ env_content = new_env.read_text(encoding='utf-8')
627
+ env_content = env_content.replace(f'BOT_ID={source_bot_id}', f'BOT_ID={new_bot_id}')
628
+ new_env.write_text(env_content, encoding='utf-8')
629
+ click.echo(f" ⚙️ .env файл скопирован и обновлен")
630
+
631
+ # Копируем промпты
632
+ source_prompts = source_dir / "prompts"
633
+ new_prompts = new_dir / "prompts"
634
+
635
+ if source_prompts.exists():
636
+ for prompt_file in source_prompts.glob("*.txt"):
637
+ shutil.copy2(prompt_file, new_prompts / prompt_file.name)
638
+ click.echo(f" 📝 Промпты скопированы")
639
+
640
+ # Копируем тесты
641
+ source_tests = source_dir / "tests"
642
+ new_tests = new_dir / "tests"
643
+
644
+ if source_tests.exists():
645
+ for test_file in source_tests.glob("*"):
646
+ if test_file.is_file():
647
+ shutil.copy2(test_file, new_tests / test_file.name)
648
+ click.echo(f" 🧪 Тесты скопированы")
649
+
650
+ # Копируем welcome_files
651
+ source_welcome = source_dir / "welcome_files"
652
+ new_welcome = new_dir / "welcome_files"
653
+
654
+ if source_welcome.exists():
655
+ for welcome_file in source_welcome.glob("*"):
656
+ if welcome_file.is_file():
657
+ shutil.copy2(welcome_file, new_welcome / welcome_file.name)
658
+ click.echo(f" 📁 Welcome файлы скопированы")
659
+
660
+ # Копируем files
661
+ source_files = source_dir / "files"
662
+ new_files = new_dir / "files"
663
+
664
+ if source_files.exists():
665
+ for file_item in source_files.glob("*"):
666
+ if file_item.is_file():
667
+ shutil.copy2(file_item, new_files / file_item.name)
668
+ click.echo(f" 📎 Файлы скопированы")
669
+
670
+ except Exception as e:
671
+ click.echo(f"Ошибка при копировании бота: {e}")
672
+ raise
673
+
541
674
  def copy_from_bot_template(template: str, bot_dir: Path, bot_id: str):
542
- """Копирует шаблон из существующего бота"""
675
+ """Копирует шаблон из существующего бота (для команды create)"""
543
676
  try:
544
677
  template_dir = PROJECT_ROOT / Path("bots") / template
545
678
  if not template_dir.exists():
@@ -557,16 +690,9 @@ def copy_from_bot_template(template: str, bot_dir: Path, bot_id: str):
557
690
  content = content.replace(f'bot_id="{template}"', f'bot_id="{bot_id}"')
558
691
  bot_file.write_text(content, encoding='utf-8')
559
692
 
560
- # Копируем .env файл
561
- template_env = template_dir / ".env"
562
- if template_env.exists():
563
- env_file = bot_dir / ".env"
564
- shutil.copy2(template_env, env_file)
565
-
566
- # Заменяем BOT_ID в .env
567
- env_content = env_file.read_text(encoding='utf-8')
568
- env_content = env_content.replace(f'BOT_ID={template}', f'BOT_ID={bot_id}')
569
- env_file.write_text(env_content, encoding='utf-8')
693
+ # Создаем .env файл в папке бота (НЕ копируем из шаблона)
694
+ env_file = bot_dir / ".env"
695
+ env_file.write_text(create_env_template(bot_id), encoding='utf-8')
570
696
 
571
697
  # Копируем промпты
572
698
  template_prompts = template_dir / "prompts"
@@ -0,0 +1,16 @@
1
+ 🎯 **Чеклист соблюдения 152-ФЗ для медицинских клиник**
2
+
3
+ Актуальные требования и практические рекомендации для безопасной работы с персональными данными пациентов.
4
+
5
+ 📋 **В чеклисте:** политики, согласия, техзащита, самопроверка
6
+
7
+ ---
8
+
9
+ **Кстати, вопрос:** Слышали об одной из крупнейших конференций в РФ по росту медицинского бизнеса GrowthMED 24-25 октября в Москве?
10
+
11
+ 1) Не слышал(а)
12
+ 2) Да, интересует
13
+ 3) Уже купил(а) билет
14
+ 4) Слышал(а), но не интересно
15
+
16
+ **Просто напишите один из вариантов** — это поможет мне лучше вам помочь! 😊