mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
Feat/15534 support replacing the bot in chat input placeholder with the bots name (#20473)
This commit is contained in:
@ -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}
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -303,6 +303,7 @@ const Chat: FC<ChatProps> = ({
|
||||
{
|
||||
!noChatInput && (
|
||||
<ChatInputArea
|
||||
botName={appData?.site.title || ''}
|
||||
disabled={inputDisabled}
|
||||
showFeatureBar={showFeatureBar}
|
||||
showFileUpload={showFileUpload}
|
||||
|
||||
Reference in New Issue
Block a user