fix tests/metagpt/learn/test_google_search.py error

This commit is contained in:
shenchucheng 2024-01-31 15:58:26 +08:00
parent 16f54abb3d
commit fc412e55a3
6 changed files with 135 additions and 17 deletions

View file

@ -8,5 +8,5 @@ async def google_search(query: str, max_results: int = 6, **kwargs):
:param max_results: The number of search results to retrieve
:return: The web search results in markdown format.
"""
results = await SearchEngine().run(query, max_results=max_results, as_string=False)
results = await SearchEngine(**kwargs).run(query, max_results=max_results, as_string=False)
return "\n".join(f"{i}. [{j['title']}]({j['link']}): {j['snippet']}" for i, j in enumerate(results, 1))