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()
|
start_time = time.time()
|
||||||
try:
|
try:
|
||||||
message = kwargs.get("message", "")
|
message = kwargs.get("message", "")
|
||||||
operation = kwargs.get("operation", "unknown")
|
|
||||||
if not message:
|
if not message:
|
||||||
return ToolResult.error_result(
|
return ToolResult.error_result(
|
||||||
error="message 参数不能为空",
|
error="message 参数不能为空",
|
||||||
|
|||||||
@@ -253,8 +253,8 @@ class OperationTool(BaseTool):
|
|||||||
ToolParameter(
|
ToolParameter(
|
||||||
name="image_url",
|
name="image_url",
|
||||||
type=ParameterType.STRING,
|
type=ParameterType.STRING,
|
||||||
description="必须提供,要分析的图片 URL 或 base64 data URI",
|
description="要分析的图片 URL 或 base64 data URI",
|
||||||
required=True
|
required=False
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -730,8 +730,8 @@ class ToolService:
|
|||||||
{
|
{
|
||||||
"name": "image_url",
|
"name": "image_url",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "必须提供,要分析的图片 URL 或 base64 data URI",
|
"description": "要分析的图片 URL 或 base64 data URI",
|
||||||
"required": True
|
"required": False
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user