hume 0.8.1-beta2 → 0.8.1-beta4

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.
Files changed (38) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +1 -1
  2. package/.mock/definition/empathic-voice/chat.yml +81 -4
  3. package/Client.d.ts +3 -3
  4. package/Client.js +6 -6
  5. package/api/resources/empathicVoice/client/index.d.ts +1 -0
  6. package/api/resources/empathicVoice/client/index.js +2 -0
  7. package/api/resources/empathicVoice/index.d.ts +1 -0
  8. package/api/resources/empathicVoice/index.js +1 -0
  9. package/api/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  10. package/api/resources/index.d.ts +1 -1
  11. package/api/resources/index.js +2 -2
  12. package/dist/Client.d.ts +3 -3
  13. package/dist/Client.js +6 -6
  14. package/dist/api/resources/empathicVoice/client/index.d.ts +1 -0
  15. package/dist/api/resources/empathicVoice/client/index.js +2 -0
  16. package/dist/api/resources/empathicVoice/index.d.ts +1 -0
  17. package/dist/api/resources/empathicVoice/index.js +1 -0
  18. package/dist/api/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  19. package/dist/api/resources/index.d.ts +1 -1
  20. package/dist/api/resources/index.js +2 -2
  21. package/dist/serialization/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  22. package/dist/serialization/resources/empathicVoice/types/AssistantEnd.js +1 -1
  23. package/dist/serialization/resources/index.d.ts +1 -1
  24. package/dist/serialization/resources/index.js +2 -2
  25. package/dist/wrapper/checkForAudioTracks.d.ts +8 -0
  26. package/dist/wrapper/checkForAudioTracks.js +24 -0
  27. package/dist/wrapper/index.d.ts +1 -0
  28. package/dist/wrapper/index.js +3 -1
  29. package/package.json +1 -1
  30. package/reference.md +444 -444
  31. package/serialization/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  32. package/serialization/resources/empathicVoice/types/AssistantEnd.js +1 -1
  33. package/serialization/resources/index.d.ts +1 -1
  34. package/serialization/resources/index.js +2 -2
  35. package/wrapper/checkForAudioTracks.d.ts +8 -0
  36. package/wrapper/checkForAudioTracks.js +24 -0
  37. package/wrapper/index.d.ts +1 -0
  38. package/wrapper/index.js +3 -1
@@ -963,7 +963,7 @@ types:
963
963
  docs: When provided, the output is an assistant end message.
964
964
  properties:
965
965
  type:
966
- type: literal<"assistant_message">
966
+ type: literal<"assistant_end">
967
967
  docs: >-
968
968
  The type of message sent through the socket; for an Assistant End
969
969
  message, this must be `assistant_end`.
@@ -4,23 +4,100 @@ channel:
4
4
  query-parameters:
5
5
  config_id:
6
6
  type: optional<string>
