feat(conversation): TTS 投递与 WebSocket 管线;客户端播放门禁与会话页联动;COS 键与迁移脚本调整
This commit is contained in:
@@ -49,6 +49,7 @@ function mapServerMessage(raw: RawServerMessage): WsEvent | null {
|
||||
audioUrl: d.audio_url as string | undefined,
|
||||
index: d.index as number | undefined,
|
||||
total: d.total as number | undefined,
|
||||
assistantMessageId: d.assistant_message_id as string | undefined,
|
||||
};
|
||||
|
||||
case 'end_conversation':
|
||||
@@ -166,6 +167,10 @@ export class WsClient {
|
||||
return this.send({ type: 'text', data: { text } });
|
||||
}
|
||||
|
||||
sendTtsCancel(): boolean {
|
||||
return this.send({ type: 'tts_cancel', data: {} });
|
||||
}
|
||||
|
||||
sendEndConversation(): boolean {
|
||||
return this.send({ type: 'end_conversation', data: {} });
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export type ClientMessageType =
|
||||
| 'audio_segment'
|
||||
| 'audio_message'
|
||||
| 'transcribe_only'
|
||||
| 'tts_cancel'
|
||||
| 'end_conversation';
|
||||
|
||||
export interface RawServerMessage {
|
||||
@@ -63,6 +64,8 @@ export interface TtsAudioReceivedEvent {
|
||||
audioUrl?: string;
|
||||
index?: number;
|
||||
total?: number;
|
||||
/** 持久化后的助手消息 id(与 REST `messages` 中 `id` 对齐) */
|
||||
assistantMessageId?: string;
|
||||
}
|
||||
|
||||
export interface ConversationEndedEvent {
|
||||
|
||||
Reference in New Issue
Block a user