mirror of https://github.com/kortix-ai/suna.git
rename load_image_in context -> load_image
This commit is contained in:
parent
723922524b
commit
7df8d560f1
|
@ -142,7 +142,7 @@ class SandboxVisionTool(SandboxToolsBase):
|
|||
@openapi_schema({
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "load_image_in_context",
|
||||
"name": "load_image",
|
||||
"description": "Loads an image file into conversation context from the /workspace directory or from a URL. Provide either a relative path to a local image or the URL to an image. The image will be compressed before sending to reduce token usage. IMPORTANT: If you previously loaded an image but cleared context, you can load it again by calling this tool with the same file path - no need to ask user to re-upload.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
|
@ -159,19 +159,19 @@ class SandboxVisionTool(SandboxToolsBase):
|
|||
@usage_example('''
|
||||
<!-- Example: Load a local image named 'diagram.png' inside the 'docs' folder into context -->
|
||||
<function_calls>
|
||||
<invoke name="load_image_in_context">
|
||||
<invoke name="load_image">
|
||||
<parameter name="file_path">docs/diagram.png</parameter>
|
||||
</invoke>
|
||||
</function_calls>
|
||||
|
||||
<!-- Example: Load an image from a URL into context -->
|
||||
<function_calls>
|
||||
<invoke name="load_image_in_context">
|
||||
<invoke name="load_image">
|
||||
<parameter name="file_path">https://example.com/image.jpg</parameter>
|
||||
</invoke>
|
||||
</function_calls>
|
||||
''')
|
||||
async def load_image_in_context(self, file_path: str) -> ToolResult:
|
||||
async def load_image(self, file_path: str) -> ToolResult:
|
||||
"""Loads an image file from local file system or from a URL, compresses it, converts it to base64, and adds it to conversation context."""
|
||||
try:
|
||||
is_url = self.is_url(file_path)
|
||||
|
@ -261,7 +261,7 @@ class SandboxVisionTool(SandboxToolsBase):
|
|||
"type": "function",
|
||||
"function": {
|
||||
"name": "clear_images_from_context",
|
||||
"description": "Clears all images from conversation memory. Use when done analyzing images or to free up context tokens. IMPORTANT: Files remain accessible - use load_image_in_context with the same path to load any image again instead of asking user to re-upload.",
|
||||
"description": "Clears all images from conversation memory. Use when done analyzing images or to free up context tokens. IMPORTANT: Files remain accessible - use load_image with the same path to load any image again instead of asking user to re-upload.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
|
|
|
@ -100,7 +100,7 @@ const defaultRegistry: ToolViewRegistryType = {
|
|||
|
||||
'expose-port': ExposePortToolView,
|
||||
|
||||
'load-image-in-context': SeeImageToolView,
|
||||
'load-image': SeeImageToolView,
|
||||
'clear-images-from-context': SeeImageToolView,
|
||||
'image-edit-or-generate': ImageEditGenerateToolView,
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ const TOOL_DISPLAY_NAMES = new Map([
|
|||
['create-presentation', 'Creating Presentation'],
|
||||
['present-presentation', 'Presenting'],
|
||||
['clear-images-from-context', 'Clearing Images from context'],
|
||||
['load-image-in-context', 'Loading Image'],
|
||||
['load-image', 'Loading Image'],
|
||||
|
||||
['create-sheet', 'Creating Sheet'],
|
||||
['update-sheet', 'Updating Sheet'],
|
||||
|
|
Loading…
Reference in New Issue