File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ def ai_summarize(text, url=None):
162
162
print ("No MISTRAL_API_KEY set. Returning first 15 words as summary." )
163
163
return limit_to_n_words (text , 15 )
164
164
prompt = (
165
+ "If the original text is in Chinese, first translate it to English, then summarize. "
165
166
"Summarize the following web page content in clear, concise English. "
166
167
"Focus on the single most important point or insight. "
167
168
"Your summary should be around 300 characters. "
@@ -188,7 +189,7 @@ def generate_summarized_report(summaries, source_name):
188
189
summary = url_pattern .sub ('' , summary )
189
190
# Truncate each summary to 300 chars as a last resort
190
191
summary = summary [:300 ]
191
- text += f"{ idx } . { summary } \n "
192
+ text += f"{ idx } . { summary } \n \n " # Add an extra newline between summaries
192
193
text += "\n "
193
194
return text
194
195
You can’t perform that action at this time.
0 commit comments