This commit is contained in:
Krishav Raj Singh 2025-09-12 11:39:52 +05:30
parent 7df8d560f1
commit 59840c5db3
7 changed files with 17 additions and 17 deletions

View File

@ -64,7 +64,7 @@ const defaultRegistry: Record<string, ToolViewComponent> = {
'terminate-command': TerminateCommandToolView,
'see-image': SeeImageToolView,
'load-image': SeeImageToolView,
'expose-port': ExposePortToolView,
'get-data-provider-endpoints': DataProviderEndpointsToolView,

View File

@ -87,11 +87,11 @@ You have the abilixwty to execute operations using both Python and CLI tools:
* **IMPORTANT:** browser-screenshots bucket is ONLY for actual browser screenshots, not generated images or other content
### 2.3.6 VISUAL INPUT
- You MUST use the 'see_image' tool to see image files. There is NO other way to access visual information.
- You MUST use the 'load_image' tool to see image files. There is NO other way to access visual information.
* Provide the relative path to the image in the `/workspace` directory.
* Example:
<function_calls>
<invoke name="see_image">
<invoke name="load_image">
<parameter name="file_path">docs/diagram.png</parameter>
</invoke>
</function_calls>

View File

@ -88,7 +88,7 @@ class WorkflowTool(AgentBuilderBaseTool):
'sb_shell_tool': ['execute_command'],
'sb_files_tool': ['create_file', 'edit_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
'sb_vision_tool': ['see_image'],
'sb_vision_tool': ['load_image'],
'sb_deploy_tool': ['deploy'],
'sb_expose_tool': ['expose_port'],
'web_search_tool': ['web_search'],

View File

@ -579,7 +579,7 @@ class WorkflowExecutor:
'sb_shell_tool': ['execute_command'],
'sb_files_tool': ['create_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
'sb_vision_tool': ['see_image'],
'sb_vision_tool': ['load_image'],
'sb_deploy_tool': ['deploy'],
'sb_expose_tool': ['expose_port'],
'web_search_tool': ['web_search'],

View File

@ -85,11 +85,11 @@ function extractImageFilePath(content: string | object | undefined | null): stri
const parsedContent = JSON.parse(contentStr);
if (parsedContent.content && typeof parsedContent.content === 'string') {
const nestedContentStr = parsedContent.content;
let filePathMatch = nestedContentStr.match(/<see-image\s+file_path=["']([^"']+)["'][^>]*><\/see-image>/i);
let filePathMatch = nestedContentStr.match(/<load-image\s+file_path=["']([^"']+)["'][^>]*><\/load-image>/i);
if (filePathMatch) {
return cleanImagePath(filePathMatch[1]);
}
filePathMatch = nestedContentStr.match(/<see-image[^>]*>([^<]+)<\/see-image>/i);
filePathMatch = nestedContentStr.match(/<load-image[^>]*>([^<]+)<\/load-image>/i);
if (filePathMatch) {
return cleanImagePath(filePathMatch[1]);
}
@ -97,11 +97,11 @@ function extractImageFilePath(content: string | object | undefined | null): stri
} catch (e) {
}
let filePathMatch = contentStr.match(/<see-image\s+file_path=["']([^"']+)["'][^>]*><\/see-image>/i);
let filePathMatch = contentStr.match(/<load-image\s+file_path=["']([^"']+)["'][^>]*><\/load-image>/i);
if (filePathMatch) {
return cleanImagePath(filePathMatch[1]);
}
filePathMatch = contentStr.match(/<see-image[^>]*>([^<]+)<\/see-image>/i);
filePathMatch = contentStr.match(/<load-image[^>]*>([^<]+)<\/load-image>/i);
if (filePathMatch) {
return cleanImagePath(filePathMatch[1]);
}
@ -125,7 +125,7 @@ function extractImageDescription(content: string | object | undefined | null): s
try {
const parsedContent = JSON.parse(contentStr);
if (parsedContent.content && typeof parsedContent.content === 'string') {
const parts = parsedContent.content.split(/<see-image/i);
const parts = parsedContent.content.split(/<load-image/i);
if (parts.length > 1) {
return parts[0].trim();
}
@ -133,7 +133,7 @@ function extractImageDescription(content: string | object | undefined | null): s
} catch (e) {
}
const parts = contentStr.split(/<see-image/i);
const parts = contentStr.split(/<load-image/i);
if (parts.length > 1) {
return parts[0].trim();
}
@ -156,7 +156,7 @@ function parseToolResult(content: string | object | undefined | null): { success
} catch (e) {
}
const toolResultPattern = /<tool_result>\s*<see-image>\s*ToolResult\(([^)]+)\)\s*<\/see-image>\s*<\/tool_result>/;
const toolResultPattern = /<tool_result>\s*<load-image>\s*ToolResult\(([^)]+)\)\s*<\/load-image>\s*<\/tool_result>/;
const toolResultMatch = contentToProcess.match(toolResultPattern);
if (toolResultMatch) {
@ -177,7 +177,7 @@ function parseToolResult(content: string | object | undefined | null): { success
return { success, message, filePath };
}
const directToolResultMatch = contentToProcess.match(/<tool_result>\s*<see-image>\s*([^<]+)<\/see-image>\s*<\/tool_result>/);
const directToolResultMatch = contentToProcess.match(/<tool_result>\s*<load-image>\s*([^<]+)<\/load-image>\s*<\/tool_result>/);
if (directToolResultMatch) {
const resultContent = directToolResultMatch[1];
const success = resultContent.includes('success=True') || resultContent.includes('Successfully');

View File

@ -47,7 +47,7 @@ export function getToolTitle(toolName: string): string {
'browser-act': 'Browser Action',
'browser-extract-content': 'Browser Extract',
'browser-screenshot': 'Browser Screenshot',
'see-image': 'View Image',
'load-image': 'Load Image',
'ask': 'Ask',
'complete': 'Task Complete',
'execute-data-provider-call': 'Data Provider Call',

View File

@ -337,7 +337,7 @@ const TOOL_DISPLAY_NAMES = new Map([
['expose-port', 'Exposing Port'],
['scrape-webpage', 'Scraping Website'],
['web-search', 'Searching Web'],
['see-image', 'Viewing Image'],
['load-image', 'Loading Image'],
['create-presentation-outline', 'Creating Presentation Outline'],
['create-presentation', 'Creating Presentation'],
['present-presentation', 'Presenting'],
@ -391,7 +391,7 @@ const TOOL_DISPLAY_NAMES = new Map([
['expose_port', 'Exposing Port'],
['scrape_webpage', 'Scraping Website'],
['web_search', 'Searching Web'],
['see_image', 'Viewing Image'],
['load_image', 'Loading Image'],
['update_agent', 'Updating Agent'],
['get_current_agent_config', 'Getting Agent Config'],
@ -517,7 +517,7 @@ export const HIDE_STREAMING_XML_TAGS = new Set([
'complete',
'crawl-webpage',
'web-search',
'see-image',
'load-image',
'execute_data_provider_call',
'execute_data_provider_endpoint',