feat: add back streaming switch for web chat

This commit is contained in:
Junyan Qin
2025-12-11 18:54:16 +08:00
parent 173f9e9c30
commit b5b5d499e5
7 changed files with 34 additions and 5 deletions
@@ -204,6 +204,7 @@ export class WebSocketClient {
*/
public sendMessage(
messageChain: Array<{ type: string; text?: string; target?: string }>,
stream: boolean = true,
) {
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
throw new Error('WebSocket未连接');
@@ -212,6 +213,7 @@ export class WebSocketClient {
const message = {
type: 'message',
message: messageChain,
stream: stream,
};
this.ws.send(JSON.stringify(message));