MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / search_save_result

Function search_save_result

functions/function_calling/deep_research.py:68–97  ·  view source on GitHub ↗

Save or update a search result.

(
    url: Annotated[str, ParamMeta(description="URL of the search result (used as key)")],
    title: Annotated[str, ParamMeta(description="Title of the search result")],
    abs: Annotated[str, ParamMeta(description="Abstract/Summary of the content")],
    detail: Annotated[str, ParamMeta(description="Detailed content")],
    _context: Dict[str, Any] | None = None,
)

Source from the content-addressed store, hash-verified

66
67
68def search_save_result(
69 url: Annotated[str, ParamMeta(description="URL of the search result (used as key)")],
70 title: Annotated[str, ParamMeta(description="Title of the search result")],
71 abs: Annotated[str, ParamMeta(description="Abstract/Summary of the content")],
72 detail: Annotated[str, ParamMeta(description="Detailed content")],
73 _context: Dict[str, Any] | None = None,
74) -> str:
75 """
76 Save or update a search result.
77 """
78 ctx = FileToolContext(_context)
79 search_file, _ = _get_files(ctx)
80 search_lock, _ = _get_locks(ctx)
81
82 with FileLock(search_lock):
83 data = _load_search_results(search_file)
84 current = data.get(url, {})
85
86 # Preserve existing keys if updating
87 highlight_keys = current.get("highlight_keys", [])
88
89 data[url] = {
90 "title": title,
91 "abs": abs,
92 "detail": detail,
93 "highlight_keys": highlight_keys,
94 }
95
96 _save_search_results(search_file, data)
97 return f"Saved result for {url}"
98
99
100def search_load_all(

Callers

nothing calls this directly

Calls 7

ParamMetaClass · 0.90
FileToolContextClass · 0.90
_get_filesFunction · 0.85
_get_locksFunction · 0.85
_load_search_resultsFunction · 0.85
_save_search_resultsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected