generated from nhcarrigan/template
fix: we gotta pass the language to the nova model
This commit is contained in:
@@ -158,7 +158,7 @@ export class AgentComponent {
|
|||||||
|
|
||||||
public async connect() {
|
public async connect() {
|
||||||
this.logs.push("Connecting...");
|
this.logs.push("Connecting...");
|
||||||
this.socket.connect(this.config?.apiKey ?? "");
|
this.socket.connect(this.config?.apiKey ?? "", this.config?.sourceLanguage ?? "en");
|
||||||
while (!this.socket.isConnected()) {
|
while (!this.socket.isConnected()) {
|
||||||
this.logs.push("Waiting for connection...");
|
this.logs.push("Waiting for connection...");
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ export class SocketService {
|
|||||||
/**
|
/**
|
||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
public connect(key: string): void {
|
public connect(key: string, lang: string): void {
|
||||||
if (this.isConnected()) {
|
if (this.isConnected()) {
|
||||||
throw new Error("Socket is already connected");
|
throw new Error("Socket is already connected");
|
||||||
}
|
}
|
||||||
if (!key) {
|
if (!key) {
|
||||||
throw new Error("API key is required");
|
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 = () => {
|
this.socket.onopen = () => {
|
||||||
console.log("open");
|
console.log("open");
|
||||||
if (this.listeners.open) {
|
if (this.listeners.open) {
|
||||||
|
|||||||
Reference in New Issue
Block a user