add create_resource schema

This commit is contained in:
Xuwznln
2026-03-10 15:27:39 +08:00
parent 38bf95b13c
commit 95d3456214
2 changed files with 20 additions and 4 deletions

View File

@@ -97,6 +97,18 @@ class Registry:
)
test_resource_schema["description"] = "用于测试物料、设备和样本。"
create_resource_method_info = host_node_enhanced_info.get("action_methods", {}).get("create_resource", {})
create_resource_schema = self._generate_unilab_json_command_schema(
create_resource_method_info.get("args", []),
"create_resource",
create_resource_method_info.get("return_annotation"),
)
create_resource_schema["description"] = "用于创建物料"
raw_create_resource_schema = ros_action_to_json_schema(
self.ResourceCreateFromOuterEasy, "用于创建或更新物料资源,每次传入一个物料信息。"
)
raw_create_resource_schema["properties"]["result"] = create_resource_schema["properties"]["result"]
self.device_type_registry.update(
{
"host_node": {
@@ -140,9 +152,7 @@ class Registry:
},
"feedback": {},
"result": {"success": "success"},
"schema": ros_action_to_json_schema(
self.ResourceCreateFromOuterEasy, "用于创建或更新物料资源,每次传入一个物料信息。"
),
"schema": raw_create_resource_schema,
"goal_default": yaml.safe_load(
io.StringIO(get_yaml_from_goal_type(self.ResourceCreateFromOuterEasy.Goal))
),