smart-bot-factory 0.3.6__tar.gz → 0.3.7__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.6 → smart_bot_factory-0.3.7}/PKG-INFO +1 -1
  2. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/pyproject.toml +1 -1
  3. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/bot_utils.py +14 -0
  4. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/decorators.py +32 -6
  5. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/handlers/handlers.py +16 -4
  6. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/uv.lock +1 -1
  7. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.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
  8. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.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
  9. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.github/workflows/ci.yml +0 -0
  10. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.github/workflows/publish-private.yml +0 -0
  11. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.github/workflows/publish.yml +0 -0
  12. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.gitignore +0 -0
  13. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/.python-version +0 -0
  14. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/LICENSE +0 -0
  15. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/README.md +0 -0
  16. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/best-valera.py +0 -0
  17. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/1sales_context.txt +0 -0
  18. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/2product_info.txt +0 -0
  19. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/3objection_handling.txt +0 -0
  20. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/final_instructions.txt +0 -0
  21. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/help_message.txt +0 -0
  22. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/prompts/welcome_message.txt +0 -0
  23. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/tests/quick_scenarios.yaml +0 -0
  24. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/tests/realistic_scenarios.yaml +0 -0
  25. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/tests/scenario_examples.yaml +0 -0
  26. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/best-valera/welcome_files/welcome_file_msg.txt +0 -0
  27. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/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
  28. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/prompts/2product_info.txt +0 -0
  29. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/prompts/3objection_handling.txt +0 -0
  30. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/prompts/final_instructions.txt +0 -0
  31. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/prompts/help_message.txt +0 -0
  32. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/prompts/welcome_message.txt +0 -0
  33. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/tests/quick_scenarios.yaml +0 -0
  34. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/tests/realistic_scenarios.yaml +0 -0
  35. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/tests/scenario_examples.yaml +0 -0
  36. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/bots/valera/welcome_files/welcome_file_msg.txt +0 -0
  37. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/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
  38. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/publish.py +0 -0
  39. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/__init__.py +0 -0
  40. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/__init__.py +0 -0
  41. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/admin_events.py +0 -0
  42. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/admin_logic.py +0 -0
  43. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/admin_manager.py +0 -0
  44. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/admin_tester.py +0 -0
  45. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/admin/timeout_checker.py +0 -0
  46. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/aiogram_calendar/__init__.py +0 -0
  47. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/aiogram_calendar/common.py +0 -0
  48. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/aiogram_calendar/dialog_calendar.py +0 -0
  49. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/aiogram_calendar/schemas.py +0 -0
  50. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/aiogram_calendar/simple_calendar.py +0 -0
  51. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/analytics/analytics_manager.py +0 -0
  52. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/cli.py +0 -0
  53. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/config.py +0 -0
  54. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +0 -0
  55. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +0 -0
  56. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +0 -0
  57. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +0 -0
  58. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +0 -0
  59. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +0 -0
  60. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +0 -0
  61. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +0 -0
  62. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +0 -0
  63. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +0 -0
  64. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml +0 -0
  65. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml +0 -0
  66. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +0 -0
  67. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/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
  68. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/conversation_manager.py +0 -0
  69. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/message_sender.py +0 -0
  70. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/router.py +0 -0
  71. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/router_manager.py +0 -0
  72. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/core/states.py +0 -0
  73. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/creation/__init__.py +0 -0
  74. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/creation/bot_builder.py +0 -0
  75. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/creation/bot_testing.py +0 -0
  76. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/dashboard/__init__.py +0 -0
  77. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/event/__init__.py +0 -0
  78. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/integrations/openai_client.py +0 -0
  79. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/integrations/supabase_client.py +0 -0
  80. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/message/__init__.py +0 -0
  81. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/router/__init__.py +0 -0
  82. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/setup_checker.py +0 -0
  83. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/supabase/__init__.py +0 -0
  84. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/supabase/client.py +0 -0
  85. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/utils/__init__.py +0 -0
  86. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/utils/debug_routing.py +0 -0
  87. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/utils/prompt_loader.py +0 -0
  88. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/utils/user_prompt_loader.py +0 -0
  89. {smart_bot_factory-0.3.6 → smart_bot_factory-0.3.7}/smart_bot_factory/utm_link_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-bot-factory
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Библиотека для создания умных чат-ботов
5
5
  Author-email: Kopatych <eserov73@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smart-bot-factory"
