You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/model/common/prompts.py
+49-14Lines changed: 49 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -344,49 +344,84 @@
344
344
"""
345
345
346
346
internet_summary_system_prompt_template="""
347
-
You are tasked with summarizing a list of search results provided as plain strings into a concise, coherent, and unstructured paragraph.
347
+
You are tasked with summarizing a list of search results provided as a list of dictionaries into a concise, coherent, and unstructured paragraph. Each dictionary contains "title", "url", and "description". Your summary should integrate relevant URLs to enhance its utility and provide direct access to sources.
348
348
349
349
### Instructions:
350
-
1. Combine all the results into a single paragraph that captures the key points across all the items.
350
+
1. Combine information from the "title" and "description" of each search result into a single paragraph that captures the key points across all items.
351
351
2. Avoid repeating information but ensure no important detail is omitted.
352
352
3. Maintain a neutral and professional tone.
353
353
4. Do not list the results as individual items; instead, weave them seamlessly into a cohesive narrative.
354
354
5. Use appropriate transitions to link related points.
355
355
6. Avoid directly quoting unless necessary for clarity or emphasis.
356
+
7. **Integrate relevant URLs within the summary paragraph to provide context and direct access to sources. Focus on including URLs for primary sources or when a direct link significantly benefits the reader. Be selective and strategic in URL inclusion to maximize the summary's value.** You are not required to include every URL.
357
+
8. You can mention the source name (from the title if appropriate) and then include the URL in parentheses, or find other natural ways to integrate URLs.
356
358
357
359
### Input Format:
358
-
- A simple list of strings, where each string represents a search result or description.
360
+
- A list of dictionaries, where each dictionary represents a search result and contains the keys: "title", "url", and "description".
359
361
360
362
### Output Format:
361
-
- A single unstructured paragraph that summarizes the key points from the input.
363
+
- A single unstructured paragraph that summarizes the key points from the input, incorporating relevant URLs.
362
364
363
365
### Examples:
364
366
365
367
#### Example 1:
366
368
Input:
367
369
[
368
-
"Climate change is causing rising temperatures worldwide.",
369
-
"Polar regions are experiencing faster ice melting due to global warming.",
370
-
"Melting ice is contributing to rising sea levels, threatening coastal areas."
370
+
{"title": "Climate change is causing rising temperatures worldwide.", "url": "url1", "description": "Global warming is leading to increased temperatures across the planet."},
371
+
{"title": "Polar regions are experiencing faster ice melting.", "url": "url2", "description": "Due to global warming, ice is melting rapidly in polar areas."},
372
+
{"title": "Melting ice causes rising sea levels.", "url": "url3", "description": "The melting of polar ice contributes to the increase in sea levels, posing risks to coastal regions."}
371
373
]
372
374
373
375
Output:
374
-
Climate change is leading to rising global temperatures, significantly impacting polar regions, where ice is melting at an accelerated rate. This phenomenon is contributing to rising sea levels, which pose a substantial threat to coastal communities.
376
+
Climate change, also known as global warming, is causing rising temperatures worldwide, especially impacting polar regions where ice is melting at an accelerated rate. This melting ice is a significant contributor to rising sea levels, which threatens coastal areas. Sources indicate these effects are globally observed (url1), particularly pronounced in polar regions (url2), and lead to sea level rise (url3).
375
377
376
378
#### Example 2:
377
379
Input:
378
380
[
379
-
"A balanced diet includes fruits, vegetables, proteins, and whole grains.",
380
-
"Staying hydrated is crucial for maintaining overall health.",
{"title": "Balanced diet includes fruits, vegetables.", "url": "url4", "description": "A healthy diet should consist of fruits and vegetables."},
382
+
{"title": "Hydration is crucial for health.", "url": "url5", "description": "Staying hydrated is very important for maintaining good health."},
383
+
{"title": "Exercise improves cardiovascular health.", "url": "url6", "description": "Regular physical activity benefits the heart and blood vessels."}
382
384
]
383
385
384
386
Output:
385
-
A healthy lifestyle encompasses consuming a balanced diet rich in fruits, vegetables, proteins, and whole grains, while staying hydrated is essential for overall well-being. Incorporating regular exercise further enhances cardiovascular health and supports mental wellness.
387
+
A healthy lifestyle includes a balanced diet with fruits and vegetables (url4), and staying hydrated is crucial for overall health (url5). Furthermore, regular exercise is beneficial for improving cardiovascular health (url6).
388
+
389
+
#### Example 3:
390
+
Input:
391
+
[
392
+
{
393
+
"title": "Breaking News, Latest News and Videos | CNN",
394
+
"url": "https://www.cnn.com/",
395
+
"description": "View the latest news and breaking news today for U.S., world, weather, entertainment, politics and health at CNN.com."
"description": "Breaking News, Latest News and Current News from FOXNews.com. Breaking news and video. Latest Current News: U.S., World, Entertainment, Health, Business, Technology, Politics, Sports"
401
+
},
402
+
{
403
+
"title": "NBC News - Breaking News & Top Stories - Latest World, US & Local News | NBC News",
404
+
"url": "https://www.nbcnews.com/",
405
+
"description": "Go to NBCNews.com for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture."
406
+
},
407
+
{
408
+
"title": "Associated Press News: Breaking News, Latest Headlines and Videos | AP News",
409
+
"url": "https://apnews.com/",
410
+
"description": "Read the latest headlines, breaking news, and videos at APNews.com, the definitive source for independent journalism from every corner of the globe."
411
+
},
412
+
{
413
+
"title": "Google News",
414
+
"url": "https://news.google.com/",
415
+
"description": "Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for."
416
+
}
417
+
]
418
+
419
+
Output:
420
+
Major news outlets such as CNN (https://www.cnn.com/), Fox News (https://www.foxnews.com/), NBC News (https://www.nbcnews.com/), and Associated Press (AP) (https://apnews.com/) offer breaking and current news coverage spanning U.S. and world events, alongside topics like weather, entertainment, politics, health, business, technology, sports, and pop culture, typically through articles and videos. Google News (https://news.google.com/) also provides a comprehensive news aggregation service, sourcing information from across the globe.
386
421
"""
387
422
388
-
internet_summary_user_prompt_template="""Summarize the provided list of search results into a single, coherent paragraph.
423
+
internet_summary_user_prompt_template="""Summarize the provided list of search results into a single, coherent paragraph, including relevant source URLs.
0 commit comments