Skip to content

armgit / dify

Public Imported from GitHub
0

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.

Feat/15534 support replacing the bot in chat input placeholder with the bots name (#20473)

crazywoola8e2d342de6f0
diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx
index 75ba8362aec..b876adfa3d2 100644
--- a/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx
+++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx
@@ -99,7 +99,15 @@ const DebugWithMultipleModel = () => {
}, [twoLine, threeLine, fourLine])
const setShowAppConfigureFeaturesModal = useAppStore(s => s.setShowAppConfigureFeaturesModal)
- const inputsForm = modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[]
+ const inputsForm = modelConfig.configs.prompt_variables
+ .filter(item => item.type !== 'api')
+ .map(item => ({
+ ...item,
+ label: item.name,
+ variable: item.key,
+ hide: item.hide ?? false,
+ required: item.required ?? false,
+ })) as InputForm[]
return (
<div className='flex h-full flex-col'>
@@ -133,6 +141,7 @@ const DebugWithMultipleModel = () => {
{isChatMode && (
<div className='shrink-0 px-6 pb-0'>
<ChatInputArea
+ botName='Bot'
showFeatureBar
showFileUpload={false}
onFeatureBarClick={setShowAppConfigureFeaturesModal}
diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx
index 14d8185f99d..52490e4024f 100644
--- a/web/app/components/base/chat/chat/chat-input-area/index.tsx
+++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx
@@ -29,6 +29,7 @@ import type { FileUpload } from '@/app/components/base/features/types'
import { TransferMethod } from '@/types/app'
type ChatInputAreaProps = {
+ botName?: string
showFeatureBar?: boolean
showFileUpload?: boolean
featureBarDisabled?: boolean
@@ -43,6 +44,7 @@ type ChatInputAreaProps = {
disabled?: boolean
}
const ChatInputArea = ({
+ botName,
showFeatureBar,
showFileUpload,
featureBarDisabled,
@@ -192,7 +194,7 @@ const ChatInputArea = ({
className={cn(
'body-lg-regular w-full resize-none bg-transparent p-1 leading-6 text-text-tertiary outline-none',
)}
- placeholder={t('common.chat.inputPlaceholder') || ''}
+ placeholder={t('common.chat.inputPlaceholder', { botName }) || ''}
autoFocus
minRows={1}
onResize={handleTextareaResize}
diff --git a/web/app/components/base/chat/chat/index.tsx b/web/app/components/base/chat/chat/index.tsx
index 7c8eb23b1b8..c0842af0c49 100644
--- a/web/app/components/base/chat/chat/index.tsx
+++ b/web/app/components/base/chat/chat/index.tsx
@@ -303,6 +303,7 @@ const Chat: FC<ChatProps> = ({
{
!noChatInput && (
<ChatInputArea
+ botName={appData?.site.title || ''}
disabled={inputDisabled}
showFeatureBar={showFeatureBar}
showFileUpload={showFileUpload}
diff --git a/web/i18n/de-DE/common.ts b/web/i18n/de-DE/common.ts
index 54bde0b67ee..04fb06254a8 100644
--- a/web/i18n/de-DE/common.ts
+++ b/web/i18n/de-DE/common.ts
@@ -550,7 +550,7 @@ const translation = {
vectorHash: 'Vektorhash:',
hitScore: 'Abrufwertung:',
},
- inputPlaceholder: 'Sprechen Sie mit dem Bot',
+ inputPlaceholder: 'Sprechen Sie mit dem {{botName}}',
thought: 'Gedanke',
thinking: 'Denken...',
resend: 'Erneut senden',
diff --git a/web/i18n/en-US/common.ts b/web/i18n/en-US/common.ts
index 418393dde53..05000f9343d 100644
--- a/web/i18n/en-US/common.ts
+++ b/web/i18n/en-US/common.ts
@@ -569,7 +569,7 @@ const translation = {
vectorHash: 'Vector hash:',
hitScore: 'Retrieval Score:',
},
- inputPlaceholder: 'Talk to Bot',
+ inputPlaceholder: 'Talk to {{botName}}',
thinking: 'Thinking...',
thought: 'Thought',
resend: 'Resend',
diff --git a/web/i18n/es-ES/common.ts b/web/i18n/es-ES/common.ts
index 2c9e69320a7..ac8955a7744 100644
--- a/web/i18n/es-ES/common.ts
+++ b/web/i18n/es-ES/common.ts
@@ -554,7 +554,7 @@ const translation = {
vectorHash: 'Hash de vector:',
hitScore: 'Puntuación de recuperación:',
},
- inputPlaceholder: 'Hablar con el bot',
+ inputPlaceholder: 'Hablar con el {{botName}}',
thinking: 'Pensamiento...',
thought: 'Pensamiento',
resend: 'Reenviar',
diff --git a/web/i18n/fr-FR/common.ts b/web/i18n/fr-FR/common.ts
index d26deb3a9fa..9ba5e8103cf 100644
--- a/web/i18n/fr-FR/common.ts
+++ b/web/i18n/fr-FR/common.ts
@@ -550,7 +550,7 @@ const translation = {
vectorHash: 'Hachage vectoriel:',
hitScore: 'Score de Récupération:',
},
- inputPlaceholder: 'Parler au bot',
+ inputPlaceholder: 'Parler au {{botName}}',
thinking: 'Pensée...',
thought: 'Pensée',
resend: 'Renvoyer',
diff --git a/web/i18n/it-IT/common.ts b/web/i18n/it-IT/common.ts
index f337990aaba..2530ee16a4c 100644
--- a/web/i18n/it-IT/common.ts
+++ b/web/i18n/it-IT/common.ts
@@ -581,7 +581,7 @@ const translation = {
vectorHash: 'Hash del vettore:',
hitScore: 'Punteggio di recupero:',
},
- inputPlaceholder: 'Parla con il bot',
+ inputPlaceholder: 'Parla con il {{botName}}',
thinking: 'Pensante...',
thought: 'Pensiero',
resend: 'Reinvia',
diff --git a/web/i18n/ja-JP/common.ts b/web/i18n/ja-JP/common.ts
index f9184332dea..cd96ff89b39 100644
--- a/web/i18n/ja-JP/common.ts
+++ b/web/i18n/ja-JP/common.ts
@@ -570,7 +570,7 @@ const translation = {
vectorHash: 'ベクトルハッシュ:',
hitScore: '検索スコア:',
},
- inputPlaceholder: 'ボットと話す',
+ inputPlaceholder: '{{botName}} と話す',
thought: '思考',
thinking: '考え中...',
resend: '再送信してください',
diff --git a/web/i18n/pl-PL/common.ts b/web/i18n/pl-PL/common.ts
index fb94c8caaf1..19aa6448bf6 100644
--- a/web/i18n/pl-PL/common.ts
+++ b/web/i18n/pl-PL/common.ts
@@ -565,7 +565,7 @@ const translation = {
vectorHash: 'Wektor hash:',
hitScore: 'Wynik trafień:',
},
- inputPlaceholder: 'Porozmawiaj z botem',
+ inputPlaceholder: 'Porozmawiaj z {{botName}}',
thought: 'Myśl',
thinking: 'Myślenie...',
resend: 'Prześlij ponownie',
diff --git a/web/i18n/pt-BR/common.ts b/web/i18n/pt-BR/common.ts
index 7b7eeafbe79..3e059b1a1d9 100644
--- a/web/i18n/pt-BR/common.ts
+++ b/web/i18n/pt-BR/common.ts
@@ -550,7 +550,7 @@ const translation = {
vectorHash: 'Hash de vetor:',
hitScore: 'Pontuação de recuperação:',
},
- inputPlaceholder: 'Fale com o bot',
+ inputPlaceholder: 'Fale com o {{botName}}',
thinking: 'Pensante...',
thought: 'Pensamento',
resend: 'Reenviar',
diff --git a/web/i18n/ro-RO/common.ts b/web/i18n/ro-RO/common.ts
index 13243404bd6..1d3c1023ab2 100644
--- a/web/i18n/ro-RO/common.ts
+++ b/web/i18n/ro-RO/common.ts
@@ -550,7 +550,7 @@ const translation = {
vectorHash: 'Hash vector:',
hitScore: 'Scor de recuperare:',
},
- inputPlaceholder: 'Vorbește cu Bot',
+ inputPlaceholder: 'Vorbește cu {{botName}}',
thinking: 'Gândire...',
thought: 'Gând',
resend: 'Reexpediați',
diff --git a/web/i18n/tr-TR/common.ts b/web/i18n/tr-TR/common.ts
index 584c0a8096f..42c0dca72ba 100644
--- a/web/i18n/tr-TR/common.ts
+++ b/web/i18n/tr-TR/common.ts
@@ -554,7 +554,7 @@ const translation = {
vectorHash: 'Vektör Hash:',
hitScore: 'Geri Alım Skoru:',
},
- inputPlaceholder: 'Bot ile konuş',
+ inputPlaceholder: '{{botName}} ile konuş',
thought: 'Düşünce',
thinking: 'Düşünü...',
resend: 'Yeniden gönder',
diff --git a/web/i18n/vi-VN/common.ts b/web/i18n/vi-VN/common.ts
index 6023fe72857..2bb7eb35d88 100644
--- a/web/i18n/vi-VN/common.ts
+++ b/web/i18n/vi-VN/common.ts
@@ -550,7 +550,7 @@ const translation = {
vectorHash: 'Vector hash:',
hitScore: 'Điểm truy xuất:',
},
- inputPlaceholder: 'Nói chuyện với Bot',
+ inputPlaceholder: 'Nói chuyện với {{botName}}',
thought: 'Tư duy',
thinking: 'Suy nghĩ...',
resend: 'Gửi lại',
diff --git a/web/i18n/zh-Hans/common.ts b/web/i18n/zh-Hans/common.ts
index f3a7e09ab7d..b8e1342fc49 100644
--- a/web/i18n/zh-Hans/common.ts
+++ b/web/i18n/zh-Hans/common.ts
@@ -569,7 +569,7 @@ const translation = {
vectorHash: '向量哈希:',
hitScore: '召回得分:',
},
- inputPlaceholder: '和机器人聊天',
+ inputPlaceholder: '和 {{botName}} 聊天',
thinking: '深度思考中...',
thought: '已深度思考',
resend: '重新发送',
diff --git a/web/i18n/zh-Hant/common.ts b/web/i18n/zh-Hant/common.ts
index 266880b9401..eb2939ecc01 100644
--- a/web/i18n/zh-Hant/common.ts
+++ b/web/i18n/zh-Hant/common.ts
@@ -552,7 +552,7 @@ const translation = {
vectorHash: '向量雜湊:',
hitScore: '召回得分:',
},
- inputPlaceholder: '與 Bot 對話',
+ inputPlaceholder: '與 {{botName}} 對話',
thinking: '思維。。。',
thought: '思想',
resend: '重新發送',
diff --git a/web/models/debug.ts b/web/models/debug.ts
index 18c2c02b625..e582e8c18a2 100644
--- a/web/models/debug.ts
+++ b/web/models/debug.ts
@@ -59,6 +59,7 @@ export type PromptVariable = {
config?: Record<string, any>
icon?: string
icon_background?: string
+ hide?: boolean // used in frontend to hide variable
}
export type CompletionParams = {