mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 16:04:21 +00:00
feat: add back streaming switch for web chat
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user