feat: fetch knowledge detail on KnowledgeUploadFile mount and add category column to chunk table and set initial value for the model field of chat setting (#104)

* feat: set initial value for the model field of chat setting

* feat: add category column to chunk table

* feat: fetch knowledge detail on KnowledgeUploadFile mount
This commit is contained in:
balibabu
2024-03-06 19:17:45 +08:00
committed by GitHub
parent b89ac3c4be
commit aaf3084324
14 changed files with 230 additions and 320 deletions

View File

@ -13,6 +13,7 @@ import { variableEnabledFieldMap } from '../constants';
import { useFetchDialog, useResetCurrentDialog, useSetDialog } from '../hooks';
import { IPromptConfigParameters } from '../interface';
import { excludeUnEnabledVariables } from '../utils';
import { useFetchModelId } from './hooks';
import styles from './index.less';
enum ConfigurationSegmented {
@ -54,6 +55,7 @@ const ChatConfigurationModal = ({ visible, hideModal, id }: IProps) => {
);
const promptEngineRef = useRef<Array<IPromptConfigParameters>>([]);
const loading = useOneNamespaceEffectsLoading('chatModel', ['setDialog']);
const modelId = useFetchModelId(visible);
const setDialog = useSetDialog();
const currentDialog = useFetchDialog(id, visible);
@ -128,9 +130,13 @@ const ChatConfigurationModal = ({ visible, hideModal, id }: IProps) => {
if (icon) {
fileList = [{ uid: '1', name: 'file', thumbUrl: icon, status: 'done' }];
}
form.setFieldsValue({ ...currentDialog, icon: fileList });
form.setFieldsValue({
...currentDialog,
icon: fileList,
llm_id: currentDialog.llm_id ?? modelId,
});
}
}, [currentDialog, form, visible]);
}, [currentDialog, form, visible, modelId]);
return (
<Modal