mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-01 16:15:07 +08:00
Fix:Bugs fix (Reduce metadata saving steps ...) (#12095)
### What problem does this PR solve? Fix:Bugs fix - Configure memory and metadata (in Chinese) - Add indexing modal - Reduce metadata saving steps ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { DynamicForm } from '@/components/dynamic-form';
|
||||
import { useModelOptions } from '@/components/llm-setting-items/llm-form-field';
|
||||
import { HomeIcon } from '@/components/svg-icon';
|
||||
import { Modal } from '@/components/ui/modal/modal';
|
||||
import { memo, useMemo } from 'react';
|
||||
@ -18,7 +17,7 @@ type IProps = {
|
||||
export const AddOrEditModal = memo((props: IProps) => {
|
||||
const { open, onClose, onSubmit, initialMemory, isCreate } = props;
|
||||
const { t } = useTranslation();
|
||||
const { modelOptions } = useModelOptions();
|
||||
// const { modelOptions } = useModelOptions();
|
||||
|
||||
const fields = useMemo(() => {
|
||||
if (!isCreate) {
|
||||
@ -26,21 +25,22 @@ export const AddOrEditModal = memo((props: IProps) => {
|
||||
(field: any) => field.name === 'name',
|
||||
);
|
||||
} else {
|
||||
const tempFields = createMemoryFields(t).map((field: any) => {
|
||||
if (field.name === 'llm_id') {
|
||||
return {
|
||||
...field,
|
||||
options: modelOptions,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...field,
|
||||
};
|
||||
}
|
||||
});
|
||||
return tempFields;
|
||||
// const tempFields = createMemoryFields(t).map((field: any) => {
|
||||
// if (field.name === 'llm_id') {
|
||||
// return {
|
||||
// ...field,
|
||||
// options: modelOptions,
|
||||
// };
|
||||
// } else {
|
||||
// return {
|
||||
// ...field,
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
// return tempFields;
|
||||
return createMemoryFields(t);
|
||||
}
|
||||
}, [modelOptions, isCreate]);
|
||||
}, [isCreate, t]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { FormFieldConfig, FormFieldType } from '@/components/dynamic-form';
|
||||
import { EmbeddingSelect } from '@/pages/dataset/dataset-setting/configuration/common-item';
|
||||
import {
|
||||
EmbeddingSelect,
|
||||
LLMSelect,
|
||||
} from '@/pages/dataset/dataset-setting/configuration/common-item';
|
||||
import { TFunction } from 'i18next';
|
||||
export enum MemoryType {
|
||||
Raw = 'raw',
|
||||
@ -52,6 +55,7 @@ export const createMemoryFields = (t: TFunction) =>
|
||||
required: true,
|
||||
type: FormFieldType.Select,
|
||||
tooltip: t('memories.llmTooltip'),
|
||||
render: (field) => <LLMSelect field={field} isEdit={false} />,
|
||||
},
|
||||
] as FormFieldConfig[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user