Skip to content

Commit dcee1b6

Browse files
authored
feat: Text to speech support streaming playback (#2661)
1 parent 0ce6dd0 commit dcee1b6

File tree

4 files changed

+336
-129
lines changed

4 files changed

+336
-129
lines changed

ui/src/api/type/application.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type Dict } from '@/api/type/common'
22
import { type Ref } from 'vue'
3+
import bus from '@/bus'
34
interface ApplicationFormType {
45
name?: string
56
desc?: string
@@ -144,8 +145,8 @@ export class ChatRecordManage {
144145
})
145146
}
146147
}
147-
148148
this.chat.answer_text = this.chat.answer_text + chunk_answer
149+
bus.emit('change:answer', { record_id: this.chat.record_id, is_end: false })
149150
}
150151
get_current_up_node(run_node: any) {
151152
const index = this.node_list.findIndex((item) => item == run_node)
@@ -232,6 +233,7 @@ export class ChatRecordManage {
232233
if (this.loading) {
233234
this.loading.value = false
234235
}
236+
bus.emit('change:answer', { record_id: this.chat.record_id, is_end: true })
235237
if (this.id) {
236238
clearInterval(this.id)
237239
}

0 commit comments

Comments
 (0)