diff --git a/src/api/ai/model/chatRole/index.ts b/src/api/ai/model/chatRole/index.ts
index 8969f68e..6c5511a5 100644
--- a/src/api/ai/model/chatRole/index.ts
+++ b/src/api/ai/model/chatRole/index.ts
@@ -13,7 +13,8 @@ export interface ChatRoleVO {
welcomeMessage: string // 角色设定
publicStatus: boolean // 是否公开
status: number // 状态
- knowledgeIds?: number[] // 引用的知识库ID列表
+ knowledgeIds?: number[] // 引用的知识库 ID 列表
+ toolIds?: number[] // 引用的工具 ID 列表
}
// AI 聊天角色 分页请求 vo
diff --git a/src/api/ai/model/tool/index.ts b/src/api/ai/model/tool/index.ts
index 7926fa86..bfb896a9 100644
--- a/src/api/ai/model/tool/index.ts
+++ b/src/api/ai/model/tool/index.ts
@@ -33,5 +33,10 @@ export const ToolApi = {
// 删除工具
deleteTool: async (id: number) => {
return await request.delete({ url: `/ai/tool/delete?id=` + id })
+ },
+
+ // 获取工具简单列表
+ getToolSimpleList: async () => {
+ return await request.get({ url: `/ai/tool/simple-list` })
}
}
diff --git a/src/views/ai/model/chatRole/ChatRoleForm.vue b/src/views/ai/model/chatRole/ChatRoleForm.vue
index e22cb483..ebfd600c 100644
--- a/src/views/ai/model/chatRole/ChatRoleForm.vue
+++ b/src/views/ai/model/chatRole/ChatRoleForm.vue
@@ -42,6 +42,11 @@
/>
+
+
+
+
+
{
@@ -145,6 +153,8 @@ const open = async (type: string, id?: number, title?: string) => {
models.value = await ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT)
// 获取知识库列表
knowledgeList.value = await KnowledgeApi.getSimpleKnowledgeList()
+ // 获取工具列表
+ toolList.value = await ToolApi.getToolSimpleList()
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
@@ -193,7 +203,8 @@ const resetForm = () => {
systemMessage: undefined,
publicStatus: true,
status: CommonStatusEnum.ENABLE,
- knowledgeIds: []
+ knowledgeIds: [],
+ toolIds: []
}
formRef.value?.resetFields()
}
diff --git a/src/views/ai/model/chatRole/index.vue b/src/views/ai/model/chatRole/index.vue
index 88983cf0..d3d4e4eb 100644
--- a/src/views/ai/model/chatRole/index.vue
+++ b/src/views/ai/model/chatRole/index.vue
@@ -75,6 +75,12 @@
引用 {{ scope.row.knowledgeIds.length }} 个
+
+
+ -
+ 引用 {{ scope.row.toolIds.length }} 个
+
+