mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 23:19:03 +08:00
### What problem does this PR solve? feat: Add message_history_window_size to CategorizeForm #1739 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
This commit is contained in:
parent
b164116277
commit
85b359556e
23
web/src/components/message-history-window-size-item.tsx
Normal file
23
web/src/components/message-history-window-size-item.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { Form, InputNumber } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const MessageHistoryWindowSizeItem = ({
|
||||
initialValue,
|
||||
}: {
|
||||
initialValue: number;
|
||||
}) => {
|
||||
const { t } = useTranslation('flow');
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
name={'message_history_window_size'}
|
||||
label={t('messageHistoryWindowSize')}
|
||||
initialValue={initialValue}
|
||||
tooltip={t('messageHistoryWindowSizeTip')}
|
||||
>
|
||||
<InputNumber style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
);
|
||||
};
|
||||
|
||||
export default MessageHistoryWindowSizeItem;
|
@ -366,6 +366,7 @@ export const initialRelevantValues = {
|
||||
|
||||
export const initialCategorizeValues = {
|
||||
...initialLlmBaseValues,
|
||||
message_history_window_size: 1,
|
||||
category_description: {},
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import LLMSelect from '@/components/llm-select';
|
||||
import MessageHistoryWindowSizeItem from '@/components/message-history-window-size-item';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { Form } from 'antd';
|
||||
import { useSetLlmSetting } from '../../hooks';
|
||||
@ -31,6 +32,9 @@ const CategorizeForm = ({ form, onValuesChange, node }: IOperatorForm) => {
|
||||
>
|
||||
<LLMSelect></LLMSelect>
|
||||
</Form.Item>
|
||||
<MessageHistoryWindowSizeItem
|
||||
initialValue={1}
|
||||
></MessageHistoryWindowSizeItem>
|
||||
<DynamicCategorize nodeId={node?.id}></DynamicCategorize>
|
||||
</Form>
|
||||
);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import LLMSelect from '@/components/llm-select';
|
||||
import MessageHistoryWindowSizeItem from '@/components/message-history-window-size-item';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { Form, Input, InputNumber, Switch } from 'antd';
|
||||
import { Form, Input, Switch } from 'antd';
|
||||
import { useSetLlmSetting } from '../../hooks';
|
||||
import { IOperatorForm } from '../../interface';
|
||||
import DynamicParameters from './dynamic-parameters';
|
||||
@ -48,14 +49,9 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={'message_history_window_size'}
|
||||
label={t('messageHistoryWindowSize')}
|
||||
<MessageHistoryWindowSizeItem
|
||||
initialValue={12}
|
||||
tooltip={t('messageHistoryWindowSizeTip')}
|
||||
>
|
||||
<InputNumber style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
></MessageHistoryWindowSizeItem>
|
||||
<DynamicParameters nodeId={node?.id}></DynamicParameters>
|
||||
</Form>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user