smart-bot-factory 0.1.5__py3-none-any.whl → 0.1.7__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.
- smart_bot_factory/cli.py +28 -33
- smart_bot_factory/core/bot_utils.py +28 -55
- smart_bot_factory/core/decorators.py +25 -41
- smart_bot_factory/core/message_sender.py +0 -5
- smart_bot_factory/core/router.py +2 -1
- smart_bot_factory/core/router_manager.py +1 -0
- smart_bot_factory/creation/bot_builder.py +9 -27
- smart_bot_factory/event/__init__.py +12 -0
- smart_bot_factory/message/__init__.py +12 -0
- smart_bot_factory/router/__init__.py +9 -0
- smart_bot_factory/supabase/__init__.py +7 -0
- smart_bot_factory/supabase/client.py +524 -0
- {smart_bot_factory-0.1.5.dist-info → smart_bot_factory-0.1.7.dist-info}/METADATA +1 -1
- {smart_bot_factory-0.1.5.dist-info → smart_bot_factory-0.1.7.dist-info}/RECORD +17 -17
- smart_bot_factory/analytics/__init__.py +0 -7
- smart_bot_factory/clients/__init__.py +0 -33
- smart_bot_factory/core/__init__.py +0 -43
- smart_bot_factory/core/globals.py +0 -68
- smart_bot_factory/integrations/__init__.py +0 -10
- {smart_bot_factory-0.1.5.dist-info → smart_bot_factory-0.1.7.dist-info}/WHEEL +0 -0
- {smart_bot_factory-0.1.5.dist-info → smart_bot_factory-0.1.7.dist-info}/entry_points.txt +0 -0
- {smart_bot_factory-0.1.5.dist-info → smart_bot_factory-0.1.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Core модули smart_bot_factory
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
# Импортируем основные компоненты для удобства
|
|
6
|
-
from .globals import (
|
|
7
|
-
get_supabase_client,
|
|
8
|
-
get_openai_client,
|
|
9
|
-
get_config,
|
|
10
|
-
get_admin_manager,
|
|
11
|
-
get_analytics_manager,
|
|
12
|
-
get_conversation_manager,
|
|
13
|
-
get_prompt_loader,
|
|
14
|
-
get_bot,
|
|
15
|
-
get_dp
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
from .decorators import event_handler, schedule_task, global_handler
|
|
19
|
-
from .message_sender import send_message_by_human
|
|
20
|
-
from .router import Router
|
|
21
|
-
from .router_manager import RouterManager
|
|
22
|
-
|
|
23
|
-
__all__ = [
|
|
24
|
-
# Функции получения (для внутреннего использования)
|
|
25
|
-
'get_supabase_client',
|
|
26
|
-
'get_openai_client',
|
|
27
|
-
'get_config',
|
|
28
|
-
'get_admin_manager',
|
|
29
|
-
'get_analytics_manager',
|
|
30
|
-
'get_conversation_manager',
|
|
31
|
-
'get_prompt_loader',
|
|
32
|
-
'get_bot',
|
|
33
|
-
'get_dp',
|
|
34
|
-
# Декораторы
|
|
35
|
-
'event_handler',
|
|
36
|
-
'schedule_task',
|
|
37
|
-
'global_handler',
|
|
38
|
-
# Роутеры
|
|
39
|
-
'Router',
|
|
40
|
-
'RouterManager',
|
|
41
|
-
# Утилиты
|
|
42
|
-
'send_message_by_human'
|
|
43
|
-
]
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Глобальные переменные для удобного доступа к компонентам бота
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from typing import Optional
|
|
6
|
-
from ..integrations.supabase_client import SupabaseClient
|
|
7
|
-
from ..integrations.openai_client import OpenAIClient
|
|
8
|
-
from ..config import Config
|
|
9
|
-
from ..admin.admin_manager import AdminManager
|
|
10
|
-
from ..analytics.analytics_manager import AnalyticsManager
|
|
11
|
-
from ..core.conversation_manager import ConversationManager
|
|
12
|
-
from ..utils.prompt_loader import PromptLoader
|
|
13
|
-
|
|
14
|
-
# Глобальные переменные (будут установлены при инициализации бота)
|
|
15
|
-
supabase_client: Optional[SupabaseClient] = None
|
|
16
|
-
openai_client: Optional[OpenAIClient] = None
|
|
17
|
-
config: Optional[Config] = None
|
|
18
|
-
admin_manager: Optional[AdminManager] = None
|
|
19
|
-
analytics_manager: Optional[AnalyticsManager] = None
|
|
20
|
-
conversation_manager: Optional[ConversationManager] = None
|
|
21
|
-
prompt_loader: Optional[PromptLoader] = None
|
|
22
|
-
bot: Optional[object] = None # aiogram Bot
|
|
23
|
-
dp: Optional[object] = None # aiogram Dispatcher
|
|
24
|
-
|
|
25
|
-
def set_globals(**kwargs):
|
|
26
|
-
"""Устанавливает глобальные переменные"""
|
|
27
|
-
global supabase_client, openai_client, config, admin_manager
|
|
28
|
-
global analytics_manager, conversation_manager, prompt_loader, bot, dp
|
|
29
|
-
|
|
30
|
-
for key, value in kwargs.items():
|
|
31
|
-
if key in globals():
|
|
32
|
-
globals()[key] = value
|
|
33
|
-
|
|
34
|
-
def get_supabase_client() -> Optional[SupabaseClient]:
|
|
35
|
-
"""Получает клиент Supabase"""
|
|
36
|
-
return supabase_client
|
|
37
|
-
|
|
38
|
-
def get_openai_client() -> Optional[OpenAIClient]:
|
|
39
|
-
"""Получает клиент OpenAI"""
|
|
40
|
-
return openai_client
|
|
41
|
-
|
|
42
|
-
def get_config() -> Optional[Config]:
|
|
43
|
-
"""Получает конфигурацию"""
|
|
44
|
-
return config
|
|
45
|
-
|
|
46
|
-
def get_admin_manager() -> Optional[AdminManager]:
|
|
47
|
-
"""Получает менеджер админов"""
|
|
48
|
-
return admin_manager
|
|
49
|
-
|
|
50
|
-
def get_analytics_manager() -> Optional[AnalyticsManager]:
|
|
51
|
-
"""Получает менеджер аналитики"""
|
|
52
|
-
return analytics_manager
|
|
53
|
-
|
|
54
|
-
def get_conversation_manager() -> Optional[ConversationManager]:
|
|
55
|
-
"""Получает менеджер разговоров"""
|
|
56
|
-
return conversation_manager
|
|
57
|
-
|
|
58
|
-
def get_prompt_loader() -> Optional[PromptLoader]:
|
|
59
|
-
"""Получает загрузчик промптов"""
|
|
60
|
-
return prompt_loader
|
|
61
|
-
|
|
62
|
-
def get_bot() -> Optional[object]:
|
|
63
|
-
"""Получает экземпляр бота"""
|
|
64
|
-
return bot
|
|
65
|
-
|
|
66
|
-
def get_dp() -> Optional[object]:
|
|
67
|
-
"""Получает диспетчер"""
|
|
68
|
-
return dp
|
|
File without changes
|
|
File without changes
|
|
File without changes
|