Update app.py
Browse files
app.py
CHANGED
@@ -32,11 +32,17 @@ def format_prompt(message, history):
|
|
32 |
# Introduction (replace placeholders with actual content if needed)
|
33 |
prompt += f"""**Introduction:**
|
34 |
|
35 |
-
|
36 |
-
to understand customer preferences for recently purchased items.
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
\n"""
|
41 |
|
42 |
# Add past conversation history
|
@@ -48,14 +54,14 @@ def format_prompt(message, history):
|
|
48 |
|
49 |
# Prompt continuation based on current survey stage
|
50 |
# (Replace with your logic to determine the next question based on history)
|
51 |
-
current_question = len(history) + 1
|
52 |
-
if current_question == 1:
|
53 |
-
|
54 |
-
elif current_question == 2:
|
55 |
-
|
56 |
-
# ... Add logic for remaining questions (3-13) ...
|
57 |
-
else:
|
58 |
-
|
59 |
|
60 |
prompt += "\n[/INST]</s>" # Closing prompt and tags
|
61 |
|
|
|
32 |
# Introduction (replace placeholders with actual content if needed)
|
33 |
prompt += f"""**Introduction:**
|
34 |
|
35 |
+
Your are the friendly AI assistant, Your responsibility to perform product survey by asking few questions about user recent purchased item. Like the example scenario for phone purchases follow up survey questions your friendly AI assistant. I'm conducting a product survey
|
36 |
+
to understand customer preferences for recently purchased items. start responding with formal greeting and ask user for recent products purchase.
|
37 |
+
|
38 |
+
**Conclusion:**
|
39 |
+
Thank you for taking the time to participate in this survey! Your feedback is valuable and will help manufacturers understand customer preferences and improve their products.
|
40 |
+
|
41 |
+
|
42 |
+
**Asking Questions (One at a Time):**
|
43 |
+
* Feel free to rephrase or clarify the questions based on my answers.
|
44 |
+
|
45 |
+
* Acknowledge my feedback and show appreciation for my participation.
|
46 |
\n"""
|
47 |
|
48 |
# Add past conversation history
|
|
|
54 |
|
55 |
# Prompt continuation based on current survey stage
|
56 |
# (Replace with your logic to determine the next question based on history)
|
57 |
+
# current_question = len(history) + 1
|
58 |
+
# if current_question == 1:
|
59 |
+
# prompt += "1. What type of phone did you purchase (brand and model)?"
|
60 |
+
# elif current_question == 2:
|
61 |
+
# prompt += "2. Where did you buy your phone from (online store or physical store)?"
|
62 |
+
# # ... Add logic for remaining questions (3-13) ...
|
63 |
+
# else:
|
64 |
+
# prompt += "Thank you for your participation! The survey is now complete."
|
65 |
|
66 |
prompt += "\n[/INST]</s>" # Closing prompt and tags
|
67 |
|