Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
Show tool i18n name on chat pannel (#4724)
xxhong164d6e47b9a0
diff --git a/web/app/components/app/chat/thought/index.tsx b/web/app/components/app/chat/thought/index.tsxindex 78551424da3..462cf87fbc2 100644--- a/web/app/components/app/chat/thought/index.tsx+++ b/web/app/components/app/chat/thought/index.tsx@@ -1,10 +1,14 @@'use client'import type { FC } from 'react'import React from 'react'+import { useContext } from 'use-context-selector'import type { ThoughtItem, ToolInfoInThought } from '../type'import Tool from '@/app/components/app/chat/thought/tool'import type { Emoji } from '@/app/components/tools/types'+import I18n from '@/context/i18n'+import { getLanguage } from '@/i18n/language'+export type IThoughtProps = {thought: ThoughtItemallToolIcons: Record<string, string | Emoji>@@ -27,6 +31,9 @@ const Thought: FC<IThoughtProps> = ({allToolIcons,isFinished,}) => {+ const { locale } = useContext(I18n)+ const language = getLanguage(locale)+const [toolNames, isValueArray]: [string[], boolean] = (() => {try {if (Array.isArray(JSON.parse(thought.tool)))@@ -40,6 +47,7 @@ const Thought: FC<IThoughtProps> = ({const toolThoughtList = toolNames.map((toolName, index) => {return {name: toolName,+ label: thought.tool_labels?.[toolName][language] ?? toolName,input: getValue(thought.tool_input, isValueArray, index),output: getValue(thought.observation, isValueArray, index),isFinished,diff --git a/web/app/components/app/chat/thought/tool.tsx b/web/app/components/app/chat/thought/tool.tsxindex 324fcde7bca..91423578288 100644--- a/web/app/components/app/chat/thought/tool.tsx+++ b/web/app/components/app/chat/thought/tool.tsx@@ -49,8 +49,9 @@ const Tool: FC<Props> = ({allToolIcons = {},}) => {const { t } = useTranslation()- const { name, input, isFinished, output } = payload+ const { name, label, input, isFinished, output } = payloadconst toolName = name.startsWith('dataset_') ? t('dataset.knowledge') : name+ const toolLabel = name.startsWith('dataset_') ? t('dataset.knowledge') : labelconst [isShowDetail, setIsShowDetail] = useState(false)const icon = getIcon(name, allToolIcons) as anyreturn (@@ -74,9 +75,9 @@ const Tool: FC<Props> = ({</span><spanclassName='text-xs font-medium text-gray-700 truncate'- title={toolName}+ title={toolLabel}>- {toolName}+ {toolLabel}</span><ChevronDownclassName={cn(isShowDetail && 'rotate-180', 'ml-1 w-3 h-3 text-gray-500 select-none cursor-pointer shrink-0')}diff --git a/web/app/components/app/chat/type.ts b/web/app/components/app/chat/type.tsindex 9c96e36e8c0..0deae18cd97 100644--- a/web/app/components/app/chat/type.ts+++ b/web/app/components/app/chat/type.ts@@ -1,3 +1,4 @@+import type { TypeWithI18N } from '../../header/account-setting/model-provider-page/declarations'import type { Annotation, MessageRating } from '@/models/log'import type { VisionFile } from '@/types/app'@@ -19,6 +20,7 @@ export type DisplayScene = 'web' | 'console'export type ToolInfoInThought = {name: string+ label: stringinput: stringoutput: stringisFinished: boolean@@ -29,6 +31,7 @@ export type ThoughtItem = {tool: string // plugin or dataset. May has multi.thought: stringtool_input: string+ tool_labels?: { [key: string]: TypeWithI18N }message_id: stringobservation: stringposition: number