From 273b367f0511d88cb9f4694061ccda4eff96cf2e Mon Sep 17 00:00:00 2001 From: teknium1 Date: Thu, 19 Feb 2026 23:30:01 -0800 Subject: [PATCH] fix: update documentation and return types for web tools - Revised docstrings for `web_search` and `web_extract` functions to clarify return types and structure. - Updated the execution code schema documentation to reflect changes in the output format for both tools, ensuring consistency and improved understanding for users. --- tools/code_execution_tool.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/code_execution_tool.py b/tools/code_execution_tool.py index 25124b5a7..0055eac7a 100644 --- a/tools/code_execution_tool.py +++ b/tools/code_execution_tool.py @@ -67,13 +67,13 @@ _TOOL_STUBS = { "web_search": ( "web_search", "query: str, limit: int = 5", - '"""Search the web. Returns dict with "results" list of {url, title, description}."""', + '"""Search the web. Returns dict with data.web list of {url, title, description}."""', '{"query": query, "limit": limit}', ), "web_extract": ( "web_extract", "urls: list", - '"""Extract content from URLs. Returns markdown text."""', + '"""Extract content from URLs. Returns dict with results list of {url, content, error}."""', '{"urls": urls}', ), "read_file": ( @@ -536,9 +536,9 @@ EXECUTE_CODE_SCHEMA = { "or the task requires interactive user input.\n\n" "Available via `from hermes_tools import ...`:\n\n" " web_search(query: str, limit: int = 5) -> dict\n" - " Returns {\"results\": [{\"url\", \"title\", \"description\"}, ...]}\n" - " web_extract(urls: list[str]) -> str\n" - " Returns extracted page content as markdown text\n" + " Returns {\"data\": {\"web\": [{\"url\", \"title\", \"description\"}, ...]}}\n" + " web_extract(urls: list[str]) -> dict\n" + " Returns {\"results\": [{\"url\", \"content\", \"error\"}, ...]} where content is markdown\n" " read_file(path: str, offset: int = 1, limit: int = 500) -> dict\n" " Lines are 1-indexed. Returns {\"content\": \"...\", \"total_lines\": N}\n" " write_file(path: str, content: str) -> dict\n"