fix: add message_history_window_size to GenerateForm #1472 (#1487)

### What problem does this PR solve?
fix: add message_history_window_size to  GenerateForm #1472
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-12 16:11:49 +08:00
committed by GitHub
parent 740714b79d
commit de8267cfd7
5 changed files with 24 additions and 6 deletions

View File

@ -2,6 +2,8 @@ import { ReactComponent as BaiduIcon } from '@/assets/svg/baidu.svg';
import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
import { variableEnabledFieldMap } from '@/constants/chat';
import i18n from '@/locales/config';
import {
BranchesOutlined,
DatabaseOutlined,
@ -162,10 +164,9 @@ const initialLlmBaseValues = {
export const initialGenerateValues = {
...initialLlmBaseValues,
prompt: `Please summarize the following paragraphs. Be careful with the numbers, do not make things up. Paragraphs as following:
{input}
The above is the content you need to summarize.`,
prompt: i18n.t('flow.promptText'),
cite: true,
message_history_window_size: 12,
parameters: [],
};

View File

@ -1,6 +1,6 @@
import LLMSelect from '@/components/llm-select';
import { useTranslate } from '@/hooks/commonHooks';
import { Form, Input, Switch } from 'antd';
import { Form, Input, InputNumber, Switch } from 'antd';
import { useSetLlmSetting } from '../hooks';
import { IOperatorForm } from '../interface';
import DynamicParameters from './dynamic-parameters';
@ -13,8 +13,8 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
return (
<Form
name="basic"
labelCol={{ span: 5 }}
wrapperCol={{ span: 19 }}
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}
autoComplete="off"
form={form}
onValuesChange={onValuesChange}
@ -49,6 +49,14 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
>
<Switch />
</Form.Item>
<Form.Item
name={'message_history_window_size'}
label={t('messageHistoryWindowSize')}
initialValue={12}
tooltip={t('messageHistoryWindowSizeTip')}
>
<InputNumber style={{ width: '100%' }} />
</Form.Item>
<DynamicParameters nodeId={node?.id}></DynamicParameters>
</Form>
);