mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-01 08:06:15 +08:00
### 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:
parent
740714b79d
commit
de8267cfd7
@ -609,6 +609,9 @@ The above is the content you need to summarize.`,
|
|||||||
channelTip: `Perform text search or news search on the component's input`,
|
channelTip: `Perform text search or news search on the component's input`,
|
||||||
text: 'Text',
|
text: 'Text',
|
||||||
news: 'News',
|
news: 'News',
|
||||||
|
messageHistoryWindowSize: 'Message window size',
|
||||||
|
messageHistoryWindowSizeTip:
|
||||||
|
'The window size of conversation history that needed to be seen by LLM. The larger the better. But be careful with the maximum content length of LLM.',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -570,6 +570,9 @@ export default {
|
|||||||
channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索',
|
channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索',
|
||||||
text: '文字',
|
text: '文字',
|
||||||
news: '新聞',
|
news: '新聞',
|
||||||
|
messageHistoryWindowSize: '歷史訊息視窗大小',
|
||||||
|
messageHistoryWindowSizeTip:
|
||||||
|
'LLM需要查看的對話記錄的視窗大小。越大越好。但要注意LLM的最大內容長度。',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: '“保留所有權利 @ react”',
|
profile: '“保留所有權利 @ react”',
|
||||||
|
@ -588,6 +588,9 @@ export default {
|
|||||||
channelTip: '针对该组件的输入进行文本搜索或新闻搜索',
|
channelTip: '针对该组件的输入进行文本搜索或新闻搜索',
|
||||||
text: '文本',
|
text: '文本',
|
||||||
news: '新闻',
|
news: '新闻',
|
||||||
|
messageHistoryWindowSize: '历史消息窗口大小',
|
||||||
|
messageHistoryWindowSizeTip:
|
||||||
|
'LLM 需要查看的对话历史窗口大小。越大越好。但要注意 LLM 的最大内容长度。',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -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 DuckIcon } from '@/assets/svg/duck.svg';
|
||||||
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
|
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
|
||||||
import { variableEnabledFieldMap } from '@/constants/chat';
|
import { variableEnabledFieldMap } from '@/constants/chat';
|
||||||
|
import i18n from '@/locales/config';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BranchesOutlined,
|
BranchesOutlined,
|
||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
@ -162,10 +164,9 @@ const initialLlmBaseValues = {
|
|||||||
|
|
||||||
export const initialGenerateValues = {
|
export const initialGenerateValues = {
|
||||||
...initialLlmBaseValues,
|
...initialLlmBaseValues,
|
||||||
prompt: `Please summarize the following paragraphs. Be careful with the numbers, do not make things up. Paragraphs as following:
|
prompt: i18n.t('flow.promptText'),
|
||||||
{input}
|
|
||||||
The above is the content you need to summarize.`,
|
|
||||||
cite: true,
|
cite: true,
|
||||||
|
message_history_window_size: 12,
|
||||||
parameters: [],
|
parameters: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import LLMSelect from '@/components/llm-select';
|
import LLMSelect from '@/components/llm-select';
|
||||||
import { useTranslate } from '@/hooks/commonHooks';
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
import { Form, Input, Switch } from 'antd';
|
import { Form, Input, InputNumber, 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';
|
||||||
@ -13,8 +13,8 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 5 }}
|
labelCol={{ span: 10 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 14 }}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
@ -49,6 +49,14 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</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>
|
<DynamicParameters nodeId={node?.id}></DynamicParameters>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user