@unith-ai/core-client 2.0.63 → 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.
@@ -11425,6 +11425,7 @@ function asEncryptablePacket(packet) {
11425
11425
  var _a, _b, _c, _d, _e;
11426
11426
  if (((_a = packet.value) === null || _a === void 0 ? void 0 : _a.case) !== "sipDtmf" && ((_b = packet.value) === null || _b === void 0 ? void 0 : _b.case) !== "metrics" && ((_c = packet.value) === null || _c === void 0 ? void 0 : _c.case) !== "speaker" && ((_d = packet.value) === null || _d === void 0 ? void 0 : _d.case) !== "transcription" && ((_e = packet.value) === null || _e === void 0 ? void 0 : _e.case) !== "encryptedPacket") return new EncryptedPacketPayload({ value: packet.value });
11427
11427
  }
11428
+ eventsExports.EventEmitter;
11428
11429
  var CryptorErrorReason;
11429
11430
  (function(CryptorErrorReason) {
11430
11431
  CryptorErrorReason[CryptorErrorReason["InvalidKey"] = 0] = "InvalidKey";
@@ -22272,6 +22273,8 @@ var CheckStatus;
22272
22273
  CheckStatus[CheckStatus["SUCCESS"] = 3] = "SUCCESS";
22273
22274
  CheckStatus[CheckStatus["FAILED"] = 4] = "FAILED";
22274
22275
  })(CheckStatus || (CheckStatus = {}));
22276
+ eventsExports.EventEmitter;
22277
+ eventsExports.EventEmitter;
22275
22278
  function _defineProperty(e, r, t) {
22276
22279
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
22277
22280
  value: t,
@@ -22439,7 +22442,8 @@ var JWSSignatureVerificationFailed = class extends JOSEError {
22439
22442
  }
22440
22443
  };
22441
22444
  _defineProperty(JWSSignatureVerificationFailed, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
22442
- new Uint8Array(0);
22445
+ //#endregion
22446
+ //#region ../../node_modules/.pnpm/@elevenlabs+client@0.13.1_@types+dom-mediacapture-record@1.0.22/node_modules/@elevenlabs/client/dist/lib.modern.js
22443
22447
  const _ = /* @__PURE__ */ new Map();
22444
22448
  function w(e, t) {
22445
22449
  return async (n, o) => {
@@ -24117,6 +24121,12 @@ var Conversation = class Conversation {
24117
24121
  this.options.onStatusChange({ status });
24118
24122
  }
24119
24123
  }
24124
+ async generateSpeechRecognitionToken() {
24125
+ if (this.options.microphoneProvider === "custom") {
24126
+ const response = await this.user.getAsrToken("elevenlabs");
24127
+ this.options.onSpeechRecognitionToken(response.token);
24128
+ } else throw new Error("Speech recognition token generation is only applicable for custom microphone provider.");
24129
+ }
24120
24130
  /**
24121
24131
  * 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.
24122
24132
  *
@@ -24176,18 +24186,11 @@ var Conversation = class Conversation {
24176
24186
  }
24177
24187
  if (this.options.microphoneProvider !== "custom") this.microphone = await Microphone.initializeMicrophone(this.options.microphoneOptions, this.options.microphoneProvider, this.options.elevenLabsOptions ?? defaultElevenLabsOptions, this.user, this.headInfo, this.microphoneAccess, this.options.voiceInterruptions ?? false);
24178
24188
  else {
24179
- const token = await this.getSpeechRecognitionToken("eleven_labs");
24180
- this.options.onSpeechRecognitionToken(token);
24189
+ const response = await this.user.getAsrToken("elevenlabs");
24190
+ this.options.onSpeechRecognitionToken(response.token);
24181
24191
  }
24182
24192
  return this.connection;
24183
24193
  }
24184
- /**
24185
- * Returns token for speech recognition.
24186
- * @param provider
24187
- */
24188
- async getSpeechRecognitionToken(provider) {
24189
- return (await this.user.getAsrToken(provider === "eleven_labs" ? "elevenlabs" : "azure")).token;
24190
- }
24191
24194
  async toggleMicrophone() {
24192
24195
  if (this.options.microphoneProvider === "custom") throw new Error("Cannot toggle microphone for custom provider.");
24193
24196
  if (!this.microphone) this.microphone = await Microphone.initializeMicrophone(this.options.microphoneOptions, this.options.microphoneProvider, this.options.elevenLabsOptions ?? defaultElevenLabsOptions, this.user, this.headInfo, this.microphoneAccess, this.options.voiceInterruptions ?? false);