feat: submit api key and add language to Configuration and fetch llm factory list on UserSettingModel mount (#121)

* feat: fetch llm factory list on UserSettingModel mount

* feat: add language to Configuration

* feat: submit api key
This commit is contained in:
balibabu
2024-03-12 18:58:09 +08:00
committed by GitHub
parent 0feb085c88
commit 2ca0dc0fc5
8 changed files with 422 additions and 35 deletions

View File

@ -2,11 +2,19 @@ import {
useFetchKnowledgeBaseConfiguration,
useKnowledgeBaseId,
} from '@/hooks/knowledgeHook';
import { useFetchLlmList, useSelectLlmOptions } from '@/hooks/llmHooks';
import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
import {
useFetchTenantInfo,
useSelectParserList,
} from '@/hooks/userSettingHook';
import { IKnowledge } from '@/interfaces/database/knowledge';
import {
getBase64FromUploadFileList,
getUploadFileListFromBase64,
normFile,
} from '@/utils/fileUtil';
import { PlusOutlined } from '@ant-design/icons';
import {
Button,
Divider,
@ -25,17 +33,8 @@ import {
import pick from 'lodash/pick';
import { useEffect } from 'react';
import { useDispatch, useSelector } from 'umi';
import { useFetchLlmList, useSelectLlmOptions } from '@/hooks/llmHooks';
import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
import { IKnowledge } from '@/interfaces/database/knowledge';
import {
getBase64FromUploadFileList,
getUploadFileListFromBase64,
normFile,
} from '@/utils/fileUtil';
import { PlusOutlined } from '@ant-design/icons';
import { LlmModelType } from '../../constant';
import styles from './index.less';
const { Title } = Typography;
@ -83,6 +82,7 @@ const Configuration = () => {
'permission',
'embd_id',
'parser_id',
'language',
'parser_config.chunk_token_num',
]),
avatar: fileList,
@ -131,9 +131,20 @@ const Configuration = () => {
</button>
</Upload>
</Form.Item>
<Form.Item name="description" label="Knowledge base bio">
<Form.Item name="description" label="Description">
<Input />
</Form.Item>
<Form.Item
label="Language"
name="language"
initialValue={'Chinese'}
rules={[{ required: true, message: 'Please input your language!' }]}
>
<Select placeholder="select your language">
<Option value="English">English</Option>
<Option value="Chinese">Chinese</Option>
</Select>
</Form.Item>
<Form.Item
name="permission"
label="Permissions"
@ -207,7 +218,6 @@ const Configuration = () => {
</Form.Item>
);
}
return null;
}}
</Form.Item>