7
- docs: The unique identifier for the EVI configuration to be used.
7
+ docs: >-
8
+ The unique identifier for an EVI configuration.
9
+
10
+
11
+ Include this ID in your connection request to equip EVI with the Prompt,
12
+ Language Model, Voice, and Tools associated with the specified
13
+ configuration. If omitted, EVI will apply [default configuration
14
+ settings](/docs/empathic-voice-interface-evi/configuration#default-configuration).
15
+
16
+
17
+ For help obtaining this ID, see our [Configuration
18
+ Guide](/docs/empathic-voice-interface-evi/configuration).
8
19
  config_version:
9
20
  type: optional<integer>
10
- docs: The version number of the specified EVI configuration to be used.
21
+ docs: >-
22
+ The version number of the EVI configuration specified by the
23
+ `config_id`.
24
+
25
+
26
+ Configs, as well as Prompts, Tools, and Language Models, are versioned.
27
+ This versioning system supports iterative development, allowing you to
28
+ progressively refine configurations and revert to previous versions if
29
+ needed.
30
+
31
+
32
+ Include this parameter to apply a specific version of an EVI
33
+ configuration. If omitted, the latest version will be applied.
11
34
  resumed_chat_group_id:
12
35
  type: optional<string>
13
- docs: The unique identifier for a chat group. Used to resume a previous chat.
36
+ docs: >-
37
+ The unique identifier for a Chat Group. Use this field to preserve
38
+ context from a previous Chat session.
39
+
40
+
41
+ A Chat represents a single session from opening to closing a WebSocket
42
+ connection. In contrast, a Chat Group is a series of resumed Chats that
43
+ collectively represent a single conversation spanning multiple sessions.
44
+ Each Chat includes a Chat Group ID, which is used to preserve the
45
+ context of previous Chat sessions when starting a new one.
46
+
47
+
48
+ Including the Chat Group ID in the `resumed_chat_group_id` query
49
+ parameter is useful for seamlessly resuming a Chat after unexpected
50
+ network disconnections and for picking up conversations exactly where
51
+ you left off at a later time. This ensures preserved context across
52
+ multiple sessions.
53
+
54
+
55
+ There are three ways to obtain the Chat Group ID:
56
+
57
+
58
+ - [Chat
59
+ Metadata](/reference/empathic-voice-interface-evi/chat/chat#receive.Chat%20Metadata.type):
60
+ Upon establishing a WebSocket connection with EVI, the user receives a
61
+ Chat Metadata message. This message contains a `chat_group_id`, which
62
+ can be used to resume conversations within this chat group in future
63
+ sessions.
64
+
65
+
66
+ - [List Chats
67
+ endpoint](/reference/empathic-voice-interface-evi/chats/list-chats): Use
68
+ the GET `/v0/evi/chats` endpoint to obtain the Chat Group ID of
69
+ individual Chat sessions. This endpoint lists all available Chat
70
+ sessions and their associated Chat Group ID.
71
+
72
+
73
+ - [List Chat Groups
74
+ endpoint](/reference/empathic-voice-interface-evi/chat-groups/list-chat-groups):
75
+ Use the GET `/v0/evi/chat_groups` endpoint to obtain the Chat Group IDs
76
+ of all Chat Groups associated with an API key. This endpoint returns a
77
+ list of all available chat groups.
14
78
  access_token:
15
79
  type: optional<string>
16
80
  docs: >-
17
81
  Access token used for authenticating the client. If not provided, an
18
82
  `api_key` must be provided to authenticate.
83
+
84
+
85
+ The access token is generated using both an API key and a Secret key,
86
+ which provides an additional layer of security compared to using just an
87
+ API key.
88
+
89
+
90
+ For more details, refer to the [Authentication Strategies
91
+ Guide](/docs/introduction/api-key#authentication-strategies).
19
92
  api_key:
20
93
  type: optional<string>
21
94
  docs: >-
22
95
  API key used for authenticating the client. If not provided, an
23
96
  `access_token` must be provided to authenticate.
97
+
98
+
99
+ For more details, refer to the [Authentication Strategies
100
+ Guide](/docs/introduction/api-key#authentication-strategies).
24
101
  messages:
25
102
  subscribe:
26
103
  origin: server
@@ -36,7 +113,7 @@ channel:
36
113
  data: data
37
114
  - type: subscribe
38
115
  body:
39
- type: assistant_message
116
+ type: assistant_end
40
117
  imports:
41
118
  root: __package__.yml
42
119
  types:
package/Client.d.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
- import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
7
6
  import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
7
+ import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
8
8
  export declare namespace HumeClient {
9
9
  interface Options {
10
10
  environment?: core.Supplier<environments.HumeEnvironment | string>;
@@ -23,8 +23,8 @@ export declare namespace HumeClient {
23
23
  export declare class HumeClient {
24
24
  protected readonly _options: HumeClient.Options;
25
25
  constructor(_options?: HumeClient.Options);
26
- protected _empathicVoice: EmpathicVoice | undefined;
27
- get empathicVoice(): EmpathicVoice;
28
26
  protected _expressionMeasurement: ExpressionMeasurement | undefined;
29
27
  get expressionMeasurement(): ExpressionMeasurement;
28
+ protected _empathicVoice: EmpathicVoice | undefined;
29
+ get empathicVoice(): EmpathicVoice;
30
30
  }
package/Client.js CHANGED
@@ -4,19 +4,19 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HumeClient = void 0;
7
- const Client_1 = require("./api/resources/empathicVoice/client/Client");
8
- const Client_2 = require("./api/resources/expressionMeasurement/client/Client");
7
+ const Client_1 = require("./api/resources/expressionMeasurement/client/Client");
8
+ const Client_2 = require("./api/resources/empathicVoice/client/Client");
9
9
  class HumeClient {
10
10
  constructor(_options = {}) {
11
11
  this._options = _options;
12
12
  }
13
- get empathicVoice() {
13
+ get expressionMeasurement() {
14
14
  var _a;
15
- return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_1.EmpathicVoice(this._options)));
15
+ return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_1.ExpressionMeasurement(this._options)));
16
16
  }
17
- get expressionMeasurement() {
17
+ get empathicVoice() {
18
18
  var _a;
19
- return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_2.ExpressionMeasurement(this._options)));
19
+ return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_2.EmpathicVoice(this._options)));
20
20
  }
21
21
  }
22
22
  exports.HumeClient = HumeClient;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,3 @@
1
1
  export * from "./resources";
2
2
  export * from "./types";
3
+ export * from "./client";
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./resources"), exports);
18
18
  __exportStar(require("./types"), exports);
19
+ __exportStar(require("./client"), exports);
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export interface AssistantEnd {
8
8
  /** The type of message sent through the socket; for an Assistant End message, this must be `assistant_end`. */
9
- type: "assistant_message";
9
+ type: "assistant_end";
10
10
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
11
11
  customSessionId?: string;
12
12
  }
@@ -1,2 +1,2 @@
1
- export * as empathicVoice from "./empathicVoice";
2
1
  export * as expressionMeasurement from "./expressionMeasurement";
2
+ export * as empathicVoice from "./empathicVoice";
@@ -23,6 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.expressionMeasurement = exports.empathicVoice = void 0;
27
- exports.empathicVoice = __importStar(require("./empathicVoice"));
26
+ exports.empathicVoice = exports.expressionMeasurement = void 0;
28
27
  exports.expressionMeasurement = __importStar(require("./expressionMeasurement"));
28
+ exports.empathicVoice = __importStar(require("./empathicVoice"));
package/dist/Client.d.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
- import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
7
6
  import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
7
+ import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
8
8
  export declare namespace HumeClient {
9
9
  interface Options {
10
10
  environment?: core.Supplier<environments.HumeEnvironment | string>;
@@ -23,8 +23,8 @@ export declare namespace HumeClient {
23
23
  export declare class HumeClient {
24
24
  protected readonly _options: HumeClient.Options;
25
25
  constructor(_options?: HumeClient.Options);
26
- protected _empathicVoice: EmpathicVoice | undefined;
27
- get empathicVoice(): EmpathicVoice;
28
26
  protected _expressionMeasurement: ExpressionMeasurement | undefined;
29
27
  get expressionMeasurement(): ExpressionMeasurement;
28
+ protected _empathicVoice: EmpathicVoice | undefined;
29
+ get empathicVoice(): EmpathicVoice;
30
30
  }
package/dist/Client.js CHANGED
@@ -4,19 +4,19 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HumeClient = void 0;
7
- const Client_1 = require("./api/resources/empathicVoice/client/Client");
8
- const Client_2 = require("./api/resources/expressionMeasurement/client/Client");
7
+ const Client_1 = require("./api/resources/expressionMeasurement/client/Client");
8
+ const Client_2 = require("./api/resources/empathicVoice/client/Client");
9
9
  class HumeClient {
10
10
  constructor(_options = {}) {
11
11
  this._options = _options;
12
12
  }
13
- get empathicVoice() {
13
+ get expressionMeasurement() {
14
14
  var _a;
15
- return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_1.EmpathicVoice(this._options)));
15
+ return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_1.ExpressionMeasurement(this._options)));
16
16
  }
17
- get expressionMeasurement() {
17
+ get empathicVoice() {
18
18
  var _a;
19
- return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_2.ExpressionMeasurement(this._options)));
19
+ return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_2.EmpathicVoice(this._options)));
20
20
  }
