@unith-ai/core-client 2.0.64 → 2.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -504,6 +504,7 @@ export declare class Conversation {
504
504
  getUserId(): string;
505
505
  private handleEndSession;
506
506
  private updateStatus;
507
+ generateSpeechRecognitionToken(): Promise<void>;
507
508
  /**
508
509
  * To stop streaming response, we'll send a stop message to the BE. The BE will then stop sending audio and video frames, which will naturally end the response. This is more efficient and leads to a better user experience as it allows for a smoother transition when stopping the response.
509
510
  *
package/dist/lib.js CHANGED
@@ -24122,6 +24122,12 @@ var Conversation = class Conversation {
24122
24122
  this.options.onStatusChange({ status });
24123
24123
  }
24124
24124
  }
24125
+ async generateSpeechRecognitionToken() {
24126
+ if (this.options.microphoneProvider === "custom") {
24127
+ const response = await this.user.getAsrToken("elevenlabs");
24128
+ this.options.onSpeechRecognitionToken(response.token);
24129
+ } else throw new Error("Speech recognition token generation is only applicable for custom microphone provider.");
24130
+ }
24125
24131
  /**
24126
24132
  * To stop streaming response, we'll send a stop message to the BE. The BE will then stop sending audio and video frames, which will naturally end the response. This is more efficient and leads to a better user experience as it allows for a smoother transition when stopping the response.
24127
24133
  *