Image preview
This commit is contained in:
@@ -20,6 +20,7 @@ from .read_image import handle as read_image_handler
|
||||
from .read_metadata import handle as read_png_metadata_handler
|
||||
from .contact_sheet import handle as contact_sheet_handler
|
||||
from .list_directory import handle as list_directory_details_handler
|
||||
from .preview_image import handle as preview_image_handler
|
||||
|
||||
# Central registry of all available tools
|
||||
TOOL_REGISTRY = [
|
||||
@@ -72,4 +73,18 @@ TOOL_REGISTRY = [
|
||||
},
|
||||
handler=list_directory_details_handler
|
||||
),
|
||||
Tool(
|
||||
name="preview_image",
|
||||
description="Generates small thumbnails (~70 tokens) and detailed info for images. Can take file paths, or indices/ranges from a contact sheet.",
|
||||
schema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {"type": "string", "description": "Path to an image file or a directory containing images"},
|
||||
"indices": {"type": "string", "description": "1-based indices or ranges (e.g., '1, 3-5, 10') to preview from the directory. Required if path is a directory."},
|
||||
"sort_by": {"type": "string", "description": "Sort order to resolve indices: 'mtime' (default), 'name', or 'size'."},
|
||||
},
|
||||
"required": ["path"],
|
||||
},
|
||||
handler=preview_image_handler
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user