2026-04-01 15:45:39 +08:00
|
|
|
import request from '/@/utils/request';
|
2026-02-02 14:04:37 +08:00
|
|
|
|
|
|
|
|
// 数据集查询参数
|
2026-03-30 17:35:05 +08:00
|
|
|
export interface knowledgeQueryParams {
|
2026-02-02 14:04:37 +08:00
|
|
|
keyword?: string;
|
|
|
|
|
pageNum: number;
|
|
|
|
|
pageSize: number;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 18:00:17 +08:00
|
|
|
// 创建知识库参数
|
2026-03-30 17:35:05 +08:00
|
|
|
export interface CreateknowledgeParams {
|
2026-03-24 18:00:17 +08:00
|
|
|
name: string; // 必传
|
|
|
|
|
description?: string; // 可选
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新知识库参数
|
2026-03-30 17:35:05 +08:00
|
|
|
export interface UpdateknowledgeParams {
|
2026-03-24 18:00:17 +08:00
|
|
|
id: string; // 必传
|
|
|
|
|
name?: string; // 可选
|
|
|
|
|
description?: string; // 可选
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-02 14:04:37 +08:00
|
|
|
// 数据集信息
|
2026-03-30 17:35:05 +08:00
|
|
|
export interface knowledgeInfo {
|
2026-02-02 14:04:37 +08:00
|
|
|
id?: string;
|
|
|
|
|
name: string;
|
|
|
|
|
description?: string;
|
2026-03-30 17:35:05 +08:00
|
|
|
fileCount?: number;
|
|
|
|
|
totalSize?: number;
|
2026-02-02 14:04:37 +08:00
|
|
|
createdAt?: string;
|
|
|
|
|
updatedAt?: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 17:35:05 +08:00
|
|
|
// 获取知识库列表
|
|
|
|
|
export function listknowledges(params: knowledgeQueryParams) {
|
2026-04-01 15:45:39 +08:00
|
|
|
return request({
|
2026-04-10 14:15:51 +08:00
|
|
|
url: '/rag/dataset/list',
|
2026-02-02 14:04:37 +08:00
|
|
|
method: 'get',
|
|
|
|
|
params,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 17:35:05 +08:00
|
|
|
// 创建知识库
|
|
|
|
|
export function createknowledge(data: CreateknowledgeParams) {
|
2026-04-01 15:45:39 +08:00
|
|
|
return request({
|
2026-04-10 14:15:51 +08:00
|
|
|
url: '/rag/dataset/create',
|
2026-02-02 14:04:37 +08:00
|
|
|
method: 'post',
|
|
|
|
|
data,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 17:35:05 +08:00
|
|
|
// 更新知识库
|
|
|
|
|
export function updateknowledge(data: UpdateknowledgeParams) {
|
2026-04-01 15:45:39 +08:00
|
|
|
return request({
|
2026-04-10 14:15:51 +08:00
|
|
|
url: '/rag/dataset/update',
|
2026-03-24 18:00:17 +08:00
|
|
|
method: 'put',
|
|
|
|
|
data,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 17:35:05 +08:00
|
|
|
// 删除知识库
|
|
|
|
|
export function deleteknowledge(id: string) {
|
2026-04-01 15:45:39 +08:00
|
|
|
return request({
|
2026-04-10 14:15:51 +08:00
|
|
|
url: '/rag/dataset/delete',
|
2026-02-02 14:04:37 +08:00
|
|
|
method: 'delete',
|
|
|
|
|
params: { id },
|
|
|
|
|
});
|
|
|
|
|
}
|