Spaces:
Runtime error
Runtime error
fix err in prompt
Browse files
app.py
CHANGED
@@ -160,7 +160,7 @@ def chat_response(user_msg, chat_history, system_prompt,
|
|
160 |
if search_results:
|
161 |
|
162 |
enriched = system_prompt.strip() + \
|
163 |
-
'''# The following contents are the search results related to the user's message:
|
164 |
{search_results}
|
165 |
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
|
166 |
When responding, please keep the following points in mind:
|
@@ -174,7 +174,7 @@ When responding, please keep the following points in mind:
|
|
174 |
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
|
175 |
- Unless the user requests otherwise, your response should be in the same language as the user's question.
|
176 |
# The user's message is:
|
177 |
-
|
178 |
else:
|
179 |
enriched = system_prompt
|
180 |
|
@@ -191,7 +191,7 @@ When responding, please keep the following points in mind:
|
|
191 |
# merge fetched snippets into the system prompt
|
192 |
if search_results:
|
193 |
enriched = system_prompt.strip() + \
|
194 |
-
'''# The following contents are the search results related to the user's message:
|
195 |
{search_results}
|
196 |
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
|
197 |
When responding, please keep the following points in mind:
|
@@ -205,7 +205,7 @@ When responding, please keep the following points in mind:
|
|
205 |
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
|
206 |
- Unless the user requests otherwise, your response should be in the same language as the user's question.
|
207 |
# The user's message is:
|
208 |
-
|
209 |
else:
|
210 |
enriched = system_prompt
|
211 |
|
|
|
160 |
if search_results:
|
161 |
|
162 |
enriched = system_prompt.strip() + \
|
163 |
+
f'''# The following contents are the search results related to the user's message:
|
164 |
{search_results}
|
165 |
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
|
166 |
When responding, please keep the following points in mind:
|
|
|
174 |
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
|
175 |
- Unless the user requests otherwise, your response should be in the same language as the user's question.
|
176 |
# The user's message is:
|
177 |
+
'''
|
178 |
else:
|
179 |
enriched = system_prompt
|
180 |
|
|
|
191 |
# merge fetched snippets into the system prompt
|
192 |
if search_results:
|
193 |
enriched = system_prompt.strip() + \
|
194 |
+
f'''# The following contents are the search results related to the user's message:
|
195 |
{search_results}
|
196 |
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
|
197 |
When responding, please keep the following points in mind:
|
|
|
205 |
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
|
206 |
- Unless the user requests otherwise, your response should be in the same language as the user's question.
|
207 |
# The user's message is:
|
208 |
+
'''
|
209 |
else:
|
210 |
enriched = system_prompt
|
211 |
|