Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -606,6 +606,9 @@ def generate_personalized_sms_wrapper(selected_product, description, product_nam
|
|
606 |
cut_sms_1 = cut_message(sms_1)
|
607 |
checks_1 = perform_checks(cut_sms_1, key_message, exceptions_dict)
|
608 |
checks_formatted_1 = format_checks(checks_1)
|
|
|
|
|
|
|
609 |
|
610 |
print("[DEBUG] exceptions_dict['word_repetitions'] =", exceptions_dict.get("word_repetitions"))
|
611 |
|
@@ -617,6 +620,9 @@ def generate_personalized_sms_wrapper(selected_product, description, product_nam
|
|
617 |
cut_sms_2 = cut_message(sms_2)
|
618 |
checks_2 = perform_checks(cut_sms_2, key_message, exceptions_dict)
|
619 |
checks_formatted_2 = format_checks(checks_2)
|
|
|
|
|
|
|
620 |
|
621 |
personalization_params = [gender, generation, psychotype, business_stage, industry, opf]
|
622 |
save_user_request_to_github(selected_product, description, product_name, benefits, key_message, chosen_approach, personalization_params)
|
@@ -671,6 +677,9 @@ def on_regenerate(
|
|
671 |
chosen_sms="none" # <-- признак, что ни одно SMS не выбрано
|
672 |
)
|
673 |
|
|
|
|
|
|
|
674 |
yield sms_1, sms_2, checks_formatted_1, checks_formatted_2
|
675 |
|
676 |
def on_load_previous():
|
@@ -1860,8 +1869,15 @@ def attempt_generate_sms_with_checks(model_prompt: str, product_name: str, key_m
|
|
1860 |
"""
|
1861 |
sms = generate_message(model_prompt, product_name)
|
1862 |
cut_sms = cut_message(sms)
|
1863 |
-
|
1864 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1865 |
|
1866 |
|
1867 |
def generate_sms_with_timer(model_prompt: str, product_name: str, key_message: str, max_time_sec=90):
|
|
|
606 |
cut_sms_1 = cut_message(sms_1)
|
607 |
checks_1 = perform_checks(cut_sms_1, key_message, exceptions_dict)
|
608 |
checks_formatted_1 = format_checks(checks_1)
|
609 |
+
|
610 |
+
print("[DEBUG B] final checks_1 =>", checks_1)
|
611 |
+
print("[DEBUG B] final checks_formatted_1 =>", checks_formatted_1)
|
612 |
|
613 |
print("[DEBUG] exceptions_dict['word_repetitions'] =", exceptions_dict.get("word_repetitions"))
|
614 |
|
|
|
620 |
cut_sms_2 = cut_message(sms_2)
|
621 |
checks_2 = perform_checks(cut_sms_2, key_message, exceptions_dict)
|
622 |
checks_formatted_2 = format_checks(checks_2)
|
623 |
+
|
624 |
+
print("[DEBUG B] final checks_2 =>", checks_2)
|
625 |
+
print("[DEBUG B] final checks_formatted_2 =>", checks_formatted_2)
|
626 |
|
627 |
personalization_params = [gender, generation, psychotype, business_stage, industry, opf]
|
628 |
save_user_request_to_github(selected_product, description, product_name, benefits, key_message, chosen_approach, personalization_params)
|
|
|
677 |
chosen_sms="none" # <-- признак, что ни одно SMS не выбрано
|
678 |
)
|
679 |
|
680 |
+
print("[DEBUG B2] final checks_1 =>", checks_1)
|
681 |
+
print("[DEBUG B2] final checks_2 =>", checks_2)
|
682 |
+
|
683 |
yield sms_1, sms_2, checks_formatted_1, checks_formatted_2
|
684 |
|
685 |
def on_load_previous():
|
|
|
1869 |
"""
|
1870 |
sms = generate_message(model_prompt, product_name)
|
1871 |
cut_sms = cut_message(sms)
|
1872 |
+
|
1873 |
+
print("[DEBUG A] attempt_generate_sms_with_checks => sms full:", repr(sms))
|
1874 |
+
print("[DEBUG A] attempt_generate_sms_with_checks => sms cut:", repr(cut_sms))
|
1875 |
+
# Посмотрим key_message
|
1876 |
+
print("[DEBUG A] attempt_generate_sms_with_checks => key_message:", repr(key_message))
|
1877 |
+
|
1878 |
+
all_critical_ok, failed_non_crit = run_checks_critical_and_non_critical(cut_sms, key_message)
|
1879 |
+
print("[DEBUG A] => all_critical_ok=", all_critical_ok, "failed_non_crit=", failed_non_crit)
|
1880 |
+
return sms, all_critical_ok, failed_non_crit
|
1881 |
|
1882 |
|
1883 |
def generate_sms_with_timer(model_prompt: str, product_name: str, key_message: str, max_time_sec=90):
|