Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ class Agent1:
|
|
30 |
rephrase_prompt = PromptTemplate(
|
31 |
input_variables=["query"],
|
32 |
template="""
|
33 |
-
|
34 |
-
If the query contains multiple distinct questions, split them.
|
35 |
Provide ONLY the rephrased queries, one per line. Do not include any explanations or additional text.
|
36 |
|
37 |
Query: {query}
|
@@ -264,8 +264,9 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
264 |
{context}
|
265 |
Original Question: {question}
|
266 |
If the web search results don't contain relevant information, state that the information is not available in the search results.
|
267 |
-
Provide a
|
268 |
Do not include any source information in your answer.
|
|
|
269 |
"""
|
270 |
|
271 |
prompt_val = ChatPromptTemplate.from_template(prompt_template)
|
@@ -277,8 +278,9 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
277 |
r"Provide a concise and direct answer to the question without mentioning the web search or these instructions:",
|
278 |
r"Provide a concise and direct answer to the question:",
|
279 |
r"Answer:",
|
280 |
-
r"Provide a
|
281 |
-
r"Do not include any source information in your answer."
|
|
|
282 |
]
|
283 |
|
284 |
for pattern in answer_patterns:
|
@@ -326,8 +328,9 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
326 |
{context}
|
327 |
Current Question: {question}
|
328 |
If the context doesn't contain relevant information, state that the information is not available.
|
329 |
-
Provide a
|
330 |
Do not include any source information in your answer.
|
|
|
331 |
"""
|
332 |
|
333 |
prompt_val = ChatPromptTemplate.from_template(prompt_template)
|
@@ -339,8 +342,9 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search):
|
|
339 |
r"Provide a concise and direct answer to the question without mentioning the web search or these instructions:",
|
340 |
r"Provide a concise and direct answer to the question:",
|
341 |
r"Answer:",
|
342 |
-
r"Provide a
|
343 |
-
r"Do not include any source information in your answer."
|
|
|
344 |
]
|
345 |
|
346 |
for pattern in answer_patterns:
|
|
|
30 |
rephrase_prompt = PromptTemplate(
|
31 |
input_variables=["query"],
|
32 |
template="""
|
33 |
+
Determine how many queries are made within the query made by the user, if the user has asked just one question rephrase the given questio one concise, search-engine-friendly formats.
|
34 |
+
If the query contains multiple distinct questions, split them and rephrase those multiple queries into concise, search engine friendly formats.
|
35 |
Provide ONLY the rephrased queries, one per line. Do not include any explanations or additional text.
|
36 |
|
37 |
Query: {query}
|
|
|
264 |
{context}
|
265 |
Original Question: {question}
|
266 |
If the web search results don't contain relevant information, state that the information is not available in the search results.
|
267 |
+
Provide a summarized and direct answer to the original question without mentioning the web search or these instructions.
|
268 |
Do not include any source information in your answer.
|
269 |
+
Do not give the information in pointers where its not neccesary the format must be relevant to the query made.
|
270 |
"""
|
271 |
|
272 |
prompt_val = ChatPromptTemplate.from_template(prompt_template)
|
|
|
278 |
r"Provide a concise and direct answer to the question without mentioning the web search or these instructions:",
|
279 |
r"Provide a concise and direct answer to the question:",
|
280 |
r"Answer:",
|
281 |
+
r"Provide a summarized and direct answer to the original question without mentioning the web search or these instructions:",
|
282 |
+
r"Do not include any source information in your answer.",
|
283 |
+
r"Do not give the information in pointers where its not neccesary the format must be relevant to the query made."
|
284 |
]
|
285 |
|
286 |
for pattern in answer_patterns:
|
|
|
328 |
{context}
|
329 |
Current Question: {question}
|
330 |
If the context doesn't contain relevant information, state that the information is not available.
|
331 |
+
Provide a summarized and direct answer to the question.
|
332 |
Do not include any source information in your answer.
|
333 |
+
Do not give the information in pointers where its not neccesary the format must be relevant to the query made.
|
334 |
"""
|
335 |
|
336 |
prompt_val = ChatPromptTemplate.from_template(prompt_template)
|
|
|
342 |
r"Provide a concise and direct answer to the question without mentioning the web search or these instructions:",
|
343 |
r"Provide a concise and direct answer to the question:",
|
344 |
r"Answer:",
|
345 |
+
r"Provide a summarized and direct answer to the original question without mentioning the web search or these instructions:",
|
346 |
+
r"Do not include any source information in your answer.",
|
347 |
+
r"Do not give the information in pointers where its not neccesary the format must be relevant to the query made."
|
348 |
]
|
349 |
|
350 |
for pattern in answer_patterns:
|