21
21
  }
22
22
  exports.HumeClient = HumeClient;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,3 @@
1
1
  export * from "./resources";
2
2
  export * from "./types";
3
+ export * from "./client";
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./resources"), exports);
18
18
  __exportStar(require("./types"), exports);
19
+ __exportStar(require("./client"), exports);
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export interface AssistantEnd {
8
8
  /** The type of message sent through the socket; for an Assistant End message, this must be `assistant_end`. */
9
- type: "assistant_message";
9
+ type: "assistant_end";
10
10
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
11
11
  customSessionId?: string;
12
12
  }
@@ -1,2 +1,2 @@
1
- export * as empathicVoice from "./empathicVoice";
2
1
  export * as expressionMeasurement from "./expressionMeasurement";
2
+ export * as empathicVoice from "./empathicVoice";
@@ -23,6 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.expressionMeasurement = exports.empathicVoice = void 0;
27
- exports.empathicVoice = __importStar(require("./empathicVoice"));
26
+ exports.empathicVoice = exports.expressionMeasurement = void 0;
28
27
  exports.expressionMeasurement = __importStar(require("./expressionMeasurement"));
28
+ exports.empathicVoice = __importStar(require("./empathicVoice"));
@@ -7,7 +7,7 @@ import * as core from "../../../../core";
7
7
  export declare const AssistantEnd: core.serialization.ObjectSchema<serializers.empathicVoice.AssistantEnd.Raw, Hume.empathicVoice.AssistantEnd>;
8
8
  export declare namespace AssistantEnd {
9
9
  interface Raw {
10
- type: "assistant_message";
10
+ type: "assistant_end";
11
11
  custom_session_id?: string | null;
12
12
  }
13
13
  }
@@ -29,6 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.AssistantEnd = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
31
  exports.AssistantEnd = core.serialization.object({
32
- type: core.serialization.stringLiteral("assistant_message"),
32
+ type: core.serialization.stringLiteral("assistant_end"),
33
33
  customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
34
34
  });
