mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: add custom edge (#1061)
### What problem does this PR solve? feat: add custom edge feat: add flow card feat: add store for canvas #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,16 +1,12 @@
|
||||
import {
|
||||
LlmModelType,
|
||||
ModelVariableType,
|
||||
settledModelVariableMap,
|
||||
} from '@/constants/knowledge';
|
||||
import { Divider, Flex, Form, InputNumber, Select, Slider, Switch } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { useEffect } from 'react';
|
||||
import { ISegmentedContentProps } from '../interface';
|
||||
|
||||
import { useTranslate } from '@/hooks/commonHooks';
|
||||
import { useSelectLlmOptionsByModelType } from '@/hooks/llmHooks';
|
||||
import LlmSettingItems from '@/components/llm-setting-items';
|
||||
import { Variable } from '@/interfaces/database/chat';
|
||||
import { variableEnabledFieldMap } from '../constants';
|
||||
import styles from './index.less';
|
||||
@ -24,14 +20,6 @@ const ModelSetting = ({
|
||||
initialLlmSetting?: Variable;
|
||||
visible?: boolean;
|
||||
}) => {
|
||||
const { t } = useTranslate('chat');
|
||||
const parameterOptions = Object.values(ModelVariableType).map((x) => ({
|
||||
label: t(camelCase(x)),
|
||||
value: x,
|
||||
}));
|
||||
|
||||
const modelOptions = useSelectLlmOptionsByModelType();
|
||||
|
||||
const handleParametersChange = (value: ModelVariableType) => {
|
||||
const variable = settledModelVariableMap[value];
|
||||
form.setFieldsValue({ llm_setting: variable });
|
||||
@ -62,7 +50,13 @@ const ModelSetting = ({
|
||||
[styles.segmentedHidden]: !show,
|
||||
})}
|
||||
>
|
||||
<Form.Item
|
||||
{visible && (
|
||||
<LlmSettingItems
|
||||
prefix="llm_setting"
|
||||
handleParametersChange={handleParametersChange}
|
||||
></LlmSettingItems>
|
||||
)}
|
||||
{/* <Form.Item
|
||||
label={t('model')}
|
||||
name="llm_id"
|
||||
tooltip={t('modelTip')}
|
||||
@ -279,7 +273,7 @@ const ModelSetting = ({
|
||||
}}
|
||||
</Form.Item>
|
||||
</Flex>
|
||||
</Form.Item>
|
||||
</Form.Item> */}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user