mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
fix
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
import {
|
||||
memo,
|
||||
useCallback,
|
||||
useMemo,
|
||||
} from 'react'
|
||||
import { useStore } from '../../store'
|
||||
import UserInput from './user-input'
|
||||
import { useChat } from './hooks'
|
||||
import Chat from '@/app/components/base/chat/chat'
|
||||
import type { OnSend } from '@/app/components/base/chat/types'
|
||||
import { useFeaturesStore } from '@/app/components/base/features/hooks'
|
||||
|
||||
const ChatWrapper = () => {
|
||||
const {
|
||||
@ -17,6 +19,20 @@ const ChatWrapper = () => {
|
||||
suggestedQuestions,
|
||||
handleSend,
|
||||
} = useChat()
|
||||
const featuresStore = useFeaturesStore()
|
||||
const features = featuresStore!.getState().features
|
||||
|
||||
const config = useMemo(() => {
|
||||
return {
|
||||
opening_statement: features.opening.opening_statement,
|
||||
suggested_questions: features.opening.suggested_questions,
|
||||
suggested_questions_after_answer: features.suggested,
|
||||
text_to_speech: features.text2speech,
|
||||
speech_to_text: features.speech2text,
|
||||
retriever_resource: features.citation,
|
||||
sensitive_word_avoidance: features.moderation,
|
||||
}
|
||||
}, [features])
|
||||
|
||||
const doSend = useCallback<OnSend>((query, files) => {
|
||||
handleSend({
|
||||
@ -29,6 +45,7 @@ const ChatWrapper = () => {
|
||||
|
||||
return (
|
||||
<Chat
|
||||
config={config as any}
|
||||
chatList={chatList}
|
||||
isResponding={isResponding}
|
||||
chatContainerclassName='px-4'
|
||||
|
||||
Reference in New Issue
Block a user