From 3a958944a0d73daa42f398067e217bdd610c5c2f Mon Sep 17 00:00:00 2001 From: xiangjinyu <1376193973@qq.com> Date: Tue, 11 Mar 2025 16:32:13 +0800 Subject: [PATCH] Adjust code structure --- app/tool/browser_use_tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/tool/browser_use_tool.py b/app/tool/browser_use_tool.py index d2cf2a5..e7cf9a6 100644 --- a/app/tool/browser_use_tool.py +++ b/app/tool/browser_use_tool.py @@ -11,6 +11,7 @@ from pydantic_core.core_schema import ValidationInfo from app.tool.base import BaseTool, ToolResult +MAX_LENGTH = 2000 _BROWSER_DESCRIPTION = """ Interact with a web browser to perform various actions such as navigation, element interaction, @@ -180,7 +181,7 @@ class BrowserUseTool(BaseTool): elif action == "get_html": html = await context.get_page_html() - truncated = html[:2000] + "..." if len(html) > 2000 else html + truncated = html[:MAX_LENGTH] + "..." if len(html) > MAX_LENGTH else html return ToolResult(output=truncated) elif action == "get_text":