Merge #66 into develop from feature/20251219_xjn

feat(tool system): Tool info add tags variable

* feature/20251219_xjn: (1 commits)
  feat(tool system): Tool info add tags variable

Signed-off-by: 谢俊男 <accounts_6853d0ea6f8174722fb0c8f1@mail.teambition.com>
Reviewed-by: zhuwenhui5566@163.com <zhuwenhui5566@163.com>
Merged-by: zhuwenhui5566@163.com <zhuwenhui5566@163.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/66
This commit is contained in:
朱文辉
2025-12-26 12:28:06 +08:00
5 changed files with 17 additions and 34 deletions

View File

@@ -83,7 +83,8 @@ class ToolService:
tenant_id: uuid.UUID,
icon: Optional[str] = None,
description: Optional[str] = None,
config: Optional[Dict[str, Any]] = None
config: Optional[Dict[str, Any]] = None,
tags: Optional[List[str]] = None
) -> str:
"""创建工具"""
if tool_type == ToolType.BUILTIN:
@@ -98,7 +99,8 @@ class ToolService:
tool_type=tool_type.value,
tenant_id=tenant_id,
status=ToolStatus.AVAILABLE.value,
config_data=config or {}
config_data=config or {},
tags=tags
)
self.db.add(tool_config)
self.db.flush()
@@ -123,7 +125,8 @@ class ToolService:
description: Optional[str] = None,
icon: Optional[str] = None,
config: Optional[Dict[str, Any]] = None,
is_enabled: Optional[bool] = None
is_enabled: Optional[bool] = None,
tags: Optional[List[str]] = None
) -> bool:
"""更新工具"""
config_obj = self._get_tool_config(tool_id, tenant_id)
@@ -140,6 +143,8 @@ class ToolService:
config_obj.description = description
if icon:
config_obj.icon = icon
if tags:
config_obj.tags = tags
if config:
config_obj.config_data = config.copy()