Skip to content

Commit

Permalink
Merge pull request #16 from baaalint/chatbot-fix
Browse files Browse the repository at this point in the history
fix(chat): use actual workflow id
  • Loading branch information
baaalint authored Sep 8, 2024
2 parents f3b3fe6 + a239a27 commit 59b4e3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/src/components/shared/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 () => {
Expand All @@ -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'
Expand Down

0 comments on commit 59b4e3c

Please sign in to comment.