代码提交

This commit is contained in:
董宏凯 committed 2026-08-16 19:17:45 +08:00
1 parent 70da7c5649
commit 178572bc7f
79 files changed
+13456 -798

No files matched your search

@@ -270,7 +270,7 @@ class DeerFlowMaterialProvider:
) -> list[ResearchMaterial]:
materials: list[ResearchMaterial] = []
for item in results:
material = _result_to_material(item, query=query)
material = result_to_material(item, query=query)
if not _material_matches_domains(material, domains) or not _accept_material(material, seen_keys):
continue
material.metadata["retrieval_channel"] = "configured_web_search"
@@ -317,8 +317,12 @@ class DeerFlowMaterialProvider:
return self._settings_error
def _result_to_material(item: dict[str, Any], *, query: str) -> ResearchMaterial:
"""Map a configurable-search result into a research material."""
def result_to_material(item: dict[str, Any], *, query: str) -> ResearchMaterial:
"""Map a configurable-search result item into a research material.
Public so the chat-collection thread harvester can reuse the exact same
field mapping for ``web_search`` tool envelopes harvested off a thread.
"""
rec_uuid = str(item.get("recUuid") or "").strip() or None
url = str(item.get("url") or "").strip() or None
title = str(item.get("title") or "").strip()
@@ -538,4 +542,5 @@ __all__ = [
"ONLINE_SEARCH_TIMEOUT_SECONDS",
"QUESTION_ANSWER_RESEARCH_SKILLS",
"SNIPPET_THRESHOLD",
"result_to_material",
]