From a239a2770b787cf9b05681365366cf231543c12b Mon Sep 17 00:00:00 2001 From: baaalint Date: Sun, 8 Sep 2024 21:20:07 +0200 Subject: [PATCH] fix(chat): use actual workflow id --- ui/src/components/shared/Message.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/components/shared/Message.tsx b/ui/src/components/shared/Message.tsx index 7fb0768..8bb45db 100644 --- a/ui/src/components/shared/Message.tsx +++ b/ui/src/components/shared/Message.tsx @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { sessionsAtom } from '@atoms/sessions' import { ArrowUpIcon, AttachmentIcon } from '@chakra-ui/icons' import { Flex, IconButton, Input, useToast } from '@chakra-ui/react' import Client from '@services/Api' @@ -25,7 +26,7 @@ const Message = () => { const [sessionId] = useAtom(sessionIdAtom) const [, setMessages] = useAtom(messagesAtom) const [canSendMessage, setCanSendMessage] = useAtom(canSendMessageAtom) - + const [sessions] = useAtom(sessionsAtom) const toast = useToast() const submitMessage = async () => { @@ -41,7 +42,8 @@ const Message = () => { return [...safeMessages, { role: 'AI', content: '', sources: [] }] }) - const result = await Client.inferWorkflow('default', '1dfd7fc7c4024501850e3541abc3ed9f', { + const workflowId = sessions.find(session => session.uid === sessionId)?.workflow_id + const result = await Client.inferWorkflow('default', workflowId ?? 'default', { question: inputValue, session_id: sessionId, data_source: 'default'