Merge pull request #12506 from Ithanil/fix_web_result_source_ids

fix: fix web results all getting the same source id when bypassing embedding and retrieval
This commit is contained in:
Timothy Jaeryang Baek 2025-04-06 15:21:14 -07:00 committed by GitHub
commit 6751d68034
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -409,12 +409,13 @@ async def chat_web_search_handler(
} }
) )
elif results.get("docs"): elif results.get("docs"):
for doc_idx, doc in enumerate(results["docs"]):
files.append( files.append(
{ {
"docs": results.get("docs", []), "docs": [doc],
"name": searchQuery, "name": searchQuery,
"type": "web_search", "type": "web_search",
"urls": results["filenames"], "urls": [results["filenames"][doc_idx]],
} }
) )