@@ -1,2 +1,2 @@
1
- export * as empathicVoice from "./empathicVoice";
2
1
  export * as expressionMeasurement from "./expressionMeasurement";
2
+ export * as empathicVoice from "./empathicVoice";
@@ -23,6 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.expressionMeasurement = exports.empathicVoice = void 0;
27
- exports.empathicVoice = __importStar(require("./empathicVoice"));
26
+ exports.empathicVoice = exports.expressionMeasurement = void 0;
28
27
  exports.expressionMeasurement = __importStar(require("./expressionMeasurement"));
28
+ exports.empathicVoice = __importStar(require("./empathicVoice"));
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @name checkForAudioTracks
3
+ * @description
4
+ * Check if a MediaStream has audio tracks.
5
+ * @param stream
6
+ * The MediaStream to check
7
+ */
8
+ export declare const checkForAudioTracks: (stream: MediaStream) => void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkForAudioTracks = void 0;
4
+ /**
5
+ * @name checkForAudioTracks
6
+ * @description
7
+ * Check if a MediaStream has audio tracks.
8
+ * @param stream
9
+ * The MediaStream to check
10
+ */
11
+ const checkForAudioTracks = (stream) => {
12
+ const tracks = stream.getAudioTracks();
13
+ if (tracks.length === 0) {
14
+ throw new Error("No audio tracks");
15
+ }
16
+ if (tracks.length > 1) {
17
+ throw new Error("Multiple audio tracks");
18
+ }
19
+ const track = tracks[0];
20
+ if (!track) {
21
+ throw new Error("No audio track");
22
+ }
23
+ };
24
+ exports.checkForAudioTracks = checkForAudioTracks;
@@ -3,6 +3,7 @@ export { base64Encode } from "./base64Encode";
3
3
  export { convertBase64ToBlob } from "./convertBase64ToBlob";
4
4
  export { convertBlobToBase64 } from "./convertBlobToBase64";
5
5
  export { ensureSingleValidAudioTrack } from "./ensureSingleValidAudioTrack";
6
+ export { checkForAudioTracks } from "./checkForAudioTracks";
6
7
  export { getAudioStream } from "./getAudioStream";
7
8
  export { MimeType, getBrowserSupportedMimeType } from "./getBrowserSupportedMimeType";
8
9
  export { HumeClient } from "./HumeClient";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HumeClient = exports.getBrowserSupportedMimeType = exports.MimeType = exports.getAudioStream = exports.ensureSingleValidAudioTrack = exports.convertBlobToBase64 = exports.convertBase64ToBlob = exports.base64Encode = exports.base64Decode = void 0;
3
+ exports.HumeClient = exports.getBrowserSupportedMimeType = exports.MimeType = exports.getAudioStream = exports.checkForAudioTracks = exports.ensureSingleValidAudioTrack = exports.convertBlobToBase64 = exports.convertBase64ToBlob = exports.base64Encode = exports.base64Decode = void 0;
4
4
  var base64Decode_1 = require("./base64Decode");
5
5
  Object.defineProperty(exports, "base64Decode", { enumerable: true, get: function () { return base64Decode_1.base64Decode; } });
6
6
  var base64Encode_1 = require("./base64Encode");
@@ -11,6 +11,8 @@ var convertBlobToBase64_1 = require("./convertBlobToBase64");
11
11
  Object.defineProperty(exports, "convertBlobToBase64", { enumerable: true, get: function () { return convertBlobToBase64_1.convertBlobToBase64; } });
12
12
  var ensureSingleValidAudioTrack_1 = require("./ensureSingleValidAudioTrack");
13
13
  Object.defineProperty(exports, "ensureSingleValidAudioTrack", { enumerable: true, get: function () { return ensureSingleValidAudioTrack_1.ensureSingleValidAudioTrack; } });
14
+ var checkForAudioTracks_1 = require("./checkForAudioTracks");
15
+ Object.defineProperty(exports, "checkForAudioTracks", { enumerable: true, get: function () { return checkForAudioTracks_1.checkForAudioTracks; } });
14
16
  var getAudioStream_1 = require("./getAudioStream");
15
17
  Object.defineProperty(exports, "getAudioStream", { enumerable: true, get: function () { return getAudioStream_1.getAudioStream; } });
16
18
  var getBrowserSupportedMimeType_1 = require("./getBrowserSupportedMimeType");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hume",
3
- "version": "0.8.1-beta2",
3
+ "version": "0.8.1-beta4",
4
4
  "private": false,
5
5
  "repository": "https://github.com/HumeAI/hume-typescript-sdk",
6
6
  "main": "./index.js",