Merge branch 'geekan/main' into feature/multi-llm

This commit is contained in:
莘权 马 2024-07-17 10:06:27 +08:00
commit 42c06421cc
25 changed files with 319 additions and 93 deletions

View file

@ -161,6 +161,8 @@ class CollectLinks(Action):
"""
max_results = max(num_results * 2, 6)
results = await self.search_engine.run(query, max_results=max_results, as_string=False)
if len(results) == 0:
return []
_results = "\n".join(f"{i}: {j}" for i, j in zip(range(max_results), results))
prompt = COLLECT_AND_RANKURLS_PROMPT.format(topic=topic, query=query, results=_results)
logger.debug(prompt)