Rewrite Support specified language or language according to initial question (#4990)

Support specified language or language according to initial question

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
so95
2025-02-17 12:33:43 +07:00
committed by GitHub
parent 7c90b87715
commit ab17606e79
5 changed files with 74 additions and 25 deletions

View File

@ -523,6 +523,8 @@ This procedure will improve precision of retrieval by adding more information to
'It will retrieve descriptions of relevant entities,relations and community reports, which will enhance inference of multi-hop and complex question.',
keyword: 'Keyword analysis',
keywordTip: `Apply LLM to analyze user's questions, extract keywords which will be emphesize during the relevance omputation.`,
languageTip:
'Allows sentence rewriting with the specified language or defaults to the latest question if not selected.',
},
setting: {
profile: 'Profile',

View File

@ -426,6 +426,7 @@ export const initialGenerateValues = {
export const initialRewriteQuestionValues = {
...initialLlmBaseValues,
language: '',
message_history_window_size: 6,
};

View File

@ -166,6 +166,7 @@ const FormDrawer = ({
></Input>
)}
</Flex>
{needsSingleStepDebugging(operatorName) && (
<RunTooltip>
<Play

View File

@ -1,7 +1,8 @@
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 { Form, Select } from 'antd';
import { GoogleLanguageOptions } from '../../constant';
import { IOperatorForm } from '../../interface';
const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
@ -23,6 +24,13 @@ const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
>
<LLMSelect></LLMSelect>
</Form.Item>
<Form.Item
label={t('language')}
name={'language'}
tooltip={t('languageTip')}
>
<Select options={GoogleLanguageOptions} allowClear={true}></Select>
</Form.Item>
<MessageHistoryWindowSizeItem
initialValue={6}
></MessageHistoryWindowSizeItem>