From a9cc992d13153af1c2f0027a7d3c978615d04214 Mon Sep 17 00:00:00 2001 From: balibabu Date: Wed, 10 Sep 2025 10:56:34 +0800 Subject: [PATCH] Feat: Translate the maxRounds field of the chat settings #3221 (#10010) ### What problem does this PR solve? Feat: Translate the maxRounds field of the chat settings #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/locales/en.ts | 2 +- web/src/locales/zh.ts | 2 +- web/src/pages/agent/form/agent-form/index.tsx | 28 ++++++++++--------- .../chat/app-settings/dynamic-variable.tsx | 4 +-- .../pages/next-chats/hooks/use-rename-chat.ts | 3 +- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index e89a4ff1d..a6916f3e5 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -932,7 +932,7 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s builtIn: 'Built-in', ExceptionDefaultValue: 'Exception default value', exceptionMethod: 'Exception method', - maxRounds: 'Max rounds', + maxRounds: 'Max reflection rounds', delayEfterError: 'Delay after error', maxRetries: 'Max retries', advancedSettings: 'Advanced Settings', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 55dfe80d1..fb19ed8ff 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -890,7 +890,7 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于 comment: '默认值', ExceptionDefaultValue: '异常处理默认值', exceptionMethod: '异常处理方法', - maxRounds: '最大轮数', + maxRounds: '最大反思轮数', delayEfterError: '错误后延迟', maxRetries: '最大重试次数', advancedSettings: '高级设置', diff --git a/web/src/pages/agent/form/agent-form/index.tsx b/web/src/pages/agent/form/agent-form/index.tsx index f761e6d3c..5aba35826 100644 --- a/web/src/pages/agent/form/agent-form/index.tsx +++ b/web/src/pages/agent/form/agent-form/index.tsx @@ -31,7 +31,7 @@ import { } from '../../constant'; import { INextOperatorForm } from '../../interface'; import useGraphStore from '../../store'; -import { isBottomSubAgent } from '../../utils'; +import { hasSubAgentOrTool, isBottomSubAgent } from '../../utils'; import { buildOutputList } from '../../utils/build-output-list'; import { DescriptionField } from '../components/description-field'; import { FormWrapper } from '../components/form-wrapper'; @@ -231,18 +231,20 @@ function AgentForm({ node }: INextOperatorForm) { )} /> - ( - - {t('flow.maxRounds')} - - - - - )} - /> + {hasSubAgentOrTool(edges, node?.id) && ( + ( + + {t('flow.maxRounds')} + + + + + )} + /> + )}
- Key + {t('chat.key')} - Optional + {t('chat.optional')}
{fields.map((field, index) => { diff --git a/web/src/pages/next-chats/hooks/use-rename-chat.ts b/web/src/pages/next-chats/hooks/use-rename-chat.ts index fd2b975eb..0f240169a 100644 --- a/web/src/pages/next-chats/hooks/use-rename-chat.ts +++ b/web/src/pages/next-chats/hooks/use-rename-chat.ts @@ -22,6 +22,7 @@ export const useRenameChat = () => { name: '', icon: '', language: 'English', + description: '', prompt_config: { empty_response: '', prologue: t('chat.setAnOpenerInitial'), @@ -37,7 +38,7 @@ export const useRenameChat = () => { llm_id: tenantInfo.data.llm_id, llm_setting: {}, similarity_threshold: 0.2, - vector_similarity_weight: 0.30000000000000004, + vector_similarity_weight: 0.3, top_n: 8, }), [t, tenantInfo.data.llm_id],