put base64 in the currect position for sb_vision
This commit is contained in:
@@ -11,7 +11,6 @@ from app.logger import logger
|
||||
from app.prompt.manus import NEXT_STEP_PROMPT, SYSTEM_PROMPT
|
||||
from app.tool import Terminate, ToolCollection
|
||||
from app.tool.ask_human import AskHuman
|
||||
from app.tool.browser_use_tool import BrowserUseTool
|
||||
from app.tool.mcp import MCPClients, MCPClientTool
|
||||
from app.tool.sandbox.sb_browser_tool import SandboxBrowserTool
|
||||
from app.tool.sandbox.sb_files_tool import SandboxFilesTool
|
||||
@@ -205,7 +204,7 @@ class SandboxManus(ToolCallAgent):
|
||||
original_prompt = self.next_step_prompt
|
||||
recent_messages = self.memory.messages[-3:] if self.memory.messages else []
|
||||
browser_in_use = any(
|
||||
tc.function.name == BrowserUseTool().name
|
||||
tc.function.name == SandboxBrowserTool().name
|
||||
for msg in recent_messages
|
||||
if msg.tool_calls
|
||||
for tc in msg.tool_calls
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import time
|
||||
|
||||
from daytona import (
|
||||
CreateSandboxFromImageParams,
|
||||
Daytona,
|
||||
@@ -90,6 +92,7 @@ def start_supervisord_session(sandbox: Sandbox):
|
||||
var_async=True,
|
||||
),
|
||||
)
|
||||
time.sleep(25) # Wait a bit to ensure supervisord starts properly
|
||||
logger.info(f"Supervisord started in session {session_id}")
|
||||
except Exception as e:
|
||||
logger.error(f"Error starting supervisord session: {str(e)}")
|
||||
|
||||
@@ -229,7 +229,7 @@ class SandboxBrowserTool(SandboxToolsBase):
|
||||
f"Screenshot validation failed: {validation_message}"
|
||||
)
|
||||
result["image_validation_error"] = validation_message
|
||||
del result["screenshot_base64"]
|
||||
del result["screenshot_base64"]
|
||||
|
||||
# added_message = await self.thread_manager.add_message(
|
||||
# thread_id=self.thread_id,
|
||||
|
||||
@@ -170,8 +170,9 @@ class SandboxVisionTool(SandboxToolsBase):
|
||||
)
|
||||
self.vision_message = message
|
||||
# return self.success_response(f"成功加载并压缩图片 '{cleaned_path}' (由 {file_info.size / 1024:.1f}KB 压缩到 {len(compressed_bytes) / 1024:.1f}KB)。")
|
||||
return self.success_response(
|
||||
f"成功加载并压缩图片 '{cleaned_path}',压缩后的内容为:{base64_image}"
|
||||
return ToolResult(
|
||||
output=f"成功加载并压缩图片 '{cleaned_path}'",
|
||||
base64_image=base64_image,
|
||||
)
|
||||
except Exception as e:
|
||||
return self.fail_response(f"see_image 执行异常: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user