diff --git a/letta/constants.py b/letta/constants.py index a06cd906..5f9707b1 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", "fetch_webpage"] +BUILTIN_TOOLS = ["run_code", "web_search", "web_fetch"] # 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 a49f0661..b813e2db 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 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. diff --git a/letta/services/tool_executor/builtin_tool_executor.py b/letta/services/tool_executor/builtin_tool_executor.py index cf7e3881..e3d8adb4 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, "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.