mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 11:49:00 +08:00
### What problem does this PR solve? Feat: Modify the Preset configurations item style to distinguish it from other fields #4844 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
78982d88e0
commit
e4bd879686
@ -3,11 +3,12 @@ import {
|
|||||||
ModelVariableType,
|
ModelVariableType,
|
||||||
settledModelVariableMap,
|
settledModelVariableMap,
|
||||||
} from '@/constants/knowledge';
|
} from '@/constants/knowledge';
|
||||||
import { Divider, Flex, Form, InputNumber, Select, Slider, Switch } from 'antd';
|
import { Flex, Form, InputNumber, Select, Slider, Switch, Tooltip } from 'antd';
|
||||||
import camelCase from 'lodash/camelCase';
|
import camelCase from 'lodash/camelCase';
|
||||||
|
|
||||||
import { useTranslate } from '@/hooks/common-hooks';
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
|
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
|
||||||
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
@ -55,19 +56,33 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
>
|
>
|
||||||
<Select options={modelOptions} showSearch />
|
<Select options={modelOptions} showSearch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Divider></Divider>
|
<div className="border rounded-md">
|
||||||
|
<div className="flex justify-between bg-slate-100 p-2 mb-2">
|
||||||
|
<div className="space-x-1 items-center">
|
||||||
|
<span className="text-lg font-semibold">{t('freedom')}</span>
|
||||||
|
<Tooltip title={t('freedomTip')}>
|
||||||
|
<QuestionCircleOutlined></QuestionCircleOutlined>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
<div className="w-1/4 min-w-32">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('freedom')}
|
label={t('freedom')}
|
||||||
name="parameter"
|
name="parameter"
|
||||||
tooltip={t('freedomTip')}
|
tooltip={t('freedomTip')}
|
||||||
{...formItemLayout}
|
|
||||||
initialValue={ModelVariableType.Precise}
|
initialValue={ModelVariableType.Precise}
|
||||||
|
labelCol={{ span: 0 }}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
className="m-0"
|
||||||
>
|
>
|
||||||
<Select<ModelVariableType>
|
<Select<ModelVariableType>
|
||||||
options={parameterOptions}
|
options={parameterOptions}
|
||||||
onChange={handleParametersChange}
|
onChange={handleParametersChange}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="pr-2">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('temperature')}
|
label={t('temperature')}
|
||||||
tooltip={t('temperatureTip')}
|
tooltip={t('temperatureTip')}
|
||||||
@ -99,7 +114,10 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Form.Item name={[...memorizedPrefix, 'temperature']} noStyle>
|
<Form.Item
|
||||||
|
name={[...memorizedPrefix, 'temperature']}
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
className={styles.sliderInputNumber}
|
className={styles.sliderInputNumber}
|
||||||
max={1}
|
max={1}
|
||||||
@ -114,7 +132,11 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t('topP')} tooltip={t('topPTip')} {...formItemLayout}>
|
<Form.Item
|
||||||
|
label={t('topP')}
|
||||||
|
tooltip={t('topPTip')}
|
||||||
|
{...formItemLayout}
|
||||||
|
>
|
||||||
<Flex gap={20} align="center">
|
<Flex gap={20} align="center">
|
||||||
<Form.Item name={'topPEnabled'} valuePropName="checked" noStyle>
|
<Form.Item name={'topPEnabled'} valuePropName="checked" noStyle>
|
||||||
<Switch size="small" />
|
<Switch size="small" />
|
||||||
@ -253,7 +275,11 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
{...formItemLayout}
|
{...formItemLayout}
|
||||||
>
|
>
|
||||||
<Flex gap={20} align="center">
|
<Flex gap={20} align="center">
|
||||||
<Form.Item name={'maxTokensEnabled'} valuePropName="checked" noStyle>
|
<Form.Item
|
||||||
|
name={'maxTokensEnabled'}
|
||||||
|
valuePropName="checked"
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
<Switch size="small" />
|
<Switch size="small" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item noStyle dependencies={['maxTokensEnabled']}>
|
<Form.Item noStyle dependencies={['maxTokensEnabled']}>
|
||||||
@ -274,7 +300,10 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Form.Item name={[...memorizedPrefix, 'max_tokens']} noStyle>
|
<Form.Item
|
||||||
|
name={[...memorizedPrefix, 'max_tokens']}
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
className={styles.sliderInputNumber}
|
className={styles.sliderInputNumber}
|
||||||
@ -288,6 +317,8 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user