diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index 93599769f..cf4a299c9 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -221,19 +221,7 @@ const putChatVote: ( ) } -/** - * 对话日志 - * @param 参数 - * application_id, history_day -} - */ -const getChatLog: ( - applicaiton_id: String, - history_day: number, - loading?: Ref -) => Promise> = (applicaiton_id, history_day, loading) => { - return get(`${prefix}/${applicaiton_id}/chat`, { history_day }, loading) -} + export default { getAllAppilcation, getApplication, @@ -250,5 +238,4 @@ export default { postAppAuthentication, getProfile, putChatVote, - getChatLog } diff --git a/ui/src/api/document.ts b/ui/src/api/document.ts index 2b75fd6f6..6ee443c2e 100644 --- a/ui/src/api/document.ts +++ b/ui/src/api/document.ts @@ -2,6 +2,7 @@ import { Result } from '@/request/Result' import { get, post, del, put } from '@/request/index' import type { Ref } from 'vue' import type { KeyValue } from '@/api/type/common' +import type { pageRequest } from '@/api/type/common' const prefix = '/dataset' /** @@ -17,22 +18,35 @@ const postSplitDocument: (data: any) => Promise> = (data) => { * @param loading 加载器 * @returns 分段标识列表 */ -const listSplitPattern: (loading?: Ref) => Promise>>> = ( - loading -) => { +const listSplitPattern: ( + loading?: Ref +) => Promise>>> = (loading) => { return get(`${prefix}/document/split_pattern`, {}, loading) } /** * 文档列表 - * @param 参数 dataset_id, name + * @param 参数 dataset_id, + * page { + "current_page": "string", + "page_size": "string", + } +* param { + "name": "string", + } */ -const getDocument: (dataset_id: string, name?: string) => Promise> = ( - dataset_id, - name -) => { - return get(`${prefix}/${dataset_id}/document`, name && { name }) +const getDocument: ( + dataset_id: string, + page: pageRequest, + param: any, + loading?: Ref +) => Promise> = (dataset_id, page, param, loading) => { + return get( + `${prefix}/${dataset_id}/document/${page.current_page}/${page.page_size}`, + param, + loading + ) } /** @@ -100,8 +114,6 @@ const getDocumentDetail: (dataset_id: string, document_id: string) => Promise +) => Promise> = (applicaiton_id, page, param, loading) => { + return get( + `${prefix}/${applicaiton_id}/chat/${page.current_page}/${page.page_size}`, + param, + loading + ) +} + +export default { + getChatLog +} diff --git a/ui/src/api/paragraph.ts b/ui/src/api/paragraph.ts index 178ca1e34..6938e703c 100644 --- a/ui/src/api/paragraph.ts +++ b/ui/src/api/paragraph.ts @@ -1,16 +1,33 @@ import { Result } from '@/request/Result' import { get, post, del, put } from '@/request/index' +import type { pageRequest } from '@/api/type/common' +import type { Ref } from 'vue' const prefix = '/dataset' /** * 段落列表 - * @param 参数 dataset_id + * @param 参数 dataset_id document_id + * page { + "current_page": "string", + "page_size": "string", + } + * param { + "title": "string", + "content": "string", + } */ -const getParagraph: (dataset_id: string, document_id: string) => Promise> = ( - dataset_id, - document_id -) => { - return get(`${prefix}/${dataset_id}/document/${document_id}/paragraph`) +const getParagraph: ( + dataset_id: string, + document_id: string, + page: pageRequest, + param: any, + loading?: Ref +) => Promise> = (dataset_id, document_id, page, param, loading) => { + return get( + `${prefix}/${dataset_id}/document/${document_id}/paragraph/${page.current_page}/${page.page_size}`, + param, + loading + ) } /** @@ -128,5 +145,5 @@ export default { postParagraph, getProblem, postProblem, - delProblem, + delProblem } diff --git a/ui/src/api/type/common.ts b/ui/src/api/type/common.ts index 78f14df24..1912b77f8 100644 --- a/ui/src/api/type/common.ts +++ b/ui/src/api/type/common.ts @@ -9,7 +9,6 @@ interface Dict { interface pageRequest { current_page: number page_size: number - name: string } export type { KeyValue, Dict, pageRequest } diff --git a/ui/src/components/ai-dialog/OperationButton.vue b/ui/src/components/ai-chat/OperationButton.vue similarity index 100% rename from ui/src/components/ai-dialog/OperationButton.vue rename to ui/src/components/ai-chat/OperationButton.vue diff --git a/ui/src/components/ai-dialog/index.vue b/ui/src/components/ai-chat/index.vue similarity index 98% rename from ui/src/components/ai-dialog/index.vue rename to ui/src/components/ai-chat/index.vue index df718fdb0..ee306cb82 100644 --- a/ui/src/components/ai-dialog/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -1,7 +1,7 @@ -
+