From 6016ac0f3319351e58e4a1f9a336a30b8ccc134e Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Fri, 3 Oct 2025 15:45:37 -0700 Subject: [PATCH] chore: undo fetch_webpage rename (#5132) --- letta/constants.py | 2 +- letta/functions/function_sets/builtin.py | 2 +- letta/services/tool_executor/builtin_tool_executor.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/letta/constants.py b/letta/constants.py index 5f9707b1..a06cd906 100644 --- a/letta/constants.py +++ b/letta/constants.py @@ -138,7 +138,7 @@ MEMORY_TOOLS_LINE_NUMBER_PREFIX_REGEX = re.compile( ) # Built in tools -BUILTIN_TOOLS = ["run_code", "web_search", "web_fetch"] +BUILTIN_TOOLS = ["run_code", "web_search", "fetch_webpage"] # Built in tools FILES_TOOLS = ["open_files", "grep_files", "semantic_search_files"] diff --git a/letta/functions/function_sets/builtin.py b/letta/functions/function_sets/builtin.py index b813e2db..a49f0661 100644 --- a/letta/functions/function_sets/builtin.py +++ b/letta/functions/function_sets/builtin.py @@ -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 web_fetch(url: str) -> str: +async def fetch_webpage(url: str) -> str: """ Fetch a webpage and convert it to markdown/text format using Jina AI reader. diff --git a/letta/services/tool_executor/builtin_tool_executor.py b/letta/services/tool_executor/builtin_tool_executor.py index e3d8adb4..cf7e3881 100644 --- a/letta/services/tool_executor/builtin_tool_executor.py +++ b/letta/services/tool_executor/builtin_tool_executor.py @@ -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, "web_fetch": self.web_fetch} + function_map = {"run_code": self.run_code, "web_search": self.web_search, "fetch_webpage": self.fetch_webpage} 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 web_fetch(self, agent_state: "AgentState", url: str) -> str: + async def fetch_webpage(self, agent_state: "AgentState", url: str) -> str: """ Fetch a webpage and convert it to markdown/text format using trafilatura with readability fallback.