diff --git a/web/src/interfaces/database/chat.ts b/web/src/interfaces/database/chat.ts index 021ecaf2a..7c46c02f5 100644 --- a/web/src/interfaces/database/chat.ts +++ b/web/src/interfaces/database/chat.ts @@ -6,6 +6,10 @@ export interface PromptConfig { prologue: string; system: string; tts?: boolean; + quote: boolean; + keyword: boolean; + refine_multiturn: boolean; + use_kg: boolean; } export interface Parameter { @@ -26,6 +30,7 @@ export interface Variable { presence_penalty?: number; temperature?: number; top_p?: number; + llm_id?: string; } export interface IDialog { @@ -50,6 +55,8 @@ export interface IDialog { update_time: number; vector_similarity_weight: number; similarity_threshold: number; + top_k: number; + top_n: number; } export interface IConversation { diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index a2b069b96..df297aaa8 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -563,9 +563,16 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s crossLanguage: 'Cross-language search', crossLanguageTip: `Select one or more languages for cross‑language search. If no language is selected, the system searches with the original query.`, createChat: 'Create chat', - metadata: 'Metadata', - metadataTip: 'Metadata', + metadata: 'Meta Data', + metadataTip: + 'Metadata filtering is the process of using metadata attributes (such as tags, categories, or access permissions) to refine and control the retrieval of relevant information within a system.', conditions: 'Conditions', + addCondition: 'Add Condition', + meta: { + disabled: 'Disabled', + automatic: 'Automatic', + manual: 'Manual', + }, }, setting: { profile: 'Profile', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 6223f248b..031e22496 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -558,6 +558,16 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于 tavilyApiKeyHelp: '如何获取?', crossLanguage: '跨语言搜索', crossLanguageTip: `选择一种或多种语言进行跨语言搜索。如果未选择任何语言,系统将使用原始查询进行搜索。`, + metadata: '元数据', + metadataTip: + '元数据过滤是使用元数据属性(例如标签、类别或访问权限)来优化和控制系统内相关信息检索的过程。', + conditions: '条件', + addCondition: '增加条件', + meta: { + disabled: '禁用', + automatic: '自动', + manual: '手动', + }, }, setting: { profile: '概要', diff --git a/web/src/pages/agent/form/switch-form/index.tsx b/web/src/pages/agent/form/switch-form/index.tsx index a37b2b8f8..00a156600 100644 --- a/web/src/pages/agent/form/switch-form/index.tsx +++ b/web/src/pages/agent/form/switch-form/index.tsx @@ -59,7 +59,7 @@ export const LogicalOperatorIcon = function OperatorIcon({ return icon; }; -function useBuildSwitchOperatorOptions() { +export function useBuildSwitchOperatorOptions() { const { t } = useTranslation(); const switchOperatorOptions = useMemo(() => { diff --git a/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx b/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx index 776dfa2c7..500f2359e 100644 --- a/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx +++ b/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx @@ -14,19 +14,6 @@ import { MetadataFilterConditions } from './metadata-filter-conditions'; const emptyResponseField = ['prompt_config', 'empty_response']; -const MetadataOptions = Object.values(DatasetMetadata).map((x) => { - let value: DatasetMetadata | boolean = x; - if (x === DatasetMetadata.Disabled) { - value = false; - } else if (x === DatasetMetadata.Automatic) { - value = true; - } - return { - value, - label: x, - }; -}); - const AssistantSetting = ({ show, form, @@ -35,7 +22,14 @@ const AssistantSetting = ({ const { t } = useTranslate('chat'); const { data } = useFetchTenantInfo(true); - const metadata = Form.useWatch(['meta_data_filter', 'auto'], form); + const MetadataOptions = Object.values(DatasetMetadata).map((x) => { + return { + value: x, + label: t(`meta.${x}`), + }; + }); + + const metadata = Form.useWatch(['meta_data_filter', 'method'], form); const kbIds = Form.useWatch(['kb_ids'], form); const hasKnowledge = Array.isArray(kbIds) && kbIds.length > 0; @@ -176,8 +170,9 @@ const AssistantSetting = ({ {hasKnowledge && ( + + remove(name)} /> @@ -73,7 +77,7 @@ export function MetadataFilterConditions({ kbIds }: { kbIds: string[] }) { diff --git a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx index afc2f1d80..a67217ed9 100644 --- a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx +++ b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx @@ -11,108 +11,101 @@ import { FormMessage, } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; +import { Textarea } from '@/components/ui/textarea'; import { useTranslate } from '@/hooks/common-hooks'; import { useFormContext } from 'react-hook-form'; -import { Subhead } from './subhead'; export default function ChatBasicSetting() { const { t } = useTranslate('chat'); const form = useFormContext(); return ( -
- Basic settings -
- ( -
- - {t('assistantAvatar')} - - - - - -
- )} - /> - ( - - {t('assistantName')} +
+ ( +
+ + {t('assistantAvatar')} - + - )} - /> - ( - - {t('description')} - - - - - - )} - /> - ( - - {t('emptyResponse')} - - - - - - )} - /> - ( - - {t('setAnOpener')} - - - - - - )} - /> - - - - -
-
+ + )} + /> + ( + + {t('assistantName')} + + + + + + )} + /> + ( + + {t('description')} + + + + + + )} + /> + ( + + {t('emptyResponse')} + + + + + + )} + /> + ( + + {t('setAnOpener')} + + + + + + )} + /> + + + + + ); } diff --git a/web/src/pages/next-chats/chat/app-settings/chat-model-settings.tsx b/web/src/pages/next-chats/chat/app-settings/chat-model-settings.tsx index 92c79c122..c8d54d03a 100644 --- a/web/src/pages/next-chats/chat/app-settings/chat-model-settings.tsx +++ b/web/src/pages/next-chats/chat/app-settings/chat-model-settings.tsx @@ -9,35 +9,31 @@ import { import { Textarea } from '@/components/ui/textarea'; import { useTranslate } from '@/hooks/common-hooks'; import { useFormContext } from 'react-hook-form'; -import { Subhead } from './subhead'; export function ChatModelSettings() { const { t } = useTranslate('chat'); const form = useFormContext(); return ( -
- Model Setting -
- ( - - {t('system')} - -