diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index 1259aff33..7e3a3ffaa 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -29,6 +29,32 @@ const getApplication: (param: pageRequest) => Promise> = (param) => ) } +/** + * 获得临时回话Id + * @param 参数 + * { + "model_id": "string", + "multiple_rounds_dialogue": true, + "dataset_id_list": [ + "string" + ] +} + */ +const postChatOpen: (data: ApplicationFormType) => Promise> = (data) => { + return post(`${prefix}/chat/open`, data) +} +/** + * 对话 + * @param 参数 + * chat_id: string + * { + "message": "string", + } + */ +const postChatMessage: (chat_id: string, message: string) => Promise = (chat_id, message) => { + return postStream(`/api/${prefix}/chat_message/${chat_id}`, { message }) +} + /** * 创建应用 * @param 参数 @@ -46,36 +72,10 @@ const getApplication: (param: pageRequest) => Promise> = (param) => ] } */ -const postApplication: (data: ApplicationFormType) => Promise> = (data) => { - return post(`${prefix}`, data) +const postApplication: ( data: ApplicationFormType, loading?: Ref ) => Promise> = (data, loading) => { + return post(`${prefix}`, data, undefined, loading) } -/** - * 获得临时回话Id - * @param 参数 - * { - "model_id": "string", - "multiple_rounds_dialogue": true, - "dataset_id_list": [ - "string" - ] -} - */ -const postChatOpen: (data: ApplicationFormType) => Promise> = (data) => { - return post(`${prefix}/chat/open`, data) -} -// 对话 -/** - * 创建数据集 - * @param 参数 - * chat_id: string - * { - "message": "string", - } - */ -const postChatMessage: (chat_id: string, message: string) => Promise = (chat_id, message) => { - return postStream(`/api/${prefix}/chat_message/${chat_id}`, { message }) -} export default { getAllAppilcation, getApplication, diff --git a/ui/src/views/application/CreateAndSetting.vue b/ui/src/views/application/CreateAndSetting.vue index 9cf0e123c..2c9ca2360 100644 --- a/ui/src/views/application/CreateAndSetting.vue +++ b/ui/src/views/application/CreateAndSetting.vue @@ -1,6 +1,6 @@