Adjust code structure

This commit is contained in:
xiangjinyu 2025-03-11 16:32:13 +08:00
parent 8d18c05350
commit 3a958944a0

View File

@ -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":