fix: we gotta pass the language to the nova model

This commit is contained in:
2025-10-31 18:45:04 -07:00
parent a9cd135c7a
commit 58d167ec86
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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));
+2 -2
View File
@@ -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) {