mirror of https://github.com/kortix-ai/suna.git
cleanup
This commit is contained in:
parent
7df8d560f1
commit
59840c5db3
|
@ -64,7 +64,7 @@ const defaultRegistry: Record<string, ToolViewComponent> = {
|
||||||
'terminate-command': TerminateCommandToolView,
|
'terminate-command': TerminateCommandToolView,
|
||||||
|
|
||||||
|
|
||||||
'see-image': SeeImageToolView,
|
'load-image': SeeImageToolView,
|
||||||
|
|
||||||
'expose-port': ExposePortToolView,
|
'expose-port': ExposePortToolView,
|
||||||
'get-data-provider-endpoints': DataProviderEndpointsToolView,
|
'get-data-provider-endpoints': DataProviderEndpointsToolView,
|
||||||
|
|
|
@ -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
|
* **IMPORTANT:** browser-screenshots bucket is ONLY for actual browser screenshots, not generated images or other content
|
||||||
|
|
||||||
### 2.3.6 VISUAL INPUT
|
### 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.
|
* Provide the relative path to the image in the `/workspace` directory.
|
||||||
* Example:
|
* Example:
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="see_image">
|
<invoke name="load_image">
|
||||||
<parameter name="file_path">docs/diagram.png</parameter>
|
<parameter name="file_path">docs/diagram.png</parameter>
|
||||||
</invoke>
|
</invoke>
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
|
|
@ -88,7 +88,7 @@ class WorkflowTool(AgentBuilderBaseTool):
|
||||||
'sb_shell_tool': ['execute_command'],
|
'sb_shell_tool': ['execute_command'],
|
||||||
'sb_files_tool': ['create_file', 'edit_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
|
'sb_files_tool': ['create_file', 'edit_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
|
||||||
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
|
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
|
||||||
'sb_vision_tool': ['see_image'],
|
'sb_vision_tool': ['load_image'],
|
||||||
'sb_deploy_tool': ['deploy'],
|
'sb_deploy_tool': ['deploy'],
|
||||||
'sb_expose_tool': ['expose_port'],
|
'sb_expose_tool': ['expose_port'],
|
||||||
'web_search_tool': ['web_search'],
|
'web_search_tool': ['web_search'],
|
||||||
|
|
|
@ -579,7 +579,7 @@ class WorkflowExecutor:
|
||||||
'sb_shell_tool': ['execute_command'],
|
'sb_shell_tool': ['execute_command'],
|
||||||
'sb_files_tool': ['create_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
|
'sb_files_tool': ['create_file', 'str_replace', 'full_file_rewrite', 'delete_file'],
|
||||||
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
|
'browser_tool': ['browser_navigate_to', 'browser_screenshot'],
|
||||||
'sb_vision_tool': ['see_image'],
|
'sb_vision_tool': ['load_image'],
|
||||||
'sb_deploy_tool': ['deploy'],
|
'sb_deploy_tool': ['deploy'],
|
||||||
'sb_expose_tool': ['expose_port'],
|
'sb_expose_tool': ['expose_port'],
|
||||||
'web_search_tool': ['web_search'],
|
'web_search_tool': ['web_search'],
|
||||||
|
|
|
@ -85,11 +85,11 @@ function extractImageFilePath(content: string | object | undefined | null): stri
|
||||||
const parsedContent = JSON.parse(contentStr);
|
const parsedContent = JSON.parse(contentStr);
|
||||||
if (parsedContent.content && typeof parsedContent.content === 'string') {
|
if (parsedContent.content && typeof parsedContent.content === 'string') {
|
||||||
const nestedContentStr = parsedContent.content;
|
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) {
|
if (filePathMatch) {
|
||||||
return cleanImagePath(filePathMatch[1]);
|
return cleanImagePath(filePathMatch[1]);
|
||||||
}
|
}
|
||||||
filePathMatch = nestedContentStr.match(/<see-image[^>]*>([^<]+)<\/see-image>/i);
|
filePathMatch = nestedContentStr.match(/<load-image[^>]*>([^<]+)<\/load-image>/i);
|
||||||
if (filePathMatch) {
|
if (filePathMatch) {
|
||||||
return cleanImagePath(filePathMatch[1]);
|
return cleanImagePath(filePathMatch[1]);
|
||||||
}
|
}
|
||||||
|
@ -97,11 +97,11 @@ function extractImageFilePath(content: string | object | undefined | null): stri
|
||||||
} catch (e) {
|
} 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) {
|
if (filePathMatch) {
|
||||||
return cleanImagePath(filePathMatch[1]);
|
return cleanImagePath(filePathMatch[1]);
|
||||||
}
|
}
|
||||||
filePathMatch = contentStr.match(/<see-image[^>]*>([^<]+)<\/see-image>/i);
|
filePathMatch = contentStr.match(/<load-image[^>]*>([^<]+)<\/load-image>/i);
|
||||||
if (filePathMatch) {
|
if (filePathMatch) {
|
||||||
return cleanImagePath(filePathMatch[1]);
|
return cleanImagePath(filePathMatch[1]);
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ function extractImageDescription(content: string | object | undefined | null): s
|
||||||
try {
|
try {
|
||||||
const parsedContent = JSON.parse(contentStr);
|
const parsedContent = JSON.parse(contentStr);
|
||||||
if (parsedContent.content && typeof parsedContent.content === 'string') {
|
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) {
|
if (parts.length > 1) {
|
||||||
return parts[0].trim();
|
return parts[0].trim();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ function extractImageDescription(content: string | object | undefined | null): s
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const parts = contentStr.split(/<see-image/i);
|
const parts = contentStr.split(/<load-image/i);
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
return parts[0].trim();
|
return parts[0].trim();
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ function parseToolResult(content: string | object | undefined | null): { success
|
||||||
} catch (e) {
|
} 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);
|
const toolResultMatch = contentToProcess.match(toolResultPattern);
|
||||||
|
|
||||||
if (toolResultMatch) {
|
if (toolResultMatch) {
|
||||||
|
@ -177,7 +177,7 @@ function parseToolResult(content: string | object | undefined | null): { success
|
||||||
return { success, message, filePath };
|
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) {
|
if (directToolResultMatch) {
|
||||||
const resultContent = directToolResultMatch[1];
|
const resultContent = directToolResultMatch[1];
|
||||||
const success = resultContent.includes('success=True') || resultContent.includes('Successfully');
|
const success = resultContent.includes('success=True') || resultContent.includes('Successfully');
|
||||||
|
|
|
@ -47,7 +47,7 @@ export function getToolTitle(toolName: string): string {
|
||||||
'browser-act': 'Browser Action',
|
'browser-act': 'Browser Action',
|
||||||
'browser-extract-content': 'Browser Extract',
|
'browser-extract-content': 'Browser Extract',
|
||||||
'browser-screenshot': 'Browser Screenshot',
|
'browser-screenshot': 'Browser Screenshot',
|
||||||
'see-image': 'View Image',
|
'load-image': 'Load Image',
|
||||||
'ask': 'Ask',
|
'ask': 'Ask',
|
||||||
'complete': 'Task Complete',
|
'complete': 'Task Complete',
|
||||||
'execute-data-provider-call': 'Data Provider Call',
|
'execute-data-provider-call': 'Data Provider Call',
|
||||||
|
|
|
@ -337,7 +337,7 @@ const TOOL_DISPLAY_NAMES = new Map([
|
||||||
['expose-port', 'Exposing Port'],
|
['expose-port', 'Exposing Port'],
|
||||||
['scrape-webpage', 'Scraping Website'],
|
['scrape-webpage', 'Scraping Website'],
|
||||||
['web-search', 'Searching Web'],
|
['web-search', 'Searching Web'],
|
||||||
['see-image', 'Viewing Image'],
|
['load-image', 'Loading Image'],
|
||||||
['create-presentation-outline', 'Creating Presentation Outline'],
|
['create-presentation-outline', 'Creating Presentation Outline'],
|
||||||
['create-presentation', 'Creating Presentation'],
|
['create-presentation', 'Creating Presentation'],
|
||||||
['present-presentation', 'Presenting'],
|
['present-presentation', 'Presenting'],
|
||||||
|
@ -391,7 +391,7 @@ const TOOL_DISPLAY_NAMES = new Map([
|
||||||
['expose_port', 'Exposing Port'],
|
['expose_port', 'Exposing Port'],
|
||||||
['scrape_webpage', 'Scraping Website'],
|
['scrape_webpage', 'Scraping Website'],
|
||||||
['web_search', 'Searching Web'],
|
['web_search', 'Searching Web'],
|
||||||
['see_image', 'Viewing Image'],
|
['load_image', 'Loading Image'],
|
||||||
|
|
||||||
['update_agent', 'Updating Agent'],
|
['update_agent', 'Updating Agent'],
|
||||||
['get_current_agent_config', 'Getting Agent Config'],
|
['get_current_agent_config', 'Getting Agent Config'],
|
||||||
|
@ -517,7 +517,7 @@ export const HIDE_STREAMING_XML_TAGS = new Set([
|
||||||
'complete',
|
'complete',
|
||||||
'crawl-webpage',
|
'crawl-webpage',
|
||||||
'web-search',
|
'web-search',
|
||||||
'see-image',
|
'load-image',
|
||||||
'execute_data_provider_call',
|
'execute_data_provider_call',
|
||||||
'execute_data_provider_endpoint',
|
'execute_data_provider_endpoint',
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue