Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -254,12 +254,20 @@ def createVectorDB(documents,embeddingModelID):
|
|
254 |
# return vectordb
|
255 |
|
256 |
def createPrompt(cName, cCity, custDetailsPresent):
|
257 |
-
cProfile = "Customer's Name is " + cName + "\nCustomer's lives in or customer's Resident State or Customer's place is " + cCity + "\n"
|
|
|
258 |
print(cProfile)
|
259 |
|
260 |
-
template1 = """You role is of a Professional Customer Support Executive and your name is Jio AIAssist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
You are talking to the below customer whose information is provided in block delimited by <cp></cp>.
|
262 |
-
Use the
|
263 |
If you are unable to answer the question using the context provided, just say that you don't know, don't try to make up an answer.
|
264 |
Use the customer information to replace entities in the question before answering\n
|
265 |
\n"""
|
@@ -274,7 +282,8 @@ def createPrompt(cName, cCity, custDetailsPresent):
|
|
274 |
Question: {question}
|
275 |
Answer: """
|
276 |
|
277 |
-
prompt_template = template1 + "<cp>\n" + cProfile + "\n</cp>\n" + template2
|
|
|
278 |
PROMPT = PromptTemplate(template=prompt_template, input_variables=["history", "context", "question"])
|
279 |
return PROMPT
|
280 |
|
|
|
254 |
# return vectordb
|
255 |
|
256 |
def createPrompt(cName, cCity, custDetailsPresent):
|
257 |
+
#cProfile = "Customer's Name is " + cName + "\nCustomer's lives in or customer's Resident State or Customer's place is " + cCity + "\n"
|
258 |
+
cProfile = "Customer's Name is " + cName + "\nCustomer's lives in the city of " + cCity + "\n"
|
259 |
print(cProfile)
|
260 |
|
261 |
+
# template1 = """You role is of a Professional Customer Support Executive and your name is Jio AIAssist.
|
262 |
+
# You are talking to the below customer whose information is provided in block delimited by <cp></cp>.
|
263 |
+
# Use the following customer related information (delimited by <cp></cp>) and context (delimited by <ctx></ctx>) to answer the question at the end by thinking step by step alongwith reaonsing steps:
|
264 |
+
# If you are unable to answer the question using the context provided, just say that you don't know, don't try to make up an answer.
|
265 |
+
# Use the customer information to replace entities in the question before answering\n
|
266 |
+
# \n"""
|
267 |
+
|
268 |
+
template1 = """You role is of a Professional Customer Support Executive and your name is Jio AIAssist.
|
269 |
You are talking to the below customer whose information is provided in block delimited by <cp></cp>.
|
270 |
+
Use the context (delimited by <ctx></ctx>) to answer the question at the end by thinking step by step alongwith reaonsing steps:
|
271 |
If you are unable to answer the question using the context provided, just say that you don't know, don't try to make up an answer.
|
272 |
Use the customer information to replace entities in the question before answering\n
|
273 |
\n"""
|
|
|
282 |
Question: {question}
|
283 |
Answer: """
|
284 |
|
285 |
+
#prompt_template = template1 + "<cp>\n" + cProfile + "\n</cp>\n" + template2
|
286 |
+
prompt_template = template1 + "You are talking to the following customer. <cp>\n" + cProfile + "\n</cp>\n" + template2
|
287 |
PROMPT = PromptTemplate(template=prompt_template, input_variables=["history", "context", "question"])
|
288 |
return PROMPT
|
289 |
|