Skip to content

Commit

Permalink
bug(ui): 771-assistant no response (#776)
Browse files Browse the repository at this point in the history
* bug fix for edge case with assistants and getting no response
* bug fix for crash when dom purify is called server side
  • Loading branch information
andrewrisse authored Jul 12, 2024
1 parent a7030ad commit 57ddfb6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 49 deletions.
71 changes: 25 additions & 46 deletions src/leapfrogai_ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/leapfrogai_ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"dompurify": "^3.1.6",
"fuse.js": "^7.0.0",
"highlight.js": "^11.10.0",
"isomorphic-dompurify": "^2.13.0",
"lit": "^3.1.4",
"markdown-it": "^14.1.0",
"msw": "^2.2.14",
Expand Down
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/src/lib/components/Message.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
} from '$helpers/chatHelpers';
import DynamicPictogram from '$components/DynamicPictogram.svelte';
import type { AppendFunction, ReloadFunction, VercelOrOpenAIMessage } from '$lib/types/messages';
import DOMPurify from 'dompurify';
import DOMPurify from 'isomorphic-dompurify';
export let allStreamedMessages: VercelOrOpenAIMessage[];
export let message: VercelOrOpenAIMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/src/lib/web-components/CodeBlock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LitElement, css, html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import DOMPurify from 'dompurify';
import DOMPurify from 'isomorphic-dompurify';
import { highlightJsStyles, buttonStyles } from './styles.js';
import { toastStore } from '$stores';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
});
const sendAssistantMessage = async (e: SubmitEvent | KeyboardEvent) => {
hasSentAssistantMessage = true;
await threadsStore.setSendingBlocked(true);
if (data.thread?.id) {
// assistant mode
Expand All @@ -193,6 +192,7 @@
$assistantInput = '';
}
await threadsStore.setSendingBlocked(false);
hasSentAssistantMessage = true;
};
const sendChatMessage = async (e: SubmitEvent | KeyboardEvent) => {
Expand Down

0 comments on commit 57ddfb6

Please sign in to comment.