Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,11 +59,23 @@ def generate_answer_with_groq(question, context, retries=3, delay=2):
|
|
59 |
"Authorization": f"Bearer {api_key}",
|
60 |
"Content-Type": "application/json",
|
61 |
}
|
62 |
-
prompt =
|
|
|
|
|
|
|
|
|
63 |
payload = {
|
64 |
"model": "llama3-8b-8192",
|
65 |
"messages": [
|
66 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
{"role": "user", "content": prompt},
|
68 |
],
|
69 |
"temperature": 0.5,
|
|
|
59 |
"Authorization": f"Bearer {api_key}",
|
60 |
"Content-Type": "application/json",
|
61 |
}
|
62 |
+
prompt = (
|
63 |
+
f"Customer asked: '{question}'\n\n"
|
64 |
+
f"Here is the relevant product or policy info to help:\n{context}\n\n"
|
65 |
+
f"Respond in a friendly and helpful tone as a toy shop support agent."
|
66 |
+
)
|
67 |
payload = {
|
68 |
"model": "llama3-8b-8192",
|
69 |
"messages": [
|
70 |
+
{
|
71 |
+
"role": "system",
|
72 |
+
"content": (
|
73 |
+
"You are ToyBot, a friendly and helpful WhatsApp assistant for an online toy shop. "
|
74 |
+
"Your goal is to politely answer customer questions, help them choose the right toys, "
|
75 |
+
"provide order or delivery information, explain return policies, and guide them through purchases. "
|
76 |
+
"Always sound warm, helpful, and trustworthy like a professional customer support agent."
|
77 |
+
)
|
78 |
+
},
|
79 |
{"role": "user", "content": prompt},
|
80 |
],
|
81 |
"temperature": 0.5,
|