smart-bot-factory 0.3.2__py3-none-any.whl → 0.3.4__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/admin/__init__.py +2 -0
- smart_bot_factory/admin/admin_events.py +932 -0
- smart_bot_factory/admin/admin_logic.py +59 -12
- smart_bot_factory/aiogram_calendar/__init__.py +6 -0
- smart_bot_factory/aiogram_calendar/common.py +70 -0
- smart_bot_factory/aiogram_calendar/dialog_calendar.py +197 -0
- smart_bot_factory/aiogram_calendar/schemas.py +78 -0
- smart_bot_factory/aiogram_calendar/simple_calendar.py +180 -0
- smart_bot_factory/analytics/analytics_manager.py +42 -5
- smart_bot_factory/cli.py +1 -1
- smart_bot_factory/core/bot_utils.py +17 -16
- smart_bot_factory/core/decorators.py +218 -4
- smart_bot_factory/core/states.py +12 -0
- smart_bot_factory/creation/bot_builder.py +54 -2
- smart_bot_factory/handlers/handlers.py +10 -3
- smart_bot_factory/integrations/supabase_client.py +422 -37
- smart_bot_factory/utm_link_generator.py +13 -3
- {smart_bot_factory-0.3.2.dist-info → smart_bot_factory-0.3.4.dist-info}/METADATA +3 -1
- {smart_bot_factory-0.3.2.dist-info → smart_bot_factory-0.3.4.dist-info}/RECORD +22 -18
- smart_bot_factory/table/database_structure.sql +0 -57
- smart_bot_factory/table/schema.sql +0 -1094
- {smart_bot_factory-0.3.2.dist-info → smart_bot_factory-0.3.4.dist-info}/WHEEL +0 -0
- {smart_bot_factory-0.3.2.dist-info → smart_bot_factory-0.3.4.dist-info}/entry_points.txt +0 -0
- {smart_bot_factory-0.3.2.dist-info → smart_bot_factory-0.3.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
smart_bot_factory/__init__.py,sha256=W5k9awLVi0R_N3fSul7VNkKRdSfExZjNb_M2yNzepg8,102
|
|
2
|
-
smart_bot_factory/cli.py,sha256=
|
|
2
|
+
smart_bot_factory/cli.py,sha256=eQ2fv0uc87nrm1b-lRRw0Tz52NquCcwkk2it__beNKU,33223
|
|
3
3
|
smart_bot_factory/config.py,sha256=kB3G2hGMrrCSOAvlrddf8x43bgfgEaQqOCKOeELAzfM,11640
|
|
4
4
|
smart_bot_factory/setup_checker.py,sha256=fqRzyptyMzcb2I0boUaj0rWLdarqaN6ViX6suwTEeWc,20123
|
|
5
|
-
smart_bot_factory/utm_link_generator.py,sha256=
|
|
6
|
-
smart_bot_factory/admin/__init__.py,sha256=
|
|
7
|
-
smart_bot_factory/admin/
|
|
5
|
+
smart_bot_factory/utm_link_generator.py,sha256=wYPdYYK555YfOP22eJXAcEv_D66_t50Dhg0-wkLVzVk,4502
|
|
6
|
+
smart_bot_factory/admin/__init__.py,sha256=vdsMTpt_LiXkY-awFu_X9e2Zt7CV50PwmsWkFbk6whk,488
|
|
7
|
+
smart_bot_factory/admin/admin_events.py,sha256=QCosyTbJgrU8daWSK_bQgf8UZoJSIrV6xyO0R3XV2j0,43289
|
|
8
|
+
smart_bot_factory/admin/admin_logic.py,sha256=vPkNk86bdPsjNUNlZ3qfKtbRr9UuJy2oG54cYUGGNmg,23107
|
|
8
9
|
smart_bot_factory/admin/admin_manager.py,sha256=xlyG9mIjPmtUhS4E9lp36T7o5Kfp5PZpJ-r1QjnSn5g,6394
|
|
9
10
|
smart_bot_factory/admin/admin_migration.sql,sha256=kleMPJBSe2Z7ZZz7rNyOX_yoh4GZivGesqAX90U5PGs,5667
|
|
10
11
|
smart_bot_factory/admin/admin_tester.py,sha256=PGFpf7fmD5Wxea31xR2ZM_A_QpvrB73gsbxvUrHQBkg,6463
|
|
11
12
|
smart_bot_factory/admin/timeout_checker.py,sha256=TzA2FGrxwE8fuhKerGnGrt4qYMEZdIR8x3SQAnIW5YQ,24490
|
|
12
|
-
smart_bot_factory/
|
|
13
|
+
smart_bot_factory/aiogram_calendar/__init__.py,sha256=_IzB_HJIZuMs__7xBBsYVG20GbRNFw2VowvhOEyiGGc,349
|
|
14
|
+
smart_bot_factory/aiogram_calendar/common.py,sha256=Ik-ler6Hid11SHpphqfFs5FjvGhj8Ajz0ds-MWMjPoo,2659
|
|
15
|
+
smart_bot_factory/aiogram_calendar/dialog_calendar.py,sha256=AVuIWPp4D8ri7N7aSNqfZ_SicbfYGvQWeJqSmakGkuE,8289
|
|
16
|
+
smart_bot_factory/aiogram_calendar/schemas.py,sha256=y2jnnFuqOqLZ7PwY6WQrzmRgCE6rwFYUGTFYaQnCouM,2524
|
|
17
|
+
smart_bot_factory/aiogram_calendar/simple_calendar.py,sha256=XmCFjrDNJZ9LNEGkbY1vqRbU9t2EgIk69tGg5xy2sfE,7859
|
|
18
|
+
smart_bot_factory/analytics/analytics_manager.py,sha256=y1DI_TnAdSX5NG_mwqHD1emne4opfsyo50D_tebi_UA,17967
|
|
13
19
|
smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt,sha256=uJ4WviYIr9xJaFdu-APrrmBgIWVwdJymcN04upIviLY,1614
|
|
14
20
|
smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt,sha256=tWP9gdn58vu9BhYpDx1lGuPNT24j5p1XPiCSD-CdXiU,24191
|
|
15
21
|
smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt,sha256=zwUGKp3mp1dAQUPjLQsCsczwRJJOqn9GGvVzVBCpvfY,6985
|
|
@@ -24,32 +30,30 @@ smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml,sh
|
|
|
24
30
|
smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml,sha256=bzDulOU4a2LyWlcHzlQU8GYhOky2WTfyizGfjX4ioMY,2436
|
|
25
31
|
smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt,sha256=Db21Mm0r8SBWFdX9EeIF2FZtLQ2cvuwVlSRJd2KEYCg,922
|
|
26
32
|
smart_bot_factory/configs/growthmed-october-24/welcome_file/Чек лист по 152ФЗ и 323ФЗ для медицины.pdf,sha256=BiAiQHNnQXJPMsks9AeL6s0beEjRFkRMJLMlAn4WorA,5284954
|
|
27
|
-
smart_bot_factory/core/bot_utils.py,sha256=
|
|
33
|
+
smart_bot_factory/core/bot_utils.py,sha256=Be334BPspBgHNO9OpEiPlrCc0Gmy7_8sox5WpV8XHic,45174
|
|
28
34
|
smart_bot_factory/core/conversation_manager.py,sha256=eoHL7MCEz68DRvTVwRwZgf2PWwGv4T6J9D-I-thETi8,28289
|
|
29
|
-
smart_bot_factory/core/decorators.py,sha256=
|
|
35
|
+
smart_bot_factory/core/decorators.py,sha256=oSsX1yCULoUfVf2aNynBmvap7zDEh5-cEcW4yoRv3dc,93903
|
|
30
36
|
smart_bot_factory/core/message_sender.py,sha256=J4b6n8nXVjqf-qzL6URRSvc-FVnQfShwujVSM6qv26w,32232
|
|
31
37
|
smart_bot_factory/core/router.py,sha256=03fbysaj0LR96p4-8iiml8dTmEHCkR-AaTposSv8q8o,11898
|
|
32
38
|
smart_bot_factory/core/router_manager.py,sha256=dUwesog-oHk1U2EDdS8p0e4MTSkwtx5_qXn6nrJ9l9I,9700
|
|
33
|
-
smart_bot_factory/core/states.py,sha256=
|
|
39
|
+
smart_bot_factory/core/states.py,sha256=L8qp1UmYFuxTN5U9tY076rDuKgxtFbpSGqBpva2eWbo,895
|
|
34
40
|
smart_bot_factory/creation/__init__.py,sha256=IgDk8GDS3pg7Pw_Et41J33ZmeZIU5dRwQdTmYKXfJfE,128
|
|
35
|
-
smart_bot_factory/creation/bot_builder.py,sha256=
|
|
41
|
+
smart_bot_factory/creation/bot_builder.py,sha256=yGRmOPD7qCMbhcBiltHWISoKxWx8eqjDSnZXpwhqnUs,43115
|
|
36
42
|
smart_bot_factory/creation/bot_testing.py,sha256=JDWXyJfZmbgo-DLdAPk8Sd9FiehtHHa4sLD17lBrTOc,55669
|
|
37
43
|
smart_bot_factory/event/__init__.py,sha256=hPL449RULIOB-OXv1ZbGNiHctAYaOMUqhSWGPrDHYBM,212
|
|
38
|
-
smart_bot_factory/handlers/handlers.py,sha256=
|
|
44
|
+
smart_bot_factory/handlers/handlers.py,sha256=ymPCQPjA0uQc9deiwiVrMhxpBsqdKsAfeajHzK74seA,60739
|
|
39
45
|
smart_bot_factory/integrations/openai_client.py,sha256=fwaJpwojFdLBWChcFWpFGOHK9upG-nCIwDochkCRRlY,24291
|
|
40
|
-
smart_bot_factory/integrations/supabase_client.py,sha256=
|
|
46
|
+
smart_bot_factory/integrations/supabase_client.py,sha256=Rv0sZHXGSfm3UWodmaR1N-X5-2JbmynPWJKY0a0k_Tk,63557
|
|
41
47
|
smart_bot_factory/message/__init__.py,sha256=-ehDZweUc3uKgmLLxFVsD-KWrDtnHpHms7pCrDelWo0,1950
|
|
42
48
|
smart_bot_factory/router/__init__.py,sha256=5gEbpG3eylOyow5NmidzGUy0K-AZq7RhYLVu9OaUT6c,270
|
|
43
49
|
smart_bot_factory/supabase/__init__.py,sha256=XmZP6yM9ffERM5ddAWyJnrNzEhCYtMu3AcjVCi1rOf8,179
|
|
44
50
|
smart_bot_factory/supabase/client.py,sha256=lWIzfOgoSvU7xPhYLoJtM5GnbWdoWsvHcRFC22sFBMU,25637
|
|
45
|
-
smart_bot_factory/table/database_structure.sql,sha256=26gFtMC2jdQGQF7Zb_F4Br56rMd4hUDTk9FkNZYneLo,2789
|
|
46
|
-
smart_bot_factory/table/schema.sql,sha256=-6kOmA9QnSkUtmGI2iQRbTvbdiqOhEOQcuz1lJn79mU,28059
|
|
47
51
|
smart_bot_factory/utils/__init__.py,sha256=UhsJXEHfrIK8h1AHsroHSwAriijk-LvnqLyvgzi2VYs,273
|
|
48
52
|
smart_bot_factory/utils/debug_routing.py,sha256=BOoDhKBg7UXe5uHQxRk3TSfPfLPOFqt0N7lAo6kjCOo,4719
|
|
49
53
|
smart_bot_factory/utils/prompt_loader.py,sha256=JSn7CsWnToSbHYtURdeuZn7ectyDqQGrPGHN2ixIGkw,19930
|
|
50
54
|
smart_bot_factory/utils/user_prompt_loader.py,sha256=dk6P0X_3UcNqxjRtuIvb0LcPrp03zIIsstZwdmeCPaE,2519
|
|
51
|
-
smart_bot_factory-0.3.
|
|
52
|
-
smart_bot_factory-0.3.
|
|
53
|
-
smart_bot_factory-0.3.
|
|
54
|
-
smart_bot_factory-0.3.
|
|
55
|
-
smart_bot_factory-0.3.
|
|
55
|
+
smart_bot_factory-0.3.4.dist-info/METADATA,sha256=lO_csJRkPwV6c8SUmBUEN4WBl9X8LTx_lSt_FALl6J0,31991
|
|
56
|
+
smart_bot_factory-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
smart_bot_factory-0.3.4.dist-info/entry_points.txt,sha256=ybKEAI0WSb7WoRiey7QE-HHfn88UGV7nxLDxXq7b7SU,50
|
|
58
|
+
smart_bot_factory-0.3.4.dist-info/licenses/LICENSE,sha256=OrK3cwdUTzNzIhJvSPtJaVMoYIyC_sSx5EFE_FDMvGs,1092
|
|
59
|
+
smart_bot_factory-0.3.4.dist-info/RECORD,,
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
-- Исправленная структура базы данных для чат-бота с поддержкой множественных ботов
|
|
2
|
-
|
|
3
|
-
-- Таблица пользователей
|
|
4
|
-
CREATE TABLE IF NOT EXISTS sales_users (
|
|
5
|
-
id BIGSERIAL PRIMARY KEY,
|
|
6
|
-
telegram_id BIGINT NOT NULL,
|
|
7
|
-
bot_id TEXT NOT NULL, -- 🆕 Идентификатор бота
|
|
8
|
-
username TEXT,
|
|
9
|
-
first_name TEXT,
|
|
10
|
-
last_name TEXT,
|
|
11
|
-
language_code TEXT,
|
|
12
|
-
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
|
13
|
-
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
|
14
|
-
is_active BOOLEAN DEFAULT TRUE,
|
|
15
|
-
UNIQUE(telegram_id, bot_id) -- 🆕 Уникальность по пользователю + боту
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
-- Таблица сессий чата
|
|
19
|
-
CREATE TABLE IF NOT EXISTS sales_chat_sessions (
|
|
20
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
21
|
-
user_id BIGINT NOT NULL,
|
|
22
|
-
bot_id TEXT NOT NULL, -- 🆕 Идентификатор бота
|
|
23
|
-
system_prompt TEXT NOT NULL,
|
|
24
|
-
status TEXT DEFAULT 'active' CHECK (status IN ('active', 'completed', 'archived')),
|
|
25
|
-
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
|
26
|
-
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
|
27
|
-
metadata JSONB DEFAULT '{}'::jsonb,
|
|
28
|
-
FOREIGN KEY (user_id, bot_id) REFERENCES sales_users(telegram_id, bot_id) ON DELETE CASCADE
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
-- Остальные таблицы без изменений, так как они ссылаются на сессии
|
|
32
|
-
|
|
33
|
-
-- Обновляем индексы
|
|
34
|
-
CREATE INDEX IF NOT EXISTS idx_sales_users_telegram_bot ON sales_users(telegram_id, bot_id);
|
|
35
|
-
CREATE INDEX IF NOT EXISTS idx_sales_users_bot_id ON sales_users(bot_id);
|
|
36
|
-
CREATE INDEX IF NOT EXISTS idx_sales_chat_sessions_bot_id ON sales_chat_sessions(bot_id);
|
|
37
|
-
CREATE INDEX IF NOT EXISTS idx_sales_chat_sessions_user_bot ON sales_chat_sessions(user_id, bot_id);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-- Обновляем политики RLS
|
|
41
|
-
DROP POLICY IF EXISTS "Users can view their own data" ON sales_users;
|
|
42
|
-
CREATE POLICY "Users can view their own data" ON sales_users
|
|
43
|
-
FOR SELECT USING (
|
|
44
|
-
telegram_id = current_setting('app.current_user_id')::bigint
|
|
45
|
-
AND bot_id = current_setting('app.current_bot_id')
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
DROP POLICY IF EXISTS "Users can view their own sessions" ON sales_chat_sessions;
|
|
49
|
-
CREATE POLICY "Users can view their own sessions" ON sales_chat_sessions
|
|
50
|
-
FOR SELECT USING (
|
|
51
|
-
user_id = current_setting('app.current_user_id')::bigint
|
|
52
|
-
AND bot_id = current_setting('app.current_bot_id')
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
-- Комментарии
|
|
56
|
-
COMMENT ON COLUMN sales_users.bot_id IS 'Идентификатор бота (имя запускалки без .py)';
|
|
57
|
-
COMMENT ON COLUMN sales_chat_sessions.bot_id IS 'Идентификатор бота для разделения данных между ботами';
|