hume 0.15.3-beta.1 → 0.15.3-beta.2

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.
@@ -28,6 +28,7 @@ export declare namespace ControlPlane {
28
28
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
29
29
  }
30
30
  interface ConnectArgs {
31
+ chatId: string;
31
32
  accessToken?: string | undefined;
32
33
  /** Arbitrary headers to send with the websocket connect request. */
33
34
  headers?: Record<string, string>;
@@ -66,7 +67,7 @@ export declare class ControlPlane {
66
67
  */
67
68
  send(chatId: string, request: Hume.empathicVoice.ControlPlanePublishEvent, requestOptions?: ControlPlane.RequestOptions): core.HttpResponsePromise<void>;
68
69
  private __send;
69
- connect(args?: ControlPlane.ConnectArgs): Promise<ControlPlaneSocket>;
70
+ connect(args: ControlPlane.ConnectArgs): Promise<ControlPlaneSocket>;
70
71
  protected _getCustomAuthorizationHeaders(): Promise<{
71
72
  "X-Hume-Api-Key": string | undefined;
72
73
  }>;
@@ -141,17 +141,17 @@ class ControlPlane {
141
141
  }
142
142
  });
143
143
  }
144
- connect() {
145
- return __awaiter(this, arguments, void 0, function* (args = {}) {
144
+ connect(args) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
146
  var _a, _b;
147
- const { accessToken, headers, debug, reconnectAttempts } = args;
147
+ const { chatId, accessToken, headers, debug, reconnectAttempts } = args;
148
148
  const _queryParams = {};
149
149
  if (accessToken != null) {
150
150
  _queryParams["access_token"] = accessToken;
151
151
  }
152
152
  let _headers = (0, headers_js_1.mergeHeaders)((0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), headers);
153
153
  const socket = new core.ReconnectingWebSocket({
154
- url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Prod).evi, "/chat/"),
154
+ url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Prod).evi, `/chat/${encodeURIComponent(chatId)}/connect`),
155
155
  protocols: [],
156
156
  queryParameters: _queryParams,
157
157
  headers: _headers,
@@ -17,14 +17,9 @@ export interface ConnectSessionSettings {
17
17
  * Set to `null` to disable context injection.
18
18
  */
19
19
  context?: Hume.empathicVoice.ConnectSessionSettingsContext;
20
- /**
21
- * Unique identifier for the session. Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions.
22
- *
23
- * If included, the response sent from Hume to your backend will include this ID. This allows you to correlate frontend users with their incoming messages.
24
- *
25
- * It is recommended to pass a `custom_session_id` if you are using a Custom Language Model. Please see our guide to [using a custom language model](/docs/empathic-voice-interface-evi/custom-language-model) with EVI to learn more.
26
- */
20
+ /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
27
21
  customSessionId?: string;
22
+ /** The maximum number of chat events to return from chat history. By default, the system returns up to 300 events (100 events per page × 3 pages). Set this parameter to a smaller value to limit the number of events returned. */
28
23
  eventLimit?: number;
29
24
  /**
30
25
  * Third party API key for the supplemental language model.
@@ -39,7 +34,7 @@ export interface ConnectSessionSettings {
39
34
  *
40
35
  * You can use the Prompt to define a specific goal or role for EVI, specifying how it should act or what it should focus on during the conversation. For example, EVI can be instructed to act as a customer support representative, a fitness coach, or a travel advisor, each with its own set of behaviors and response styles.
41
36
  *
42
- * For help writing a system prompt, see our [Prompting Guide](/docs/empathic-voice-interface-evi/prompting).
37
+ * For help writing a system prompt, see our [Prompting Guide](/docs/speech-to-speech-evi/guides/prompting).
43
38
  */
44
39
  systemPrompt?: string;
45
40
  /**
@@ -50,5 +45,6 @@ export interface ConnectSessionSettings {
50
45
  * Using this field, you can personalize responses based on session-specific details. For more guidance, see our [guide on using dynamic variables](/docs/speech-to-speech-evi/features/dynamic-variables).
51
46
  */
52
47
  variables?: Record<string, Hume.empathicVoice.ConnectSessionSettingsVariablesValue>;
48
+ /** The name or ID of the voice from the `Voice Library` to be used as the speaker for this EVI session. This will override the speaker set in the selected configuration. */
53
49
  voiceId?: string;
54
50
  }
@@ -8,10 +8,10 @@ import * as Hume from "../../../index.js";
8
8
  * This optional field is only required when the audio input is encoded in PCM Linear 16 (16-bit, little-endian, signed PCM WAV data). For detailed instructions on how to configure session settings for PCM Linear 16 audio, please refer to the [Session Settings section](/docs/empathic-voice-interface-evi/configuration#session-settings) on the EVI Configuration page.
9
9
  */
10
10
  export interface ConnectSessionSettingsAudio {
11
- /** Number of audio channels. */
11
+ /** Sets number of audio channels for audio input. */
12
12
  channels?: number;
13
- /** Encoding format of the audio input, such as `linear16`. */
13
+ /** Sets encoding format of the audio input, such as `linear16`. */
14
14
  encoding?: Hume.empathicVoice.Encoding;
15
- /** Audio sample rate. Number of samples per second in the audio input, measured in Hertz. */
15
+ /** Sets the sample rate for audio input. (Number of samples per second in the audio input, measured in Hertz.) */
16
16
  sampleRate?: number;
17
17
  }
@@ -13,21 +13,15 @@ export interface ConnectSessionSettingsContext {
13
13
  /**
14
14
  * The context to be injected into the conversation. Helps inform the LLM's response by providing relevant information about the ongoing conversation.
15
15
  *
16
- * This text will be appended to the end of user messages based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
16
+ * This text will be appended to the end of [user_messages](/reference/speech-to-speech-evi/chat#receive.UserMessage.message.content) based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
17
17
  */
18
18
  text?: string;
19
19
  /**
20
20
  * The persistence level of the injected context. Specifies how long the injected context will remain active in the session.
21
21
  *
22
- * There are three possible context types:
22
+ * - **Temporary**: Context that is only applied to the following assistant response.
23
23
  *
24
- * - **Persistent**: The context is appended to all user messages for the duration of the session.
25
- *
26
- * - **Temporary**: The context is appended only to the next user message.
27
- *
28
- * - **Editable**: The original context is updated to reflect the new context.
29
- *
30
- * If the type is not specified, it will default to `temporary`.
24
+ * - **Persistent**: Context that is applied to all subsequent assistant responses for the remainder of the Chat.
31
25
  */
32
26
  type?: Hume.empathicVoice.ContextType;
33
27
  }
@@ -9,7 +9,11 @@ export interface PostedTts {
9
9
  format?: Hume.tts.Format;
10
10
  /** The set of timestamp types to include in the response. */
11
11
  includeTimestampTypes?: Hume.tts.TimestampType[];
12
- /** Number of generations of the audio to produce. */
12
+ /**
13
+ * Number of audio generations to produce from the input utterances.
14
+ *
15
+ * Using `num_generations` enables faster processing than issuing multiple sequential requests. Additionally, specifying `num_generations` allows prosody continuation across all generations without repeating context, ensuring each generation sounds slightly different while maintaining contextual consistency.
16
+ */
13
17
  numGenerations?: number;
14
18
  /**
15
19
  * Controls how audio output is segmented in the response.
@@ -28,6 +28,7 @@ export declare namespace ControlPlane {
28
28
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
29
29
  }
30
30
  interface ConnectArgs {
31
+ chatId: string;
31
32
  accessToken?: string | undefined;
32
33
  /** Arbitrary headers to send with the websocket connect request. */
33
34
  headers?: Record<string, string>;
@@ -66,7 +67,7 @@ export declare class ControlPlane {
66
67
  */
67
68
  send(chatId: string, request: Hume.empathicVoice.ControlPlanePublishEvent, requestOptions?: ControlPlane.RequestOptions): core.HttpResponsePromise<void>;
68
69
  private __send;
69
- connect(args?: ControlPlane.ConnectArgs): Promise<ControlPlaneSocket>;
70
+ connect(args: ControlPlane.ConnectArgs): Promise<ControlPlaneSocket>;
70
71
  protected _getCustomAuthorizationHeaders(): Promise<{
71
72
  "X-Hume-Api-Key": string | undefined;
72
73
  }>;
@@ -105,17 +105,17 @@ export class ControlPlane {
105
105
  }
106
106
  });
107
107
  }
108
- connect() {
109
- return __awaiter(this, arguments, void 0, function* (args = {}) {
108
+ connect(args) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
110
  var _a, _b;
111
- const { accessToken, headers, debug, reconnectAttempts } = args;
111
+ const { chatId, accessToken, headers, debug, reconnectAttempts } = args;
112
112
  const _queryParams = {};
113
113
  if (accessToken != null) {
114
114
  _queryParams["access_token"] = accessToken;
115
115
  }
116
116
  let _headers = mergeHeaders(mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), headers);
117
117
  const socket = new core.ReconnectingWebSocket({
118
- url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Prod).evi, "/chat/"),
118
+ url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Prod).evi, `/chat/${encodeURIComponent(chatId)}/connect`),
119
119
  protocols: [],
120
120
  queryParameters: _queryParams,
121
121
  headers: _headers,
@@ -17,14 +17,9 @@ export interface ConnectSessionSettings {
17
17
  * Set to `null` to disable context injection.
18
18
  */
19
19
  context?: Hume.empathicVoice.ConnectSessionSettingsContext;
20
- /**
21
- * Unique identifier for the session. Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions.
22
- *
23
- * If included, the response sent from Hume to your backend will include this ID. This allows you to correlate frontend users with their incoming messages.
24
- *
25
- * It is recommended to pass a `custom_session_id` if you are using a Custom Language Model. Please see our guide to [using a custom language model](/docs/empathic-voice-interface-evi/custom-language-model) with EVI to learn more.
26
- */
20
+ /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
27
21
  customSessionId?: string;
22
+ /** The maximum number of chat events to return from chat history. By default, the system returns up to 300 events (100 events per page × 3 pages). Set this parameter to a smaller value to limit the number of events returned. */
28
23
  eventLimit?: number;
29
24
  /**
30
25
  * Third party API key for the supplemental language model.
@@ -39,7 +34,7 @@ export interface ConnectSessionSettings {
39
34
  *
40
35
  * You can use the Prompt to define a specific goal or role for EVI, specifying how it should act or what it should focus on during the conversation. For example, EVI can be instructed to act as a customer support representative, a fitness coach, or a travel advisor, each with its own set of behaviors and response styles.
41
36
  *
42
- * For help writing a system prompt, see our [Prompting Guide](/docs/empathic-voice-interface-evi/prompting).
37
+ * For help writing a system prompt, see our [Prompting Guide](/docs/speech-to-speech-evi/guides/prompting).
43
38
  */
44
39
  systemPrompt?: string;
45
40
  /**
@@ -50,5 +45,6 @@ export interface ConnectSessionSettings {
50
45
  * Using this field, you can personalize responses based on session-specific details. For more guidance, see our [guide on using dynamic variables](/docs/speech-to-speech-evi/features/dynamic-variables).
51
46
  */
52
47
  variables?: Record<string, Hume.empathicVoice.ConnectSessionSettingsVariablesValue>;
48
+ /** The name or ID of the voice from the `Voice Library` to be used as the speaker for this EVI session. This will override the speaker set in the selected configuration. */
53
49
  voiceId?: string;
54
50
  }
@@ -8,10 +8,10 @@ import * as Hume from "../../../index.mjs";
8
8
  * This optional field is only required when the audio input is encoded in PCM Linear 16 (16-bit, little-endian, signed PCM WAV data). For detailed instructions on how to configure session settings for PCM Linear 16 audio, please refer to the [Session Settings section](/docs/empathic-voice-interface-evi/configuration#session-settings) on the EVI Configuration page.
9
9
  */
10
10
  export interface ConnectSessionSettingsAudio {
11
- /** Number of audio channels. */
11
+ /** Sets number of audio channels for audio input. */
12
12
  channels?: number;
13
- /** Encoding format of the audio input, such as `linear16`. */
13
+ /** Sets encoding format of the audio input, such as `linear16`. */
14
14
  encoding?: Hume.empathicVoice.Encoding;
15
- /** Audio sample rate. Number of samples per second in the audio input, measured in Hertz. */
15
+ /** Sets the sample rate for audio input. (Number of samples per second in the audio input, measured in Hertz.) */
16
16
  sampleRate?: number;
17
17
  }
@@ -13,21 +13,15 @@ export interface ConnectSessionSettingsContext {
13
13
  /**
14
14
  * The context to be injected into the conversation. Helps inform the LLM's response by providing relevant information about the ongoing conversation.
15
15
  *
16
- * This text will be appended to the end of user messages based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
16
+ * This text will be appended to the end of [user_messages](/reference/speech-to-speech-evi/chat#receive.UserMessage.message.content) based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
17
17
  */
18
18
  text?: string;
19
19
  /**
20
20
  * The persistence level of the injected context. Specifies how long the injected context will remain active in the session.
21
21
  *
22
- * There are three possible context types:
22
+ * - **Temporary**: Context that is only applied to the following assistant response.
23
23
  *
24
- * - **Persistent**: The context is appended to all user messages for the duration of the session.
25
- *
26
- * - **Temporary**: The context is appended only to the next user message.
27
- *
28
- * - **Editable**: The original context is updated to reflect the new context.
29
- *
30
- * If the type is not specified, it will default to `temporary`.
24
+ * - **Persistent**: Context that is applied to all subsequent assistant responses for the remainder of the Chat.
31
25
  */
32
26
  type?: Hume.empathicVoice.ContextType;
33
27
  }
@@ -9,7 +9,11 @@ export interface PostedTts {
9
9
  format?: Hume.tts.Format;
10
10
  /** The set of timestamp types to include in the response. */
11
11
  includeTimestampTypes?: Hume.tts.TimestampType[];
12
- /** Number of generations of the audio to produce. */
12
+ /**
13
+ * Number of audio generations to produce from the input utterances.
14
+ *
15
+ * Using `num_generations` enables faster processing than issuing multiple sequential requests. Additionally, specifying `num_generations` allows prosody continuation across all generations without repeating context, ensuring each generation sounds slightly different while maintaining contextual consistency.
16
+ */
13
17
  numGenerations?: number;
14
18
  /**
15
19
  * Controls how audio output is segmented in the response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hume",
3
- "version": "0.15.3-beta.1",
3
+ "version": "0.15.3-beta.2",
4
4
  "private": false,
5
5
  "repository": "github:humeai/hume-typescript-sdk",
6
6
  "type": "commonjs",