3
- version = "0.3.6"
3
+ version = "0.3.7"
4
4
  description = "Библиотека для создания умных чат-ботов"
5
5
  authors = [
6
6
  {name = "Kopatych", email = "eserov73@gmail.com"}
@@ -255,6 +255,10 @@ async def process_events(session_id: str, events: list, user_id: int) -> bool:
255
255
  # if session_id:
256
256
  # check_query = check_query.eq('session_id', session_id)
257
257
 
258
+ # 🆕 Фильтруем по bot_id если указан
259
+ if supabase_client.bot_id:
260
+ check_query = check_query.eq('bot_id', supabase_client.bot_id)
261
+
258
262
  existing = check_query.execute()
259
263
 
260
264
  logger.info(f" 🔍 Проверка БД: найдено {len(existing.data) if existing.data else 0} выполненных событий '{event_type}' для user_id={user_id}")
@@ -291,6 +295,11 @@ async def process_events(session_id: str, events: list, user_id: int) -> bool:
291
295
  'result_data': __import__('json').dumps(result, ensure_ascii=False) if result else None,
292
296
  'info_dashboard': info_dashboard_json # Добавится только если есть поле 'info'
293
297
  }
298
+
299
+ # 🆕 Добавляем bot_id если указан
300
+ if supabase_client.bot_id:
301
+ event_record['bot_id'] = supabase_client.bot_id
302
+
294
303
  response = supabase_client.client.table('scheduled_events').insert(event_record).execute()
295
304
  event_id = response.data[0]['id']
296
305
 
@@ -311,6 +320,11 @@ async def process_events(session_id: str, events: list, user_id: int) -> bool:
311
320
  'session_id': session_id,
312
321
  'last_error': str(e)
313
322
  }
323
+
324
+ # 🆕 Добавляем bot_id если указан
325
+ if supabase_client.bot_id:
326
+ event_record['bot_id'] = supabase_client.bot_id
327
+
314
328
  supabase_client.client.table('scheduled_events').insert(event_record).execute()
315
329
  raise
316
330
 
@@ -1135,6 +1135,10 @@ async def save_immediate_event(
1135
1135
  'session_id': session_id
1136
1136
  }
1137
1137
 
1138
+ # 🆕 Добавляем bot_id если указан
1139
+ if supabase_client.bot_id:
1140
+ event_record['bot_id'] = supabase_client.bot_id
1141
+
1138
1142
  try:
1139
1143
  response = supabase_client.client.table('scheduled_events').insert(event_record).execute()
1140
1144
  event_id = response.data[0]['id']
@@ -1187,6 +1191,10 @@ async def save_scheduled_task(
1187
1191
  'session_id': session_id
1188
1192
  }
1189
1193
 
1194
+ # 🆕 Добавляем bot_id если указан
1195
+ if supabase_client.bot_id:
1196
+ event_record['bot_id'] = supabase_client.bot_id
1197
+
1190
1198
  try:
1191
1199
  response = supabase_client.client.table('scheduled_events').insert(event_record).execute()
1192
1200
  event_id = response.data[0]['id']
@@ -1241,6 +1249,10 @@ async def save_global_event(
1241
1249
  'status': status
1242
1250
  }
1243
1251
 
1252
+ # 🆕 Добавляем bot_id если указан (глобальные события тоже привязаны к боту)
1253
+ if supabase_client.bot_id:
1254
+ event_record['bot_id'] = supabase_client.bot_id
1255
+
1244
1256
  try:
1245
1257
  response = supabase_client.client.table('scheduled_events').insert(event_record).execute()
1246
1258
  event_id = response.data[0]['id']
@@ -1303,13 +1315,18 @@ async def get_pending_events(limit: int = 50) -> list:
1303
1315
  try:
1304
1316
  now = datetime.now(timezone.utc).isoformat()
1305
1317
 
1306
- response = supabase_client.client.table('scheduled_events')\
1318
+ query = supabase_client.client.table('scheduled_events')\
1307
1319
  .select('*')\
