Update frontend/js/main.js
Browse files41 unmodified lines42434445464748495051525354555657585960616263646566676841 unmodified linestry {const config = this.uiController.getConfig();// 1. Establish core connectionawait this.webSocketClient.connect(config, {onMessage: this.handleWebSocketMessage.bind(this),onClose: this.handleWebSocketClose.bind(this),onError: this.handleWebSocketError.bind(this)});// 2. IMMEDIATE HANDSHAKE: Send the configuration frame right away to prevent// the server's backend proxy from timing out while waiting for hardware permissions.const initConfig = {type: "config",config: {systemPrompt: config.systemPrompt || "You are a friendly AI Assistant.",voice: config.voice || "Puck",googleSearch: config.googleSearch || false,allowInterruptions: config.allowInterruptions !== false}};this.webSocketClient.ws.send(JSON.stringify(initConfig));// 3. Spool up hardware media paths safely now that the network connection is warmawait this.audioManager.startCapture((audioData) => {this.webSocketClient.sendAudio(audioData);});41 unmodified lines424344454647484950515253545541 unmodified linestry {const config = this.uiController.getConfig();// 1. Establish core connection & automatically transmit initial configurationawait this.webSocketClient.connect(config, {onMessage: this.handleWebSocketMessage.bind(this),onClose: this.handleWebSocketClose.bind(this),onError: this.handleWebSocketError.bind(this)});// 2. Spool up hardware media paths safely now that the network connection is warmawait this.audioManager.startCapture((audioData) => {this.webSocketClient.sendAudio(audioData);});
frontend/js/main.js+2-15