|
@@ -366,21 +366,17 @@ async def chat_web_search_handler(
|
|
|
}
|
|
|
)
|
|
|
|
|
|
- web_search_tasks = [
|
|
|
- asyncio.create_task(
|
|
|
+ gathered_results = await asyncio.gather(
|
|
|
+ *(
|
|
|
process_web_search(
|
|
|
request,
|
|
|
- SearchForm(
|
|
|
- **{
|
|
|
- "query": searchQuery,
|
|
|
- }
|
|
|
- ),
|
|
|
+ SearchForm(**{"query": searchQuery}),
|
|
|
user=user,
|
|
|
)
|
|
|
- )
|
|
|
- for searchQuery in queries
|
|
|
- ]
|
|
|
- gathered_results = await asyncio.gather(*web_search_tasks, return_exceptions=True)
|
|
|
+ for searchQuery in queries
|
|
|
+ ),
|
|
|
+ return_exceptions=True,
|
|
|
+ )
|
|
|
|
|
|
for searchQuery, results in zip(queries, gathered_results):
|
|
|
try:
|