feat: save the selected parser to the backend on the upload file page and upload document (#54)

* feat: add pagination to document table

* feat: fetch document list by page

* feat: poll the document list

* feat: upload document

* feat: save the selected parser to the backend on the upload file page
This commit is contained in:
balibabu
2024-02-05 12:01:27 +08:00
committed by GitHub
parent 51482f3e2a
commit f305776217
18 changed files with 629 additions and 82 deletions

View File

@@ -1,6 +1,8 @@
import { ITenantInfo } from '@/interfaces/database/knowledge';
import userService from '@/services/userService';
import authorizationUtil from '@/utils/authorizationUtil';
import { message } from 'antd';
import { Nullable } from 'typings';
import { DvaModel } from 'umi';
export interface SettingModelState {
@@ -9,7 +11,7 @@ export interface SettingModelState {
isShowSAKModal: boolean;
isShowSSModal: boolean;
llm_factory: string;
tenantIfo: any;
tenantIfo: Nullable<ITenantInfo>;
llmInfo: any;
myLlm: any[];
factoriesList: any[];
@@ -23,7 +25,7 @@ const model: DvaModel<SettingModelState> = {
isShowSAKModal: false,
isShowSSModal: false,
llm_factory: '',
tenantIfo: {},
tenantIfo: null,
llmInfo: {},
myLlm: [],
factoriesList: [],
@@ -73,23 +75,11 @@ const model: DvaModel<SettingModelState> = {
}
},
*getTenantInfo({ payload = {} }, { call, put }) {
yield put({
type: 'updateState',
payload: {
loading: true,
},
});
const { data } = yield call(userService.get_tenant_info, payload);
const { retcode, data: res } = data;
// llm_id 对应chat_id
// asr_id 对应speech2txt
yield put({
type: 'updateState',
payload: {
loading: false,
},
});
if (retcode === 0) {
res.chat_id = res.llm_id;
res.speech2text_id = res.asr_id;