From 58d167ec865ee38fffcd4d7b45358c767a6e96dd Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Fri, 31 Oct 2025 18:45:04 -0700 Subject: [PATCH] fix: we gotta pass the language to the nova model --- src/app/agent/agent.component.ts | 2 +- src/app/socket.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/agent/agent.component.ts b/src/app/agent/agent.component.ts index 5faac7e..05036c4 100644 --- a/src/app/agent/agent.component.ts +++ b/src/app/agent/agent.component.ts @@ -158,7 +158,7 @@ export class AgentComponent { public async connect() { this.logs.push("Connecting..."); - this.socket.connect(this.config?.apiKey ?? ""); + this.socket.connect(this.config?.apiKey ?? "", this.config?.sourceLanguage ?? "en"); while (!this.socket.isConnected()) { this.logs.push("Waiting for connection..."); await new Promise((resolve) => setTimeout(resolve, 1000)); diff --git a/src/app/socket.service.ts b/src/app/socket.service.ts index 1014c98..3277961 100644 --- a/src/app/socket.service.ts +++ b/src/app/socket.service.ts @@ -44,14 +44,14 @@ export class SocketService { /** * @param key */ - public connect(key: string): void { + public connect(key: string, lang: string): void { if (this.isConnected()) { throw new Error("Socket is already connected"); } if (!key) { throw new Error("API key is required"); } - this.socket = new WebSocket("wss://api.deepgram.com/v1/listen?model=nova-3-general&encoding=linear16&sample_rate=48000&channels=1&endpointing=500&punctuate=true", [ "token", key ]); + this.socket = new WebSocket(`wss://api.deepgram.com/v1/listen?model=nova-3-general&encoding=linear16&sample_rate=48000&channels=1&endpointing=500&punctuate=true&language=${lang}`, [ "token", key ]); this.socket.onopen = () => { console.log("open"); if (this.listeners.open) {