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,14 +409,15 @@ async def chat_web_search_handler(
} }
) )
elif results.get("docs"): elif results.get("docs"):
files.append( for doc_idx, doc in enumerate(results["docs"]):
{ files.append(
"docs": results.get("docs", []), {
"name": searchQuery, "docs": [doc],
"type": "web_search", "name": searchQuery,
"urls": results["filenames"], "type": "web_search",
} "urls": [results["filenames"][doc_idx]],
) }
)
form_data["files"] = files form_data["files"] = files
except Exception as e: except Exception as e: