Spaces:
Paused
Paused
Commit
·
f681159
1
Parent(s):
fb29f30
Update app.py
Browse files
app.py
CHANGED
@@ -25,10 +25,9 @@ openai.api_key = os.environ.get("OPENAI_KEY")
|
|
25 |
|
26 |
template = """Answer the question based on the context below.
|
27 |
|
28 |
-
Context: You are Lisa, a loyal helpful service agent, appointed for SuperFoods Petcare Company.
|
29 |
-
No introduction required.
|
30 |
Your goal ask one question at a time and provide a friendly conversational responses to the customer.
|
31 |
-
For Product Complaint: Ask questions about product they purchased, when they bought it, what issue occured with it.
|
32 |
For Returns: Ask for the cause of return, if not asked aready, then tell him about the 10-day return policy, after which it's non-returnable.
|
33 |
For Refunds: Ask about the product issues and the mode of refund he wants, clarify him the refunds will happen within 2-3 business days.
|
34 |
A case for will be created for all scenarios, and the caller will be notified over Email or WhatsApp.
|
@@ -143,7 +142,7 @@ def get_case_summary(conv_detail):
|
|
143 |
#case_desc = chatresponse_desc.choices[0].message.content
|
144 |
chatresponse_desc = openai.Completion.create(
|
145 |
model = 'text-davinci-003',
|
146 |
-
prompt = '
|
147 |
temperature = 0,
|
148 |
top_p =1,
|
149 |
best_of=1,
|
@@ -166,7 +165,7 @@ def get_case_subject(conv_detail):
|
|
166 |
#case_subj = chatresponse_subj.choices[0].message.content
|
167 |
chatresponse_subj = openai.Completion.create(
|
168 |
model = 'text-davinci-003',
|
169 |
-
prompt = 'Summarise the conversation between an agent and customer in
|
170 |
temperature = 0,
|
171 |
top_p =1,
|
172 |
best_of=1,
|
|
|
25 |
|
26 |
template = """Answer the question based on the context below.
|
27 |
|
28 |
+
Context: You are Lisa, a loyal helpful service agent, appointed for SuperFoods Petcare Company.
|
|
|
29 |
Your goal ask one question at a time and provide a friendly conversational responses to the customer.
|
30 |
+
For Product Complaint: Ask questions about the product they have purchased, when they bought it, what issue occured with it.
|
31 |
For Returns: Ask for the cause of return, if not asked aready, then tell him about the 10-day return policy, after which it's non-returnable.
|
32 |
For Refunds: Ask about the product issues and the mode of refund he wants, clarify him the refunds will happen within 2-3 business days.
|
33 |
A case for will be created for all scenarios, and the caller will be notified over Email or WhatsApp.
|
|
|
142 |
#case_desc = chatresponse_desc.choices[0].message.content
|
143 |
chatresponse_desc = openai.Completion.create(
|
144 |
model = 'text-davinci-003',
|
145 |
+
prompt = 'You need to summarise the problem as told by the customer. Remember to keep the Product Name and other key points discussed from the conversation.Here is the conversation between service agent and the customer: ' + conv_detail,
|
146 |
temperature = 0,
|
147 |
top_p =1,
|
148 |
best_of=1,
|
|
|
165 |
#case_subj = chatresponse_subj.choices[0].message.content
|
166 |
chatresponse_subj = openai.Completion.create(
|
167 |
model = 'text-davinci-003',
|
168 |
+
prompt = 'Summarise the conversation between an agent and customer in 10 words mentioned below for Case Subject. Here is the conversation: ' + conv_detail,
|
169 |
temperature = 0,
|
170 |
top_p =1,
|
171 |
best_of=1,
|