Skip to content

Commit c0ed24b

Browse files
committed
feat: enable smooth markdown streaming
1 parent 284c408 commit c0ed24b

9 files changed

Lines changed: 96 additions & 71 deletions

File tree

dashboard/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"katex": "^0.16.27",
2929
"lodash": "4.17.23",
3030
"markdown-it": "^14.1.1",
31-
"markstream-vue": "^0.0.6",
31+
"markstream-vue": "1.0.1-beta.1",
3232
"mermaid": "^11.12.2",
3333
"monaco-editor": "^0.52.2",
3434
"pinia": "2.1.6",
3535
"pinyin-pro": "^3.26.0",
3636
"qrcode": "^1.5.4",
3737
"shiki": "^3.20.0",
38-
"stream-markdown": "^0.0.13",
38+
"stream-markdown": "^0.0.15",
3939
"vee-validate": "4.11.3",
4040
"vite-plugin-vuetify": "2.1.3",
4141
"vue": "3.3.4",

dashboard/pnpm-lock.yaml

Lines changed: 76 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/src/components/chat/ChatMessageList.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
:refs="resolvedMessageRefs(msg)"
169169
:is-dark="isDark"
170170
:custom-html-tags="customMarkdownTags"
171+
:is-streaming="isMessageStreaming(msg, msgIndex)"
171172
@open-thread="emit('openThread', $event)"
172173
/>
173174
</div>
@@ -178,6 +179,7 @@
178179
:refs="resolvedMessageRefs(msg)"
179180
:is-dark="isDark"
180181
:custom-html-tags="customMarkdownTags"
182+
:is-streaming="isMessageStreaming(msg, msgIndex)"
181183
/>
182184

183185
<button

dashboard/src/components/chat/MessageList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
:refs="resolvedMessageRefs(msg)"
8181
:is-dark="isDark"
8282
:custom-html-tags="customMarkdownTags"
83+
:is-streaming="isMessageStreaming(msgIndex)"
8384
/>
8485

8586
<button

dashboard/src/components/chat/StandaloneChat.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
:refs="messageRefs(msg)"
6060
:is-dark="isDark"
6161
:custom-html-tags="customMarkdownTags"
62+
:is-streaming="isMessageStreaming(msg, msgIndex)"
6263
/>
6364

6465
<button

dashboard/src/components/chat/ThreadedMarkdownMessagePart.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
:content="threadedContent"
55
:is-dark="isDark"
66
:custom-html-tags="threadedCustomHtmlTags"
7+
:final="!isStreaming"
8+
:smooth-streaming="isStreaming ? 'auto' : false"
9+
:fade="false"
710
:typewriter="false"
811
:max-live-nodes="0"
912
/>
@@ -20,6 +23,7 @@ const props = defineProps<{
2023
refs: { used?: Array<Record<string, unknown>> } | null;
2124
isDark: boolean;
2225
customHtmlTags: string[];
26+
isStreaming?: boolean;
2327
}>();
2428
2529
const emit = defineEmits<{

dashboard/src/components/chat/message_list_comps/MarkdownMessagePart.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
:content="content"
66
:custom-html-tags="customHtmlTags"
77
:is-dark="isDark"
8+
:final="!isStreaming"
9+
:smooth-streaming="isStreaming ? 'auto' : false"
10+
:fade="false"
811
:typewriter="false"
912
:max-live-nodes="0"
1013
/>
@@ -20,6 +23,7 @@ const props = defineProps<{
2023
refs: { used?: Array<Record<string, unknown>> } | null;
2124
isDark: boolean;
2225
customHtmlTags: string[];
26+
isStreaming?: boolean;
2327
}>();
2428
2529
const isDarkRef = computed(() => props.isDark);

0 commit comments

Comments
 (0)