smart-bot-factory 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl

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 (45) hide show
  1. smart_bot_factory/admin/__init__.py +7 -7
  2. smart_bot_factory/admin/admin_events.py +483 -383
  3. smart_bot_factory/admin/admin_logic.py +234 -158
  4. smart_bot_factory/admin/admin_manager.py +68 -53
  5. smart_bot_factory/admin/admin_tester.py +46 -40
  6. smart_bot_factory/admin/timeout_checker.py +201 -153
  7. smart_bot_factory/aiogram_calendar/__init__.py +11 -3
  8. smart_bot_factory/aiogram_calendar/common.py +12 -18
  9. smart_bot_factory/aiogram_calendar/dialog_calendar.py +126 -64
  10. smart_bot_factory/aiogram_calendar/schemas.py +49 -28
  11. smart_bot_factory/aiogram_calendar/simple_calendar.py +94 -50
  12. smart_bot_factory/analytics/analytics_manager.py +414 -392
  13. smart_bot_factory/cli.py +204 -148
  14. smart_bot_factory/config.py +123 -102
  15. smart_bot_factory/core/bot_utils.py +474 -332
  16. smart_bot_factory/core/conversation_manager.py +287 -200
  17. smart_bot_factory/core/decorators.py +1200 -755
  18. smart_bot_factory/core/message_sender.py +287 -266
  19. smart_bot_factory/core/router.py +170 -100
  20. smart_bot_factory/core/router_manager.py +121 -83
  21. smart_bot_factory/core/states.py +4 -3
  22. smart_bot_factory/creation/__init__.py +1 -1
  23. smart_bot_factory/creation/bot_builder.py +320 -242
  24. smart_bot_factory/creation/bot_testing.py +440 -365
  25. smart_bot_factory/dashboard/__init__.py +1 -3
  26. smart_bot_factory/event/__init__.py +2 -7
  27. smart_bot_factory/handlers/handlers.py +676 -472
  28. smart_bot_factory/integrations/openai_client.py +218 -168
  29. smart_bot_factory/integrations/supabase_client.py +948 -637
  30. smart_bot_factory/message/__init__.py +18 -22
  31. smart_bot_factory/router/__init__.py +2 -2
  32. smart_bot_factory/setup_checker.py +162 -126
  33. smart_bot_factory/supabase/__init__.py +1 -1
  34. smart_bot_factory/supabase/client.py +631 -515
  35. smart_bot_factory/utils/__init__.py +2 -3
  36. smart_bot_factory/utils/debug_routing.py +38 -27
  37. smart_bot_factory/utils/prompt_loader.py +153 -120
  38. smart_bot_factory/utils/user_prompt_loader.py +55 -56
  39. smart_bot_factory/utm_link_generator.py +123 -116
  40. {smart_bot_factory-0.3.7.dist-info → smart_bot_factory-0.3.9.dist-info}/METADATA +3 -1
  41. smart_bot_factory-0.3.9.dist-info/RECORD +59 -0
  42. smart_bot_factory-0.3.7.dist-info/RECORD +0 -59
  43. {smart_bot_factory-0.3.7.dist-info → smart_bot_factory-0.3.9.dist-info}/WHEEL +0 -0
  44. {smart_bot_factory-0.3.7.dist-info → smart_bot_factory-0.3.9.dist-info}/entry_points.txt +0 -0
  45. {smart_bot_factory-0.3.7.dist-info → smart_bot_factory-0.3.9.dist-info}/licenses/LICENSE +0 -0
@@ -2,45 +2,41 @@
2
2
  Message модули smart_bot_factory
3
3
  """
4
4
 
5
-
6
- from ..core.message_sender import (
7
- send_message_by_human,
8
- send_message_by_ai,
9
- send_message_to_users_by_stage,
10
- send_message,
11
- )
5
+ from ..core.message_sender import (send_message, send_message_by_ai,
6
+ send_message_by_human,
7
+ send_message_to_users_by_stage)
12
8
 
13
9
 
14
10
  def get_bot():
15
11
  """
16
12
  Получает aiogram Bot из глобального контекста
17
-
13
+
18
14
  Доступен после вызова bot_builder.start()
19
-
15
+
20
16
  Returns:
21
17
  Bot: aiogram Bot объект
22
-
18
+
23
19
  Raises:
24
20
  RuntimeError: Если bot еще не инициализирован
25
-
21
+
26
22
  Example:
27
23
  from smart_bot_factory.message import get_bot
28
-
24
+
29
25
  @event_router.event_handler("booking")
30
26
  async def handle_booking(user_id: int, event_data: str):
31
27
  bot = get_bot()
32
-
28
+
33
29
  # Получаем информацию о пользователе из Telegram
34
30
  telegram_user = await bot.get_chat(user_id)
35
31
  name = telegram_user.first_name or 'Клиент'
36
-
32
+
37
33
  # Используем любые методы aiogram Bot
38
34
  await bot.send_message(user_id, f"Привет, {name}!")
39
35
  await bot.send_photo(user_id, photo=...)
40
36
  """
41
37
  from ..handlers.handlers import get_global_var
42
-
43
- bot = get_global_var('bot')
38
+
39
+ bot = get_global_var("bot")
44
40
  if not bot:
45
41
  raise RuntimeError(
46
42
  "Bot еще не инициализирован. "
@@ -52,9 +48,9 @@ def get_bot():
52
48
 
53
49
 
54
50
  __all__ = [
55
- 'send_message_by_human',
56
- 'send_message_by_ai',
57
- 'send_message_to_users_by_stage',
58
- 'send_message', # Чистая отправка с файлами и кнопками
59
- 'get_bot', # Доступ к aiogram Bot
60
- ]
51
+ "send_message_by_human",
52
+ "send_message_by_ai",
53
+ "send_message_to_users_by_stage",
54
+ "send_message", # Чистая отправка с файлами и кнопками
55
+ "get_bot", # Доступ к aiogram Bot
56
+ ]
@@ -5,6 +5,6 @@ Router модули smart_bot_factory
5
5
  from ..core.router import EventRouter
6
6
 
7
7
  __all__ = [
8
- 'EventRouter', # Роутер для событий (бизнес-логика)
8
+ "EventRouter", # Роутер для событий (бизнес-логика)
9
9
  # Для Telegram используйте aiogram.Router напрямую
10
- ]
10
+ ]