diff --git a/src/ChatBlock/ChatMessageBubble.jsx b/src/ChatBlock/ChatMessageBubble.jsx index 11a7c72..bfc6bac 100644 --- a/src/ChatBlock/ChatMessageBubble.jsx +++ b/src/ChatBlock/ChatMessageBubble.jsx @@ -1,12 +1,15 @@ -import React from 'react'; import loadable from '@loadable/component'; +import React from 'react'; + import { Citation } from './Citation'; import { SourceDetails } from './Source'; -import { transformEmailsToLinks, SVGIcon } from './utils'; +import { SVGIcon, transformEmailsToLinks } from './utils'; import BotIcon from './../icons/bot.svg'; import UserIcon from './../icons/user.svg'; +const CITATION_MATCH = /\[\d+\](?![[(\])])/gm; + const Markdown = loadable(() => import('react-markdown')); const components = (message) => { @@ -45,8 +48,6 @@ const components = (message) => { }; }; -const CITATION_MATCH = /\[\d+\](?![[(\])])/gm; - function addCitations(text) { return text.replaceAll(CITATION_MATCH, (match) => { const number = match.match(/\d+/)[0]; @@ -54,8 +55,26 @@ function addCitations(text) { }); } +function ToolCall({ tool_args, tool_name, tool_result }) { + if (tool_name === 'run_search') { + return ( +