Return type standardization
This commit is contained in:
@@ -26,11 +26,11 @@ async def handle(args: Dict[str, Any]):
|
||||
# Pillow parses PNG text chunks into the .info dictionary
|
||||
metadata = img.info
|
||||
if not metadata:
|
||||
return {"text": "No metadata found in this PNG."}
|
||||
return [{"type": "text", "text": "No metadata found in this PNG."}]
|
||||
|
||||
# Format as a simple key: value list
|
||||
output = "\n".join([f"{k}: {v}" for k, v in metadata.items()])
|
||||
return {"text": f"PNG Metadata:\n{output}"}
|
||||
return [{"type": "text", "text": f"PNG Metadata:\n{output}"}]
|
||||
except ToolError:
|
||||
raise
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user