diff --git a/ui/src/api/dataset.ts b/ui/src/api/dataset.ts index 895782feb..b05dab50f 100644 --- a/ui/src/api/dataset.ts +++ b/ui/src/api/dataset.ts @@ -82,7 +82,7 @@ const postDateset: (data: datasetData, loading?: Ref) => Promise) => Promise * 知识库详情 * @param 参数 dataset_id */ -const getDatesetDetail: (dataset_id: string) => Promise> = (dataset_id) => { - return get(`${prefix}/${dataset_id}`) +const getDatesetDetail: (dataset_id: string, loading?: Ref) => Promise> = ( + dataset_id, + loading +) => { + return get(`${prefix}/${dataset_id}`, undefined, loading) } /** @@ -144,6 +147,19 @@ const getDatasetHitTest: ( return get(`${prefix}/${dataset_id}/hit_test`, data, loading) } +/** + * 同步知识库 + * @param 参数 dataset_id + * @query 参数 sync_type // 同步类型->replace:替换同步,complete:完整同步 + */ +const getSyncWebDateset: ( + dataset_id: string, + sync_type: string, + loading?: Ref +) => Promise> = (dataset_id, sync_type, loading) => { + return get(`${prefix}/${dataset_id}`, { sync_type }, loading) +} + export default { getDateset, getAllDateset, @@ -153,5 +169,6 @@ export default { putDateset, listUsableApplication, getDatasetHitTest, - postWebDateset + postWebDateset, + getSyncWebDateset } diff --git a/ui/src/api/document.ts b/ui/src/api/document.ts index 4e16522cf..06580d269 100644 --- a/ui/src/api/document.ts +++ b/ui/src/api/document.ts @@ -109,7 +109,16 @@ const delDocument: (dataset_id: string, document_id: string) => Promise { return del(`${prefix}/${dataset_id}/document/${document_id}`) } - +// /** +// * 批量删除文档 +// * @param 参数 dataset_id, document_id, +// */ +// const delDocument: (dataset_id: string, document_id: string) => Promise> = ( +// dataset_id, +// document_id +// ) => { +// return del(`${prefix}/${dataset_id}/document/${document_id}`) +// } /** * 文档详情 * @param 参数 dataset_id diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index fe4c8e79e..adb08f15b 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -11,12 +11,32 @@
+ + + - +
-
- 关联的知识库展示在这里 -
-
+
+ + + - +