Skip to content

Commit 4a14db9

Browse files
committed
feat: Text to speech support streaming playback
1 parent f19ad24 commit 4a14db9

File tree

3 files changed

+300
-125
lines changed

3 files changed

+300
-125
lines changed

ui/src/api/type/application.ts

+3-1
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)