fix(tools): make image_understand image_url optional and remove unused operation variable
Change image_url from required to optional in both operation_tool.py and tool_service.py for image_understand operation, avoiding parameter validation conflict with uploaded_files priority logic. Remove unused operation variable from OpenClawTool.execute().
This commit is contained in:
@@ -122,7 +122,6 @@ class OpenClawTool(BuiltinTool):
|
||||
start_time = time.time()
|
||||
try:
|
||||
message = kwargs.get("message", "")
|
||||
operation = kwargs.get("operation", "unknown")
|
||||
if not message:
|
||||
return ToolResult.error_result(
|
||||
error="message 参数不能为空",
|
||||
|
||||
@@ -253,8 +253,8 @@ class OperationTool(BaseTool):
|
||||
ToolParameter(
|
||||
name="image_url",
|
||||
type=ParameterType.STRING,
|
||||
description="必须提供,要分析的图片 URL 或 base64 data URI",
|
||||
required=True
|
||||
description="要分析的图片 URL 或 base64 data URI",
|
||||
required=False
|
||||
)
|
||||
]
|
||||
else:
|
||||
|
||||
@@ -730,8 +730,8 @@ class ToolService:
|
||||
{
|
||||
"name": "image_url",
|
||||
"type": "string",
|
||||
"description": "必须提供,要分析的图片 URL 或 base64 data URI",
|
||||
"required": True
|
||||
"description": "要分析的图片 URL 或 base64 data URI",
|
||||
"required": False
|
||||
}
|
||||
]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user