1308
1320
  .in_('status', ['pending', 'immediate'])\
1309
1321
  .or_(f'scheduled_at.is.null,scheduled_at.lte.{now}')\
1310
1322
  .order('created_at')\
1311
- .limit(limit)\
1312
- .execute()
1323
+ .limit(limit)
1324
+
1325
+ # 🆕 Фильтруем по bot_id если указан
1326
+ if supabase_client.bot_id:
1327
+ query = query.eq('bot_id', supabase_client.bot_id)
1328
+
1329
+ response = query.execute()
1313
1330
 
1314
1331
  return response.data
1315
1332
  except Exception as e:
@@ -1328,13 +1345,18 @@ async def get_pending_events_in_next_minute(limit: int = 100) -> list:
1328
1345
  now = datetime.now(timezone.utc)
1329
1346
  next_minute = now + timedelta(seconds=60)
1330
1347
 
1331
- response = supabase_client.client.table('scheduled_events')\
1348
+ query = supabase_client.client.table('scheduled_events')\
1332
1349
  .select('*')\
1333
1350
  .in_('status', ['pending', 'immediate'])\
1334
1351
  .or_(f'scheduled_at.is.null,scheduled_at.lte.{next_minute.isoformat()}')\
1335
1352
  .order('created_at')\
1336
- .limit(limit)\
1337
- .execute()
1353
+ .limit(limit)
1354
+
1355
+ # 🆕 Фильтруем по bot_id если указан
1356
+ if supabase_client.bot_id:
1357
+ query = query.eq('bot_id', supabase_client.bot_id)
1358
+
1359
+ response = query.execute()
1338
1360
 
1339
1361
  return response.data
1340
1362
  except Exception as e:
@@ -1705,6 +1727,10 @@ async def check_event_already_processed(event_type: str, user_id: int = None, se
1705
1727
  if session_id:
1706
1728
  query = query.eq('session_id', session_id)
1707
1729
 
1730
+ # 🆕 Фильтруем по bot_id если указан
1731
+ if supabase_client.bot_id:
1732
+ query = query.eq('bot_id', supabase_client.bot_id)
1733
+
1708
1734
  response = query.execute()
1709
1735
 
1710
1736
  if response.data:
@@ -77,14 +77,26 @@ async def timeup_handler(message: Message, state: FSMContext):
77
77
 
78
78
  # Получаем события для этого пользователя И глобальные события (user_id = null)
79
79
  # 1. События пользователя
80
- user_events = supabase_client.client.table('scheduled_events').select(
80
+ user_events_query = supabase_client.client.table('scheduled_events').select(
81
81
  '*'
82
- ).eq('user_id', message.from_user.id).in_('status', ['pending', 'immediate']).execute()
82
+ ).eq('user_id', message.from_user.id).in_('status', ['pending', 'immediate'])
83
+
84
+ # 🆕 Фильтруем по bot_id если указан
85
+ if supabase_client.bot_id:
86
+ user_events_query = user_events_query.eq('bot_id', supabase_client.bot_id)
87
+
88
+ user_events = user_events_query.execute()
83
89
 
84
90
  # 2. Глобальные события (без user_id)
85
- global_events = supabase_client.client.table('scheduled_events').select(
91
+ global_events_query = supabase_client.client.table('scheduled_events').select(
86
92
  '*'
87
- ).is_('user_id', 'null').in_('status', ['pending', 'immediate']).execute()
93
+ ).is_('user_id', 'null').in_('status', ['pending', 'immediate'])
94
+
95
+ # 🆕 Фильтруем по bot_id если указан
96
+ if supabase_client.bot_id:
97
+ global_events_query = global_events_query.eq('bot_id', supabase_client.bot_id)
98
+
99
+ global_events = global_events_query.execute()
88
100
 
89
101
  # Объединяем события
90
102
  all_events = (user_events.data or []) + (global_events.data or [])
@@ -1637,7 +1637,7 @@ wheels = [
1637
1637
 
1638
1638
  [[package]]
1639
1639
  name = "smart-bot-factory"
1640
- version = "0.3.5"
1640
+ version = "0.3.6"
1641
1641
  source = { editable = "." }
1642
1642
  dependencies = [
1643
1643
  { name = "aiofiles" },