Skip to content

Commit

Permalink
source='news': add 'date' and 'source' to results
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed Nov 22, 2023
1 parent 3692396 commit 96229cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/langchain/langchain/utilities/duckduckgo_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ def results(self, query: str, max_results: int) -> List[Dict[str, str]]:
]
elif self.source == "news":
results = [
{"snippet": r["body"], "title": r["title"], "link": r["url"]}
{
"snippet": r["body"],
"title": r["title"],
"link": r["url"],
"date": r["date"],
"source": r["source"],
}
for r in self._ddgs_news(query)
]
else:
Expand Down

0 comments on commit 96229cd

Please sign in to comment.