feat(core): rename fetch_webpage to web_fetch (#5110)

This commit is contained in:
Charles Packer
2025-10-03 11:26:03 -07:00
committed by Caren Thomas
parent b7c599ee5b
commit 09b173668a
3 changed files with 4 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ MEMORY_TOOLS_LINE_NUMBER_PREFIX_REGEX = re.compile(
)
# Built in tools
BUILTIN_TOOLS = ["run_code", "web_search", "fetch_webpage"]
BUILTIN_TOOLS = ["run_code", "web_search", "web_fetch"]
# Built in tools
FILES_TOOLS = ["open_files", "grep_files", "semantic_search_files"]

View File

@@ -53,7 +53,7 @@ async def web_search(
raise NotImplementedError("This is only available on the latest agent architecture. Please contact the Letta team.")
async def fetch_webpage(url: str) -> str:
async def web_fetch(url: str) -> str:
"""
Fetch a webpage and convert it to markdown/text format using Jina AI reader.

View File

@@ -29,7 +29,7 @@ class LettaBuiltinToolExecutor(ToolExecutor):
sandbox_config: Optional[SandboxConfig] = None,
sandbox_env_vars: Optional[Dict[str, Any]] = None,
) -> ToolExecutionResult:
function_map = {"run_code": self.run_code, "web_search": self.web_search, "fetch_webpage": self.fetch_webpage}
function_map = {"run_code": self.run_code, "web_search": self.web_search, "web_fetch": self.web_fetch}
if function_name not in function_map:
raise ValueError(f"Unknown function: {function_name}")
@@ -192,7 +192,7 @@ class LettaBuiltinToolExecutor(ToolExecutor):
logger.error(f"Exa search failed for query '{query}': {str(e)}")
return json.dumps({"query": query, "error": f"Search failed: {str(e)}"})
async def fetch_webpage(self, agent_state: "AgentState", url: str) -> str:
async def web_fetch(self, agent_state: "AgentState", url: str) -> str:
"""
Fetch a webpage and convert it to markdown/text format using trafilatura with readability fallback.