fix: variable in opener (#2437)

This commit is contained in:
zxhlyh 2024-02-12 22:22:57 +08:00 • committed by GitHub
commit 0850c953b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 15 deletions

View file

@ -36,8 +36,9 @@ const ChatWrapper = () => {
return {
...config,
supportFeedback: true,
opening_statement: currentConversationId ? currentConversationItem?.introduction : (config as any).opening_statement,
} as ChatConfig
}, [appParams])
}, [appParams, currentConversationItem?.introduction, currentConversationId])
const {
chatList,
handleSend,
@ -46,7 +47,10 @@ const ChatWrapper = () => {
suggestedQuestions,
} = useChat(
appConfig,
undefined,
{
inputs: (currentConversationId ? currentConversationItem?.inputs : newConversationInputs) as any,
promptVariables: inputsForms,
},
appPrevChatList,
taskId => stopChatMessageResponding('', taskId, isInstalledApp, appId),
)