From 3e531aa898492cb05e25081f422bb59adab72e8e Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 11 Feb 2025 16:03:29 -0500 Subject: enabled multi-select modification of text documents from topBar buttons. fixed diagram box layout and scrolling. fixed problem with createDoc tool where it would fail when it got an array. fixed formatting of chat box errors. --- src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx | 12 +++++++----- .../nodes/chatbot/chatboxcomponents/MessageComponent.tsx | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/client/views/nodes/chatbot/chatboxcomponents') diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx index a9cf849cc..f8fe531ab 100644 --- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx +++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx @@ -336,11 +336,13 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { } catch (err) { console.error('Error:', err); // Handle error in processing - this._history.push({ - role: ASSISTANT_ROLE.ASSISTANT, - content: [{ index: 0, type: TEXT_TYPE.ERROR, text: 'Sorry, I encountered an error while processing your request.', citation_ids: null }], - processing_info: [], - }); + runInAction(() => + this._history.push({ + role: ASSISTANT_ROLE.ASSISTANT, + content: [{ index: 0, type: TEXT_TYPE.ERROR, text: `Sorry, I encountered an error while processing your request: ${err} `, citation_ids: null }], + processing_info: [], + }) + ); } finally { runInAction(() => { this._isLoading = false; diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/MessageComponent.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/MessageComponent.tsx index 1a3d4dbc6..4f1d68973 100644 --- a/src/client/views/nodes/chatbot/chatboxcomponents/MessageComponent.tsx +++ b/src/client/views/nodes/chatbot/chatboxcomponents/MessageComponent.tsx @@ -86,6 +86,7 @@ const MessageComponentBox: React.FC = ({ message, onFollo } // Handle query type content + // bcz: What triggers this section? Where is 'query' added to item? Why isn't it a field? else if ('query' in item) { return ( @@ -98,7 +99,7 @@ const MessageComponentBox: React.FC = ({ message, onFollo else { return ( - {JSON.stringify(item)} + {item.text /* JSON.stringify(item)*/} ); } -- cgit v1.2.3-70-g09d2