### 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):tags/v0.13.0
| 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; | 
| export const initialCategorizeValues = { | export const initialCategorizeValues = { | ||||
| ...initialLlmBaseValues, | ...initialLlmBaseValues, | ||||
| message_history_window_size: 1, | |||||
| category_description: {}, | category_description: {}, | ||||
| }; | }; | ||||
| import LLMSelect from '@/components/llm-select'; | import LLMSelect from '@/components/llm-select'; | ||||
| import MessageHistoryWindowSizeItem from '@/components/message-history-window-size-item'; | |||||
| import { useTranslate } from '@/hooks/common-hooks'; | import { useTranslate } from '@/hooks/common-hooks'; | ||||
| import { Form } from 'antd'; | import { Form } from 'antd'; | ||||
| import { useSetLlmSetting } from '../../hooks'; | import { useSetLlmSetting } from '../../hooks'; | ||||
| > | > | ||||
| <LLMSelect></LLMSelect> | <LLMSelect></LLMSelect> | ||||
| </Form.Item> | </Form.Item> | ||||
| <MessageHistoryWindowSizeItem | |||||
| initialValue={1} | |||||
| ></MessageHistoryWindowSizeItem> | |||||
| <DynamicCategorize nodeId={node?.id}></DynamicCategorize> | <DynamicCategorize nodeId={node?.id}></DynamicCategorize> | ||||
| </Form> | </Form> | ||||
| ); | ); | 
| import LLMSelect from '@/components/llm-select'; | import LLMSelect from '@/components/llm-select'; | ||||
| import MessageHistoryWindowSizeItem from '@/components/message-history-window-size-item'; | |||||
| import { useTranslate } from '@/hooks/common-hooks'; | import { useTranslate } from '@/hooks/common-hooks'; | ||||
| import { Form, Input, InputNumber, Switch } from 'antd'; | |||||
| import { Form, Input, Switch } from 'antd'; | |||||
| import { useSetLlmSetting } from '../../hooks'; | import { useSetLlmSetting } from '../../hooks'; | ||||
| import { IOperatorForm } from '../../interface'; | import { IOperatorForm } from '../../interface'; | ||||
| import DynamicParameters from './dynamic-parameters'; | import DynamicParameters from './dynamic-parameters'; | ||||
| > | > | ||||
| <Switch /> | <Switch /> | ||||
| </Form.Item> | </Form.Item> | ||||
| <Form.Item | |||||
| name={'message_history_window_size'} | |||||
| label={t('messageHistoryWindowSize')} | |||||
| <MessageHistoryWindowSizeItem | |||||
| initialValue={12} | initialValue={12} | ||||
| tooltip={t('messageHistoryWindowSizeTip')} | |||||
| > | |||||
| <InputNumber style={{ width: '100%' }} /> | |||||
| </Form.Item> | |||||
| ></MessageHistoryWindowSizeItem> | |||||
| <DynamicParameters nodeId={node?.id}></DynamicParameters> | <DynamicParameters nodeId={node?.id}></DynamicParameters> | ||||
| </Form> | </Form> | ||||
| ); | ); |