deep-chat-dev 1.1.18 → 1.1.20

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/deepChat.js CHANGED
@@ -433,11 +433,11 @@ const _Demo = class {
433
433
  return typeof n == "function" ? n(e) : n;
434
434
  }
435
435
  static getResponse(n) {
436
- return n.customDemoResponse ? _Demo.getCustomResponse(n.customDemoResponse, n.messages[n.messages.length - 1]) : { text: _Demo.generateResponse(n) };
436
+ return n.customDemoResponse ? _Demo.getCustomResponse(n.customDemoResponse, n.messages[n.messages.length - 1]) : { result: { text: _Demo.generateResponse(n) } };
437
437
  }
438
438
  // timeout is used to simulate a timeout for a response to come back
439
439
  static request(n, e, t) {
440
- const r = { result: _Demo.getResponse(n) };
440
+ const r = _Demo.getResponse(n);
441
441
  setTimeout(async () => {
442
442
  const s = await (t == null ? void 0 : t(r)) || r;
443
443
  s.error ? n.addNewErrorMessage("service", s.error) : n.addNewMessage(s.result, !0, !0), e();
@@ -446,8 +446,8 @@ const _Demo = class {
446
446
  // timeout is used to simulate a timeout for a response to come back
447
447
  static requestStream(n, e) {
448
448
  setTimeout(() => {
449
- var r;
450
- const t = (r = _Demo.getResponse(n)) == null ? void 0 : r.text;
449
+ var r, s;
450
+ const t = (s = (r = _Demo.getResponse(n)) == null ? void 0 : r.result) == null ? void 0 : s.text;
451
451
  Stream.simulate(n, e, t);
452
452
  }, 400);
453
453
  }
@@ -2805,7 +2805,7 @@ class DirectServiceIO extends BaseServiceIO {
2805
2805
  this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
2806
2806
  }
2807
2807
  buildRequestSettings(e, t) {
2808
- const r = t ?? {};
2808
+ const r = t !== void 0 ? t : {};
2809
2809
  return r.headers = this.buildHeadersFunc(e), r;
2810
2810
  }
2811
2811
  keyAuthenticated(e, t) {
@@ -4448,7 +4448,7 @@ class Messages {
4448
4448
  });
4449
4449
  }
4450
4450
  static getDisplayLoadingMessage(e, t) {
4451
- return t.websocket ? !1 : e.displayLoadingBubble ?? !0;
4451
+ return t.websocket ? !1 : e.displayLoadingBubble !== void 0 ? e.displayLoadingBubble : !0;
4452
4452
  }
4453
4453
  prepareDemo(e) {
4454
4454
  typeof e == "object" && (e.response && (this.customDemoResponse = e.response), e.displayErrors && (e.displayErrors.default && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")), e.displayLoadingBubble && this.addLoadingMessage());
@@ -6192,10 +6192,10 @@ class SpeechToText extends MicrophoneButton {
6192
6192
  static processConfiguration(e, t) {
6193
6193
  var u;
6194
6194
  const r = typeof t == "object" ? t : {}, s = typeof r.webSpeech == "object" ? r.webSpeech : {}, o = r.azure || {}, a = {
6195
- displayInterimResults: r.displayInterimResults ?? void 0,
6196
- textColor: r.textColor ?? void 0,
6197
- translations: r.translations ?? void 0,
6198
- commands: r.commands ?? void 0,
6195
+ displayInterimResults: r.displayInterimResults !== void 0 ? r.displayInterimResults : void 0,
6196
+ textColor: r.textColor !== void 0 ? r.textColor : void 0,
6197
+ translations: r.translations !== void 0 ? r.translations : void 0,
6198
+ commands: r.commands !== void 0 ? r.commands : void 0,
6199
6199
  ...s,
6200
6200
  ...o
6201
6201
  }, l = (u = r.commands) == null ? void 0 : u.submit;
@@ -1,9 +1,9 @@
1
1
  import { ErrorMessageOverrides, MessageContent } from './messages';
2
- import { Result } from './result';
2
+ import { CustomServiceResponse } from './customService';
3
3
  export type DemoErrors = {
4
4
  [key in keyof ErrorMessageOverrides]?: boolean;
5
5
  };
6
- export type DemoResponse = Result | ((message: MessageContent) => Result);
6
+ export type DemoResponse = CustomServiceResponse | ((message: MessageContent) => CustomServiceResponse);
7
7
  export type Demo = true | {
8
8
  response?: DemoResponse;
9
9
  displayErrors?: DemoErrors;
@@ -1 +1 @@
1
- {"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../src/types/demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG;KAAE,GAAG,IAAI,MAAM,qBAAqB,CAAC,CAAC,EAAE,OAAO;CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,IAAI,GACZ,IAAI,GACJ;IACE,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC"}
1
+ {"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../src/types/demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AACjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;KAAE,GAAG,IAAI,MAAM,qBAAqB,CAAC,CAAC,EAAE,OAAO;CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,qBAAqB,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,qBAAqB,CAAC,CAAC;AAExG,MAAM,MAAM,IAAI,GACZ,IAAI,GACJ;IACE,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../../src/utils/demo/demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,m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@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deep-chat-dev",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "Customizable chat component for AI APIs",
5
5
  "main": "./dist/deepChat.js",
6
6
  "module": "./dist/deepChat.js",