Skip to content

Commit

Permalink
Improve message handling in AIChat hook for non-standard message types
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Feb 7, 2025
1 parent 7935659 commit b773842
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/xgen/layouts/components/Neo/hooks/useAIChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ export default ({ assistant_id, chat_id, upload_options = {} }: Args) => {
}
})

// if message type is not text, tool, think, then append directly
if (lastItem.type != 'text' && lastItem.type != 'tool' && lastItem.type != 'think') {
res.push({ ...baseMessage, ...lastItem })
return
}

// Create final message based on last item's type
const finalMessage = {
...baseMessage,
Expand Down

0 comments on commit b773842

Please sign in to comment.