Upload 3 files
Browse files- app.py +5 -8
- user_profiles.json +7 -6
app.py
CHANGED
@@ -9,10 +9,7 @@ from twilio.twiml.messaging_response import MessagingResponse
|
|
9 |
|
10 |
# Yeni modüller - Enhanced Features
|
11 |
from prompts import get_prompt_content_only
|
12 |
-
|
13 |
-
initialize_whatsapp_features, handle_whatsapp_comparison_request,
|
14 |
-
handle_whatsapp_budget_request, handle_whatsapp_category_request
|
15 |
-
)
|
16 |
from whatsapp_renderer import extract_product_info_whatsapp
|
17 |
from whatsapp_passive_profiler import (
|
18 |
analyze_user_message, get_user_profile_summary, get_personalized_recommendations
|
@@ -197,7 +194,7 @@ try:
|
|
197 |
print(f" Products listesi: {len(products)} ürün")
|
198 |
|
199 |
# Enhanced features'ı başlat
|
200 |
-
initialize_whatsapp_features(products)
|
201 |
print("✅ WhatsApp enhanced features başlatıldı")
|
202 |
|
203 |
if marlin_count == 0:
|
@@ -346,17 +343,17 @@ def process_whatsapp_message_with_memory(user_message, phone_number):
|
|
346 |
return extract_product_info_whatsapp(custom_response)
|
347 |
|
348 |
# Enhanced features kontrolü - önce bunları kontrol et
|
349 |
-
comparison_result = handle_whatsapp_comparison_request(user_message)
|
350 |
if comparison_result:
|
351 |
return extract_product_info_whatsapp(comparison_result)
|
352 |
|
353 |
# Kategori+Bütçe kombinasyonu önce kontrol edilsin
|
354 |
-
category_result = handle_whatsapp_category_request(user_message, phone_number)
|
355 |
if category_result:
|
356 |
return extract_product_info_whatsapp(category_result)
|
357 |
|
358 |
# Sadece bütçe kontrolü
|
359 |
-
budget_result = handle_whatsapp_budget_request(user_message)
|
360 |
if budget_result:
|
361 |
return extract_product_info_whatsapp(budget_result)
|
362 |
|
|
|
9 |
|
10 |
# Yeni modüller - Enhanced Features
|
11 |
from prompts import get_prompt_content_only
|
12 |
+
import whatsapp_features # Global değişkenler için module import
|
|
|
|
|
|
|
13 |
from whatsapp_renderer import extract_product_info_whatsapp
|
14 |
from whatsapp_passive_profiler import (
|
15 |
analyze_user_message, get_user_profile_summary, get_personalized_recommendations
|
|
|
194 |
print(f" Products listesi: {len(products)} ürün")
|
195 |
|
196 |
# Enhanced features'ı başlat
|
197 |
+
whatsapp_features.initialize_whatsapp_features(products)
|
198 |
print("✅ WhatsApp enhanced features başlatıldı")
|
199 |
|
200 |
if marlin_count == 0:
|
|
|
343 |
return extract_product_info_whatsapp(custom_response)
|
344 |
|
345 |
# Enhanced features kontrolü - önce bunları kontrol et
|
346 |
+
comparison_result = whatsapp_features.handle_whatsapp_comparison_request(user_message)
|
347 |
if comparison_result:
|
348 |
return extract_product_info_whatsapp(comparison_result)
|
349 |
|
350 |
# Kategori+Bütçe kombinasyonu önce kontrol edilsin
|
351 |
+
category_result = whatsapp_features.handle_whatsapp_category_request(user_message, phone_number)
|
352 |
if category_result:
|
353 |
return extract_product_info_whatsapp(category_result)
|
354 |
|
355 |
# Sadece bütçe kontrolü
|
356 |
+
budget_result = whatsapp_features.handle_whatsapp_budget_request(user_message)
|
357 |
if budget_result:
|
358 |
return extract_product_info_whatsapp(budget_result)
|
359 |
|
user_profiles.json
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
{
|
2 |
"+905551234567": {
|
3 |
"created_at": "2025-07-15 19:19:13.653674",
|
4 |
-
"last_updated": "2025-07-15 19:
|
5 |
-
"total_messages":
|
6 |
"preferences": {
|
7 |
-
"budget_min":
|
8 |
-
"budget_max":
|
9 |
"categories": [
|
10 |
-
"dağ_bisikleti"
|
|
|
11 |
],
|
12 |
"usage_purpose": [],
|
13 |
"size_info": {
|
@@ -31,7 +32,7 @@
|
|
31 |
},
|
32 |
"statistics": {
|
33 |
"comparison_requests": 1,
|
34 |
-
"budget_queries":
|
35 |
"technical_questions": 0,
|
36 |
"price_questions": 2,
|
37 |
"availability_questions": 0
|
|
|
1 |
{
|
2 |
"+905551234567": {
|
3 |
"created_at": "2025-07-15 19:19:13.653674",
|
4 |
+
"last_updated": "2025-07-15 19:53:48.584394",
|
5 |
+
"total_messages": 9,
|
6 |
"preferences": {
|
7 |
+
"budget_min": 244999,
|
8 |
+
"budget_max": 350000,
|
9 |
"categories": [
|
10 |
+
"dağ_bisikleti",
|
11 |
+
"yol_bisikleti"
|
12 |
],
|
13 |
"usage_purpose": [],
|
14 |
"size_info": {
|
|
|
32 |
},
|
33 |
"statistics": {
|
34 |
"comparison_requests": 1,
|
35 |
+
"budget_queries": 2,
|
36 |
"technical_questions": 0,
|
37 |
"price_questions": 2,
|
38 |
"availability_questions": 0
|