smart-bot-factory 0.1.3__py3-none-any.whl → 0.1.5__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/__init__.py +0 -48
- smart_bot_factory/admin/admin_logic.py +11 -11
- smart_bot_factory/cli.py +299 -106
- smart_bot_factory/clients/__init__.py +33 -0
- smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +2 -0
- smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +95 -28
- smart_bot_factory/core/__init__.py +43 -22
- smart_bot_factory/core/bot_utils.py +268 -95
- smart_bot_factory/core/conversation_manager.py +542 -535
- smart_bot_factory/core/decorators.py +943 -229
- smart_bot_factory/core/globals.py +68 -0
- smart_bot_factory/core/message_sender.py +6 -6
- smart_bot_factory/core/router.py +172 -0
- smart_bot_factory/core/router_manager.py +165 -0
- smart_bot_factory/creation/__init__.py +1 -2
- smart_bot_factory/creation/bot_builder.py +116 -8
- smart_bot_factory/creation/bot_testing.py +74 -13
- smart_bot_factory/handlers/handlers.py +10 -2
- smart_bot_factory/integrations/__init__.py +1 -0
- smart_bot_factory/integrations/supabase_client.py +272 -2
- smart_bot_factory/utm_link_generator.py +106 -0
- smart_bot_factory-0.1.5.dist-info/METADATA +466 -0
- {smart_bot_factory-0.1.3.dist-info → smart_bot_factory-0.1.5.dist-info}/RECORD +26 -31
- smart_bot_factory/configs/growthmed-helper/env_example.txt +0 -1
- smart_bot_factory/configs/growthmed-helper/prompts/1sales_context.txt +0 -9
- smart_bot_factory/configs/growthmed-helper/prompts/2product_info.txt +0 -582
- smart_bot_factory/configs/growthmed-helper/prompts/3objection_handling.txt +0 -66
- smart_bot_factory/configs/growthmed-helper/prompts/final_instructions.txt +0 -232
- smart_bot_factory/configs/growthmed-helper/prompts/help_message.txt +0 -28
- smart_bot_factory/configs/growthmed-helper/prompts/welcome_message.txt +0 -7
- smart_bot_factory/configs/growthmed-helper/welcome_file/welcome_file_msg.txt +0 -16
- smart_bot_factory/configs/growthmed-helper/welcome_file//342/225/250/320/267/342/225/250/342/225/241/342/225/250/342/225/221 /342/225/250/342/225/227/342/225/250/342/225/225/342/225/244/320/221/342/225/244/320/222 /342/225/250/342/224/220/342/225/250/342/225/233 152/342/225/250/320/264/342/225/250/320/247 /342/225/250/342/225/225 323/342/225/250/320/264/342/225/250/320/247 /342/225/250/342/224/244/342/225/250/342/225/227/342/225/244/320/237 /342/225/250/342/225/235/342/225/250/342/225/241/342/225/250/342/224/244/342/225/250/342/225/225/342/225/244/320/226/342/225/250/342/225/225/342/225/250/342/225/234/342/225/244/320/233.pdf +0 -0
- smart_bot_factory/uv.lock +0 -2004
- smart_bot_factory-0.1.3.dist-info/METADATA +0 -126
- {smart_bot_factory-0.1.3.dist-info → smart_bot_factory-0.1.5.dist-info}/WHEEL +0 -0
- {smart_bot_factory-0.1.3.dist-info → smart_bot_factory-0.1.5.dist-info}/entry_points.txt +0 -0
- {smart_bot_factory-0.1.3.dist-info → smart_bot_factory-0.1.5.dist-info}/licenses/LICENSE +0 -0
smart_bot_factory/__init__.py
CHANGED
|
@@ -1,51 +1,3 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Smart Bot Factory - библиотека для создания умных чат-ботов
|
|
3
3
|
"""
|
|
4
|
-
|
|
5
|
-
from .creation.bot_builder import BotBuilder
|
|
6
|
-
from .core.decorators import event_handler, schedule_task
|
|
7
|
-
from .core.message_sender import send_message_by_ai, send_message_by_human
|
|
8
|
-
from .config import Config
|
|
9
|
-
from .integrations.openai_client import OpenAIClient
|
|
10
|
-
from .integrations.supabase_client import SupabaseClient
|
|
11
|
-
from .core.conversation_manager import ConversationManager
|
|
12
|
-
from .admin.admin_manager import AdminManager
|
|
13
|
-
from .utils.prompt_loader import PromptLoader
|
|
14
|
-
from .handlers.handlers import setup_handlers
|
|
15
|
-
from .admin.admin_logic import setup_admin_handlers
|
|
16
|
-
from .core.bot_utils import setup_utils_handlers, parse_ai_response, process_events
|
|
17
|
-
from .utils.debug_routing import setup_debug_handlers
|
|
18
|
-
from .core.states import UserStates, AdminStates
|
|
19
|
-
from .creation.bot_testing import main as bot_testing_main
|
|
20
|
-
from .analytics.analytics_manager import AnalyticsManager
|
|
21
|
-
from .admin.timeout_checker import check_timeouts, setup_bot_environment
|
|
22
|
-
from .setup_checker import check_setup
|
|
23
|
-
from .admin.admin_tester import test_admin_system
|
|
24
|
-
|
|
25
|
-
__all__ = [
|
|
26
|
-
'BotBuilder',
|
|
27
|
-
'event_handler',
|
|
28
|
-
'schedule_task',
|
|
29
|
-
'send_message_by_ai',
|
|
30
|
-
'send_message_by_human',
|
|
31
|
-
'Config',
|
|
32
|
-
'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',
|
|
51
|
-
]
|
|
@@ -22,7 +22,7 @@ def setup_admin_handlers(dp):
|
|
|
22
22
|
|
|
23
23
|
async def admin_start_handler(message: Message, state: FSMContext):
|
|
24
24
|
"""Обработчик /start для админов в режиме администратора"""
|
|
25
|
-
from handlers import get_global_var
|
|
25
|
+
from ..handlers.handlers import get_global_var
|
|
26
26
|
admin_manager = get_global_var('admin_manager')
|
|
27
27
|
|
|
28
28
|
await state.set_state(AdminStates.admin_mode)
|
|
@@ -55,7 +55,7 @@ async def admin_start_handler(message: Message, state: FSMContext):
|
|
|
55
55
|
@admin_router.message(Command("стат"))
|
|
56
56
|
async def admin_stats_handler(message: Message, state: FSMContext):
|
|
57
57
|
"""Статистика воронки"""
|
|
58
|
-
from handlers import get_global_var
|
|
58
|
+
from ..handlers.handlers import get_global_var
|
|
59
59
|
admin_manager = get_global_var('admin_manager')
|
|
60
60
|
analytics_manager = get_global_var('analytics_manager')
|
|
61
61
|
|
|
@@ -82,7 +82,7 @@ async def admin_stats_handler(message: Message, state: FSMContext):
|
|
|
82
82
|
@admin_router.message(Command("история"))
|
|
83
83
|
async def admin_history_handler(message: Message, state: FSMContext):
|
|
84
84
|
"""История пользователя"""
|
|
85
|
-
from handlers import get_global_var
|
|
85
|
+
from ..handlers.handlers import get_global_var
|
|
86
86
|
admin_manager = get_global_var('admin_manager')
|
|
87
87
|
analytics_manager = get_global_var('analytics_manager')
|
|
88
88
|
|
|
@@ -118,7 +118,7 @@ async def admin_history_handler(message: Message, state: FSMContext):
|
|
|
118
118
|
@admin_router.message(Command("чат"))
|
|
119
119
|
async def admin_chat_handler(message: Message, state: FSMContext):
|
|
120
120
|
"""Начать диалог с пользователем"""
|
|
121
|
-
from handlers import get_global_var
|
|
121
|
+
from ..handlers.handlers import get_global_var
|
|
122
122
|
|
|
123
123
|
admin_manager = get_global_var('admin_manager')
|
|
124
124
|
supabase_client = get_global_var('supabase_client')
|
|
@@ -173,7 +173,7 @@ async def admin_chat_handler(message: Message, state: FSMContext):
|
|
|
173
173
|
@admin_router.message(Command("чаты"))
|
|
174
174
|
async def admin_active_chats_command(message: Message, state: FSMContext):
|
|
175
175
|
"""Показать активные диалоги админов"""
|
|
176
|
-
from handlers import get_global_var
|
|
176
|
+
from ..handlers.handlers import get_global_var
|
|
177
177
|
admin_manager = get_global_var('admin_manager')
|
|
178
178
|
conversation_manager = get_global_var('conversation_manager')
|
|
179
179
|
|
|
@@ -194,7 +194,7 @@ async def admin_active_chats_command(message: Message, state: FSMContext):
|
|
|
194
194
|
@admin_router.message(Command("стоп"))
|
|
195
195
|
async def admin_stop_handler(message: Message, state: FSMContext):
|
|
196
196
|
"""Завершить диалог"""
|
|
197
|
-
from handlers import get_global_var
|
|
197
|
+
from ..handlers.handlers import get_global_var
|
|
198
198
|
admin_manager = get_global_var('admin_manager')
|
|
199
199
|
conversation_manager = get_global_var('conversation_manager')
|
|
200
200
|
|
|
@@ -233,9 +233,9 @@ async def admin_stop_handler(message: Message, state: FSMContext):
|
|
|
233
233
|
@admin_router.message(Command("админ"))
|
|
234
234
|
async def admin_toggle_handler(message: Message, state: FSMContext):
|
|
235
235
|
"""Переключение режима админа"""
|
|
236
|
-
from handlers import get_global_var
|
|
236
|
+
from ..handlers.handlers import get_global_var
|
|
237
237
|
admin_manager = get_global_var('admin_manager')
|
|
238
|
-
from .handlers import user_start_handler
|
|
238
|
+
from ..handlers.handlers import user_start_handler
|
|
239
239
|
|
|
240
240
|
if not admin_manager.is_admin(message.from_user.id):
|
|
241
241
|
return
|
|
@@ -253,7 +253,7 @@ async def admin_toggle_handler(message: Message, state: FSMContext):
|
|
|
253
253
|
@admin_router.message(Command("debug_chat"))
|
|
254
254
|
async def debug_chat_handler(message: Message, state: FSMContext):
|
|
255
255
|
"""Отладка диалогов админов"""
|
|
256
|
-
from handlers import get_global_var
|
|
256
|
+
from ..handlers.handlers import get_global_var
|
|
257
257
|
admin_manager = get_global_var('admin_manager')
|
|
258
258
|
conversation_manager = get_global_var('conversation_manager')
|
|
259
259
|
supabase_client = get_global_var('supabase_client')
|
|
@@ -304,7 +304,7 @@ async def debug_chat_handler(message: Message, state: FSMContext):
|
|
|
304
304
|
@admin_router.callback_query(F.data.startswith("admin_"))
|
|
305
305
|
async def admin_callback_handler(callback: CallbackQuery, state: FSMContext):
|
|
306
306
|
"""Обработчик callback кнопок админов"""
|
|
307
|
-
from handlers import get_global_var
|
|
307
|
+
from ..handlers.handlers import get_global_var
|
|
308
308
|
admin_manager = get_global_var('admin_manager')
|
|
309
309
|
analytics_manager = get_global_var('analytics_manager')
|
|
310
310
|
conversation_manager = get_global_var('conversation_manager')
|
|
@@ -394,7 +394,7 @@ async def admin_callback_handler(callback: CallbackQuery, state: FSMContext):
|
|
|
394
394
|
@admin_router.message(StateFilter(AdminStates.admin_mode, AdminStates.in_conversation))
|
|
395
395
|
async def admin_message_handler(message: Message, state: FSMContext):
|
|
396
396
|
"""Обработчик сообщений админов"""
|
|
397
|
-
from handlers import get_global_var
|
|
397
|
+
from ..handlers.handlers import get_global_var
|
|
398
398
|
admin_manager = get_global_var('admin_manager')
|
|
399
399
|
conversation_manager = get_global_var('conversation_manager')
|
|
400
400
|
|