| }, [twoLine, threeLine, fourLine]) | }, [twoLine, threeLine, fourLine]) | ||||
| const setShowAppConfigureFeaturesModal = useAppStore(s => s.setShowAppConfigureFeaturesModal) | 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 ( | return ( | ||||
| <div className='flex h-full flex-col'> | <div className='flex h-full flex-col'> | ||||
| {isChatMode && ( | {isChatMode && ( | ||||
| <div className='shrink-0 px-6 pb-0'> | <div className='shrink-0 px-6 pb-0'> | ||||
| <ChatInputArea | <ChatInputArea | ||||
| botName='Bot' | |||||
| showFeatureBar | showFeatureBar | ||||
| showFileUpload={false} | showFileUpload={false} | ||||
| onFeatureBarClick={setShowAppConfigureFeaturesModal} | onFeatureBarClick={setShowAppConfigureFeaturesModal} |
| import { TransferMethod } from '@/types/app' | import { TransferMethod } from '@/types/app' | ||||
| type ChatInputAreaProps = { | type ChatInputAreaProps = { | ||||
| botName?: string | |||||
| showFeatureBar?: boolean | showFeatureBar?: boolean | ||||
| showFileUpload?: boolean | showFileUpload?: boolean | ||||
| featureBarDisabled?: boolean | featureBarDisabled?: boolean | ||||
| disabled?: boolean | disabled?: boolean | ||||
| } | } | ||||
| const ChatInputArea = ({ | const ChatInputArea = ({ | ||||
| botName, | |||||
| showFeatureBar, | showFeatureBar, | ||||
| showFileUpload, | showFileUpload, | ||||
| featureBarDisabled, | featureBarDisabled, | ||||
| className={cn( | className={cn( | ||||
| 'body-lg-regular w-full resize-none bg-transparent p-1 leading-6 text-text-tertiary outline-none', | '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 | autoFocus | ||||
| minRows={1} | minRows={1} | ||||
| onResize={handleTextareaResize} | onResize={handleTextareaResize} |
| { | { | ||||
| !noChatInput && ( | !noChatInput && ( | ||||
| <ChatInputArea | <ChatInputArea | ||||
| botName={appData?.site.title || ''} | |||||
| disabled={inputDisabled} | disabled={inputDisabled} | ||||
| showFeatureBar={showFeatureBar} | showFeatureBar={showFeatureBar} | ||||
| showFileUpload={showFileUpload} | showFileUpload={showFileUpload} |
| vectorHash: 'Vektorhash:', | vectorHash: 'Vektorhash:', | ||||
| hitScore: 'Abrufwertung:', | hitScore: 'Abrufwertung:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Sprechen Sie mit dem Bot', | |||||
| inputPlaceholder: 'Sprechen Sie mit dem {{botName}}', | |||||
| thought: 'Gedanke', | thought: 'Gedanke', | ||||
| thinking: 'Denken...', | thinking: 'Denken...', | ||||
| resend: 'Erneut senden', | resend: 'Erneut senden', |
| vectorHash: 'Vector hash:', | vectorHash: 'Vector hash:', | ||||
| hitScore: 'Retrieval Score:', | hitScore: 'Retrieval Score:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Talk to Bot', | |||||
| inputPlaceholder: 'Talk to {{botName}}', | |||||
| thinking: 'Thinking...', | thinking: 'Thinking...', | ||||
| thought: 'Thought', | thought: 'Thought', | ||||
| resend: 'Resend', | resend: 'Resend', |
| vectorHash: 'Hash de vector:', | vectorHash: 'Hash de vector:', | ||||
| hitScore: 'Puntuación de recuperación:', | hitScore: 'Puntuación de recuperación:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Hablar con el bot', | |||||
| inputPlaceholder: 'Hablar con el {{botName}}', | |||||
| thinking: 'Pensamiento...', | thinking: 'Pensamiento...', | ||||
| thought: 'Pensamiento', | thought: 'Pensamiento', | ||||
| resend: 'Reenviar', | resend: 'Reenviar', |
| vectorHash: 'Hachage vectoriel:', | vectorHash: 'Hachage vectoriel:', | ||||
| hitScore: 'Score de Récupération:', | hitScore: 'Score de Récupération:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Parler au bot', | |||||
| inputPlaceholder: 'Parler au {{botName}}', | |||||
| thinking: 'Pensée...', | thinking: 'Pensée...', | ||||
| thought: 'Pensée', | thought: 'Pensée', | ||||
| resend: 'Renvoyer', | resend: 'Renvoyer', |
| vectorHash: 'Hash del vettore:', | vectorHash: 'Hash del vettore:', | ||||
| hitScore: 'Punteggio di recupero:', | hitScore: 'Punteggio di recupero:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Parla con il bot', | |||||
| inputPlaceholder: 'Parla con il {{botName}}', | |||||
| thinking: 'Pensante...', | thinking: 'Pensante...', | ||||
| thought: 'Pensiero', | thought: 'Pensiero', | ||||
| resend: 'Reinvia', | resend: 'Reinvia', |
| vectorHash: 'ベクトルハッシュ:', | vectorHash: 'ベクトルハッシュ:', | ||||
| hitScore: '検索スコア:', | hitScore: '検索スコア:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'ボットと話す', | |||||
| inputPlaceholder: '{{botName}} と話す', | |||||
| thought: '思考', | thought: '思考', | ||||
| thinking: '考え中...', | thinking: '考え中...', | ||||
| resend: '再送信してください', | resend: '再送信してください', |
| vectorHash: 'Wektor hash:', | vectorHash: 'Wektor hash:', | ||||
| hitScore: 'Wynik trafień:', | hitScore: 'Wynik trafień:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Porozmawiaj z botem', | |||||
| inputPlaceholder: 'Porozmawiaj z {{botName}}', | |||||
| thought: 'Myśl', | thought: 'Myśl', | ||||
| thinking: 'Myślenie...', | thinking: 'Myślenie...', | ||||
| resend: 'Prześlij ponownie', | resend: 'Prześlij ponownie', |
| vectorHash: 'Hash de vetor:', | vectorHash: 'Hash de vetor:', | ||||
| hitScore: 'Pontuação de recuperação:', | hitScore: 'Pontuação de recuperação:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Fale com o bot', | |||||
| inputPlaceholder: 'Fale com o {{botName}}', | |||||
| thinking: 'Pensante...', | thinking: 'Pensante...', | ||||
| thought: 'Pensamento', | thought: 'Pensamento', | ||||
| resend: 'Reenviar', | resend: 'Reenviar', |
| vectorHash: 'Hash vector:', | vectorHash: 'Hash vector:', | ||||
| hitScore: 'Scor de recuperare:', | hitScore: 'Scor de recuperare:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Vorbește cu Bot', | |||||
| inputPlaceholder: 'Vorbește cu {{botName}}', | |||||
| thinking: 'Gândire...', | thinking: 'Gândire...', | ||||
| thought: 'Gând', | thought: 'Gând', | ||||
| resend: 'Reexpediați', | resend: 'Reexpediați', |
| vectorHash: 'Vektör Hash:', | vectorHash: 'Vektör Hash:', | ||||
| hitScore: 'Geri Alım Skoru:', | hitScore: 'Geri Alım Skoru:', | ||||
| }, | }, | ||||
| inputPlaceholder: 'Bot ile konuş', | |||||
| inputPlaceholder: '{{botName}} ile konuş', | |||||
| thought: 'Düşünce', | thought: 'Düşünce', | ||||
| thinking: 'Düşünü...', | thinking: 'Düşünü...', | ||||
| resend: 'Yeniden gönder', | resend: 'Yeniden gönder', |
| vectorHash: 'Vector hash:', | vectorHash: 'Vector hash:', | ||||
| hitScore: 'Điểm truy xuất:', | 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', | thought: 'Tư duy', | ||||
| thinking: 'Suy nghĩ...', | thinking: 'Suy nghĩ...', | ||||
| resend: 'Gửi lại', | resend: 'Gửi lại', |
| vectorHash: '向量哈希:', | vectorHash: '向量哈希:', | ||||
| hitScore: '召回得分:', | hitScore: '召回得分:', | ||||
| }, | }, | ||||
| inputPlaceholder: '和机器人聊天', | |||||
| inputPlaceholder: '和 {{botName}} 聊天', | |||||
| thinking: '深度思考中...', | thinking: '深度思考中...', | ||||
| thought: '已深度思考', | thought: '已深度思考', | ||||
| resend: '重新发送', | resend: '重新发送', |
| vectorHash: '向量雜湊:', | vectorHash: '向量雜湊:', | ||||
| hitScore: '召回得分:', | hitScore: '召回得分:', | ||||
| }, | }, | ||||
| inputPlaceholder: '與 Bot 對話', | |||||
| inputPlaceholder: '與 {{botName}} 對話', | |||||
| thinking: '思維。。。', | thinking: '思維。。。', | ||||
| thought: '思想', | thought: '思想', | ||||
| resend: '重新發送', | resend: '重新發送', |
| config?: Record<string, any> | config?: Record<string, any> | ||||
| icon?: string | icon?: string | ||||
| icon_background?: string | icon_background?: string | ||||
| hide?: boolean // used in frontend to hide variable | |||||
| } | } | ||||
| export type CompletionParams = { | export type CompletionParams = { |