hume 0.11.1 → 0.11.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.
Files changed (176) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +24 -0
  2. package/.mock/definition/empathic-voice/configs.yml +2 -0
  3. package/.mock/definition/tts/__package__.yml +28 -0
  4. package/.mock/fern.config.json +1 -1
  5. package/Client.d.ts +11 -7
  6. package/Client.js +54 -6
  7. package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  8. package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  9. package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  10. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
  11. package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  12. package/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
  13. package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  14. package/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
  15. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  16. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  17. package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  18. package/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
  19. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  20. package/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
  21. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  22. package/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
  23. package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  24. package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  25. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  26. package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  27. package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  28. package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  29. package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  30. package/api/resources/empathicVoice/types/index.d.ts +2 -0
  31. package/api/resources/empathicVoice/types/index.js +2 -0
  32. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  33. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  34. package/api/resources/tts/client/Client.d.ts +24 -18
  35. package/api/resources/tts/client/Client.js +84 -46
  36. package/api/resources/tts/client/index.d.ts +1 -1
  37. package/api/resources/tts/client/index.js +15 -0
  38. package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  39. package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  40. package/api/resources/tts/client/requests/index.d.ts +1 -0
  41. package/api/resources/tts/client/requests/index.js +2 -0
  42. package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  43. package/api/resources/tts/errors/BadRequestError.js +2 -1
  44. package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  45. package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  46. package/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
  47. package/api/resources/tts/resources/voices/client/Client.js +45 -22
  48. package/api/resources/tts/types/Snippet.d.ts +2 -0
  49. package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  50. package/core/fetcher/APIResponse.d.ts +10 -0
  51. package/core/fetcher/Fetcher.js +7 -0
  52. package/core/fetcher/Headers.d.ts +2 -0
  53. package/core/fetcher/Headers.js +84 -0
  54. package/core/fetcher/HttpResponsePromise.d.ts +58 -0
  55. package/core/fetcher/HttpResponsePromise.js +103 -0
  56. package/core/fetcher/RawResponse.d.ts +29 -0
  57. package/core/fetcher/RawResponse.js +44 -0
  58. package/core/fetcher/index.d.ts +3 -0
  59. package/core/fetcher/index.js +7 -1
  60. package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  61. package/core/form-data-utils/FormDataWrapper.js +48 -9
  62. package/core/pagination/Page.d.ts +5 -2
  63. package/core/pagination/Page.js +5 -2
  64. package/core/pagination/Pageable.d.ts +2 -0
  65. package/dist/Client.d.ts +11 -7
  66. package/dist/Client.js +54 -6
  67. package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  68. package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  69. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  70. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
  71. package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  72. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
  73. package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  74. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
  75. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  76. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  77. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  78. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
  79. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  80. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
  81. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  82. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
  83. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  84. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  85. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  86. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  87. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  88. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  89. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  90. package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
  91. package/dist/api/resources/empathicVoice/types/index.js +2 -0
  92. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  93. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  94. package/dist/api/resources/tts/client/Client.d.ts +24 -18
  95. package/dist/api/resources/tts/client/Client.js +84 -46
  96. package/dist/api/resources/tts/client/index.d.ts +1 -1
  97. package/dist/api/resources/tts/client/index.js +15 -0
  98. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  99. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  100. package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
  101. package/dist/api/resources/tts/client/requests/index.js +2 -0
  102. package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  103. package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
  104. package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  105. package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  106. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
  107. package/dist/api/resources/tts/resources/voices/client/Client.js +45 -22
  108. package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
  109. package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  110. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  111. package/dist/core/fetcher/Fetcher.js +7 -0
  112. package/dist/core/fetcher/Headers.d.ts +2 -0
  113. package/dist/core/fetcher/Headers.js +84 -0
  114. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  115. package/dist/core/fetcher/HttpResponsePromise.js +103 -0
  116. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  117. package/dist/core/fetcher/RawResponse.js +44 -0
  118. package/dist/core/fetcher/index.d.ts +3 -0
  119. package/dist/core/fetcher/index.js +7 -1
  120. package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  121. package/dist/core/form-data-utils/FormDataWrapper.js +48 -9
  122. package/dist/core/pagination/Page.d.ts +5 -2
  123. package/dist/core/pagination/Page.js +5 -2
  124. package/dist/core/pagination/Pageable.d.ts +2 -0
  125. package/dist/errors/HumeError.d.ts +7 -2
  126. package/dist/errors/HumeError.js +10 -10
  127. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  128. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  129. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  130. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  131. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  132. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  133. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  134. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  135. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  136. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  137. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  138. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  139. package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  140. package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
  141. package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
  142. package/dist/serialization/resources/tts/types/Snippet.js +1 -0
  143. package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  144. package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  145. package/dist/version.d.ts +1 -1
  146. package/dist/version.js +1 -1
  147. package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  148. package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  149. package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  150. package/errors/HumeError.d.ts +7 -2
  151. package/errors/HumeError.js +10 -10
  152. package/package.json +3 -2
  153. package/reference.md +17 -15
  154. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  155. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  156. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  157. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  158. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  159. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  160. package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  161. package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  162. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  163. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  164. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  165. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  166. package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  167. package/serialization/resources/empathicVoice/types/index.js +2 -0
  168. package/serialization/resources/tts/types/Snippet.d.ts +1 -0
  169. package/serialization/resources/tts/types/Snippet.js +1 -0
  170. package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  171. package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  172. package/version.d.ts +1 -1
  173. package/version.js +1 -1
  174. package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  175. package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  176. package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
@@ -1,26 +1,52 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
11
35
  Object.defineProperty(exports, "__esModule", { value: true });
12
36
  exports.BatchClient = void 0;
13
37
  const Client_1 = require("../../../api/resources/expressionMeasurement/resources/batch/client/Client");
14
38
  const Job_1 = require("./Job");
39
+ const core = __importStar(require("../../../core"));
15
40
  class BatchClient extends Client_1.Batch {
16
- startInferenceJob() {
17
- const _super = Object.create(null, {
18
- startInferenceJob: { get: () => super.startInferenceJob }
19
- });
20
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
21
- const { jobId } = yield _super.startInferenceJob.call(this, request, requestOptions);
22
- return new Job_1.Job(jobId, this);
23
- });
41
+ // This just wraps the return value of the base class's `startInferenceJob` method
42
+ // and returns a `Job` instance (has helper functions to await the job's result) instead of a raw job ID.
43
+ startInferenceJob(request = {}, requestOptions) {
44
+ return core.HttpResponsePromise.fromPromise(super
45
+ .startInferenceJob(request, requestOptions)
46
+ .withRawResponse()
47
+ .then((result) => {
48
+ return { data: new Job_1.Job(result.data.jobId, this), rawResponse: result.rawResponse };
49
+ }));
24
50
  }
25
51
  }
26
52
  exports.BatchClient = BatchClient;
@@ -1,10 +1,15 @@
1
- /** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../core";
2
5
  export declare class HumeError extends Error {
3
6
  readonly statusCode?: number;
4
7
  readonly body?: unknown;
5
- constructor({ message, statusCode, body }: {
8
+ readonly rawResponse?: core.RawResponse;
9
+ constructor({ message, statusCode, body, rawResponse, }: {
6
10
  message?: string;
7
11
  statusCode?: number;
8
12
  body?: unknown;
13
+ rawResponse?: core.RawResponse;
9
14
  });
10
15
  }
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.HumeError = void 0;
4
- /** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
7
+ const json_1 = require("../core/json");
5
8
  class HumeError extends Error {
6
- constructor({ message, statusCode, body }) {
9
+ constructor({ message, statusCode, body, rawResponse, }) {
7
10
  super(buildMessage({ message, statusCode, body }));
8
11
  Object.setPrototypeOf(this, HumeError.prototype);
9
- if (statusCode != null) {
10
- this.statusCode = statusCode;
11
- }
12
- if (body !== undefined) {
13
- this.body = body;
14
- }
12
+ this.statusCode = statusCode;
13
+ this.body = body;
14
+ this.rawResponse = rawResponse;
15
15
  }
16
16
  }
17
17
  exports.HumeError = HumeError;
18
18
  function buildMessage({ message, statusCode, body, }) {
19
- const lines = [];
19
+ let lines = [];
20
20
  if (message != null) {
21
21
  lines.push(message);
22
22
  }
@@ -24,7 +24,7 @@ function buildMessage({ message, statusCode, body, }) {
24
24
  lines.push(`Status code: ${statusCode.toString()}`);
25
25
  }
26
26
  if (body != null) {
27
- lines.push(`Body: ${JSON.stringify(body, undefined, 2)}`);
27
+ lines.push(`Body: ${(0, json_1.toJson)(body, undefined, 2)}`);
28
28
  }
29
29
  return lines.join("\n");
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hume",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "private": false,
5
5
  "repository": "https://github.com/HumeAI/hume-typescript-sdk",
6
6
  "main": "./index.js",
@@ -44,5 +44,6 @@
44
44
  "fs": false,
45
45
  "os": false,
46
46
  "path": false
47
- }
47
+ },
48
+ "packageManager": "yarn@1.22.22"
48
49
  }
package/reference.md CHANGED
@@ -33,26 +33,28 @@ The response includes the base64-encoded audio and metadata in JSON format.
33
33
 
34
34
  ```typescript
35
35
  await client.tts.synthesizeJson({
36
- utterances: [
37
- {
38
- text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
39
- description:
40
- "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality.",
41
- },
42
- ],
43
- context: {
36
+ body: {
44
37
  utterances: [
45
38
  {
46
- text: "How can people see beauty so differently?",
39
+ text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
47
40
  description:
48
- "A curious student with a clear and respectful tone, seeking clarification on Hume's ideas with a straightforward question.",
41
+ "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality.",
49
42
  },
50
43
  ],
44
+ context: {
45
+ utterances: [
46
+ {
47
+ text: "How can people see beauty so differently?",
48
+ description:
49
+ "A curious student with a clear and respectful tone, seeking clarification on Hume's ideas with a straightforward question.",
50
+ },
51
+ ],
52
+ },
53
+ format: {
54
+ type: "mp3",
55
+ },
56
+ numGenerations: 1,
51
57
  },
52
- format: {
53
- type: "mp3",
54
- },
55
- numGenerations: 1,
56
58
  });
57
59
  ```
58
60
 
@@ -69,7 +71,7 @@ await client.tts.synthesizeJson({
69
71
  <dl>
70
72
  <dd>
71
73
 
72
- **request:** `Hume.PostedTts`
74
+ **request:** `Hume.tts.SynthesizeJsonRequest`
73
75
 
74
76
  </dd>
75
77
  </dl>
@@ -11,6 +11,7 @@ import { PostedEllmModel } from "../../../../types/PostedEllmModel";
11
11
  import { PostedUserDefinedToolSpec } from "../../../../types/PostedUserDefinedToolSpec";
12
12
  import { PostedBuiltinTool } from "../../../../types/PostedBuiltinTool";
13
13
  import { PostedEventMessageSpecs } from "../../../../types/PostedEventMessageSpecs";
14
+ import { PostedNudgeSpec } from "../../../../types/PostedNudgeSpec";
14
15
  import { PostedTimeoutSpecs } from "../../../../types/PostedTimeoutSpecs";
15
16
  import { PostedWebhookSpec } from "../../../../types/PostedWebhookSpec";
16
17
  export declare const PostedConfig: core.serialization.Schema<serializers.empathicVoice.PostedConfig.Raw, Hume.empathicVoice.PostedConfig>;
@@ -26,6 +27,7 @@ export declare namespace PostedConfig {
26
27
  tools?: (PostedUserDefinedToolSpec.Raw | null | undefined)[] | null;
27
28
  builtin_tools?: (PostedBuiltinTool.Raw | null | undefined)[] | null;
28
29
  event_messages?: PostedEventMessageSpecs.Raw | null;
30
+ nudges?: PostedNudgeSpec.Raw | null;
29
31
  timeouts?: PostedTimeoutSpecs.Raw | null;
30
32
  webhooks?: (PostedWebhookSpec.Raw | null | undefined)[] | null;
31
33
  }
@@ -45,6 +45,7 @@ const PostedEllmModel_1 = require("../../../../types/PostedEllmModel");
45
45
  const PostedUserDefinedToolSpec_1 = require("../../../../types/PostedUserDefinedToolSpec");
46
46
  const PostedBuiltinTool_1 = require("../../../../types/PostedBuiltinTool");
47
47
  const PostedEventMessageSpecs_1 = require("../../../../types/PostedEventMessageSpecs");
48
+ const PostedNudgeSpec_1 = require("../../../../types/PostedNudgeSpec");
48
49
  const PostedTimeoutSpecs_1 = require("../../../../types/PostedTimeoutSpecs");
49
50
  const PostedWebhookSpec_1 = require("../../../../types/PostedWebhookSpec");
50
51
  exports.PostedConfig = core.serialization.object({
@@ -58,6 +59,7 @@ exports.PostedConfig = core.serialization.object({
58
59
  tools: core.serialization.list(PostedUserDefinedToolSpec_1.PostedUserDefinedToolSpec.optional()).optional(),
59
60
  builtinTools: core.serialization.property("builtin_tools", core.serialization.list(PostedBuiltinTool_1.PostedBuiltinTool.optional()).optional()),
60
61
  eventMessages: core.serialization.property("event_messages", PostedEventMessageSpecs_1.PostedEventMessageSpecs.optional()),
62
+ nudges: PostedNudgeSpec_1.PostedNudgeSpec.optional(),
61
63
  timeouts: PostedTimeoutSpecs_1.PostedTimeoutSpecs.optional(),
62
64
  webhooks: core.serialization.list(PostedWebhookSpec_1.PostedWebhookSpec.optional()).optional(),
63
65
  });
@@ -12,6 +12,7 @@ import { PostedUserDefinedToolSpec } from "../../../../types/PostedUserDefinedTo
12
12
  import { PostedBuiltinTool } from "../../../../types/PostedBuiltinTool";
13
13
  import { PostedEventMessageSpecs } from "../../../../types/PostedEventMessageSpecs";
14
14
  import { PostedTimeoutSpecs } from "../../../../types/PostedTimeoutSpecs";
15
+ import { PostedNudgeSpec } from "../../../../types/PostedNudgeSpec";
15
16
  import { PostedWebhookSpec } from "../../../../types/PostedWebhookSpec";
16
17
  export declare const PostedConfigVersion: core.serialization.Schema<serializers.empathicVoice.PostedConfigVersion.Raw, Hume.empathicVoice.PostedConfigVersion>;
17
18
  export declare namespace PostedConfigVersion {
@@ -26,6 +27,7 @@ export declare namespace PostedConfigVersion {
26
27
  builtin_tools?: (PostedBuiltinTool.Raw | null | undefined)[] | null;
27
28
  event_messages?: PostedEventMessageSpecs.Raw | null;
28
29
  timeouts?: PostedTimeoutSpecs.Raw | null;
30
+ nudges?: PostedNudgeSpec.Raw | null;
29
31
  webhooks?: (PostedWebhookSpec.Raw | null | undefined)[] | null;
30
32
  }
31
33
  }
@@ -46,6 +46,7 @@ const PostedUserDefinedToolSpec_1 = require("../../../../types/PostedUserDefined
46
46
  const PostedBuiltinTool_1 = require("../../../../types/PostedBuiltinTool");
47
47
  const PostedEventMessageSpecs_1 = require("../../../../types/PostedEventMessageSpecs");
48
48
  const PostedTimeoutSpecs_1 = require("../../../../types/PostedTimeoutSpecs");
49
+ const PostedNudgeSpec_1 = require("../../../../types/PostedNudgeSpec");
49
50
  const PostedWebhookSpec_1 = require("../../../../types/PostedWebhookSpec");
50
51
  exports.PostedConfigVersion = core.serialization.object({
51
52
  eviVersion: core.serialization.property("evi_version", core.serialization.string()),
@@ -58,5 +59,6 @@ exports.PostedConfigVersion = core.serialization.object({
58
59
  builtinTools: core.serialization.property("builtin_tools", core.serialization.list(PostedBuiltinTool_1.PostedBuiltinTool.optional()).optional()),
59
60
  eventMessages: core.serialization.property("event_messages", PostedEventMessageSpecs_1.PostedEventMessageSpecs.optional()),
60
61
  timeouts: PostedTimeoutSpecs_1.PostedTimeoutSpecs.optional(),
62
+ nudges: PostedNudgeSpec_1.PostedNudgeSpec.optional(),
61
63
  webhooks: core.serialization.list(PostedWebhookSpec_1.PostedWebhookSpec.optional()).optional(),
62
64
  });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Hume from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ export declare const PostedNudgeSpec: core.serialization.ObjectSchema<serializers.empathicVoice.PostedNudgeSpec.Raw, Hume.empathicVoice.PostedNudgeSpec>;
8
+ export declare namespace PostedNudgeSpec {
9
+ interface Raw {
10
+ enabled?: boolean | null;
11
+ interval_secs?: number | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.PostedNudgeSpec = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.PostedNudgeSpec = core.serialization.object({
42
+ enabled: core.serialization.boolean().optional(),
43
+ intervalSecs: core.serialization.property("interval_secs", core.serialization.number().optional()),
44
+ });
@@ -12,6 +12,7 @@ import { ReturnUserDefinedTool } from "./ReturnUserDefinedTool";
12
12
  import { ReturnBuiltinTool } from "./ReturnBuiltinTool";
13
13
  import { ReturnEventMessageSpecs } from "./ReturnEventMessageSpecs";
14
14
  import { ReturnTimeoutSpecs } from "./ReturnTimeoutSpecs";
15
+ import { ReturnNudgeSpec } from "./ReturnNudgeSpec";
15
16
  import { ReturnWebhookSpec } from "./ReturnWebhookSpec";
16
17
  export declare const ReturnConfig: core.serialization.ObjectSchema<serializers.empathicVoice.ReturnConfig.Raw, Hume.empathicVoice.ReturnConfig>;
17
18
  export declare namespace ReturnConfig {
@@ -31,6 +32,7 @@ export declare namespace ReturnConfig {
31
32
  builtin_tools?: (ReturnBuiltinTool.Raw | null | undefined)[] | null;
32
33
  event_messages?: ReturnEventMessageSpecs.Raw | null;
33
34
  timeouts?: ReturnTimeoutSpecs.Raw | null;
35
+ nudges?: ReturnNudgeSpec.Raw | null;
34
36
  webhooks?: (ReturnWebhookSpec.Raw | null | undefined)[] | null;
35
37
  }
36
38
  }
@@ -46,6 +46,7 @@ const ReturnUserDefinedTool_1 = require("./ReturnUserDefinedTool");
46
46
  const ReturnBuiltinTool_1 = require("./ReturnBuiltinTool");
47
47
  const ReturnEventMessageSpecs_1 = require("./ReturnEventMessageSpecs");
48
48
  const ReturnTimeoutSpecs_1 = require("./ReturnTimeoutSpecs");
49
+ const ReturnNudgeSpec_1 = require("./ReturnNudgeSpec");
49
50
  const ReturnWebhookSpec_1 = require("./ReturnWebhookSpec");
50
51
  exports.ReturnConfig = core.serialization.object({
51
52
  id: core.serialization.string().optional(),
@@ -63,5 +64,6 @@ exports.ReturnConfig = core.serialization.object({
63
64
  builtinTools: core.serialization.property("builtin_tools", core.serialization.list(ReturnBuiltinTool_1.ReturnBuiltinTool.optional()).optional()),
64
65
  eventMessages: core.serialization.property("event_messages", ReturnEventMessageSpecs_1.ReturnEventMessageSpecs.optional()),
65
66
  timeouts: ReturnTimeoutSpecs_1.ReturnTimeoutSpecs.optional(),
67
+ nudges: ReturnNudgeSpec_1.ReturnNudgeSpec.optional(),
66
68
  webhooks: core.serialization.list(ReturnWebhookSpec_1.ReturnWebhookSpec.optional()).optional(),
67
69
  });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Hume from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ export declare const ReturnNudgeSpec: core.serialization.ObjectSchema<serializers.empathicVoice.ReturnNudgeSpec.Raw, Hume.empathicVoice.ReturnNudgeSpec>;
8
+ export declare namespace ReturnNudgeSpec {
9
+ interface Raw {
10
+ enabled: boolean;
11
+ interval_secs?: number | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ReturnNudgeSpec = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.ReturnNudgeSpec = core.serialization.object({
42
+ enabled: core.serialization.boolean(),
43
+ intervalSecs: core.serialization.property("interval_secs", core.serialization.number().optional()),
44
+ });
@@ -6,5 +6,5 @@ import * as Hume from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
7
  export declare const WebhookEventChatStatus: core.serialization.Schema<serializers.empathicVoice.WebhookEventChatStatus.Raw, Hume.empathicVoice.WebhookEventChatStatus>;
8
8
  export declare namespace WebhookEventChatStatus {
9
- type Raw = "ACTIVE" | "USER_ENDED" | "USER_TIMEOUT" | "INACTIVITY_TIMEOUT" | "MAX_DURATION_TIMEOUT" | "ERROR";
9
+ type Raw = "ACTIVE" | "USER_ENDED" | "USER_TIMEOUT" | "INACTIVITY_TIMEOUT" | "MAX_DURATION_TIMEOUT" | "SILENCE_TIMEOUT" | "ERROR";
10
10
  }
@@ -44,5 +44,6 @@ exports.WebhookEventChatStatus = core.serialization.enum_([
44
44
  "USER_TIMEOUT",
45
45
  "INACTIVITY_TIMEOUT",
46
46
  "MAX_DURATION_TIMEOUT",
47
+ "SILENCE_TIMEOUT",
47
48
  "ERROR",
48
49
  ]);
@@ -82,6 +82,7 @@ export * from "./PostedUserDefinedToolSpec";
82
82
  export * from "./PostedBuiltinToolName";
83
83
  export * from "./PostedBuiltinTool";
84
84
  export * from "./PostedEventMessageSpecs";
85
+ export * from "./PostedNudgeSpec";
85
86
  export * from "./PostedTimeoutSpecsInactivity";
86
87
  export * from "./PostedTimeoutSpecsMaxDuration";
87
88
  export * from "./PostedTimeoutSpecs";
@@ -93,6 +94,7 @@ export * from "./ReturnBuiltinToolToolType";
93
94
  export * from "./ReturnBuiltinTool";
94
95
  export * from "./ReturnEventMessageSpecs";
95
96
  export * from "./ReturnTimeoutSpecs";
97
+ export * from "./ReturnNudgeSpec";
96
98
  export * from "./ReturnWebhookEventType";
97
99
  export * from "./ReturnWebhookSpec";
98
100
  export * from "./ReturnChatStatus";
@@ -98,6 +98,7 @@ __exportStar(require("./PostedUserDefinedToolSpec"), exports);
98
98
  __exportStar(require("./PostedBuiltinToolName"), exports);
99
99
  __exportStar(require("./PostedBuiltinTool"), exports);
100
100
  __exportStar(require("./PostedEventMessageSpecs"), exports);
101
+ __exportStar(require("./PostedNudgeSpec"), exports);
101
102
  __exportStar(require("./PostedTimeoutSpecsInactivity"), exports);
102
103
  __exportStar(require("./PostedTimeoutSpecsMaxDuration"), exports);
103
104
  __exportStar(require("./PostedTimeoutSpecs"), exports);
@@ -109,6 +110,7 @@ __exportStar(require("./ReturnBuiltinToolToolType"), exports);
109
110
  __exportStar(require("./ReturnBuiltinTool"), exports);
110
111
  __exportStar(require("./ReturnEventMessageSpecs"), exports);
111
112
  __exportStar(require("./ReturnTimeoutSpecs"), exports);
113
+ __exportStar(require("./ReturnNudgeSpec"), exports);
112
114
  __exportStar(require("./ReturnWebhookEventType"), exports);
113
115
  __exportStar(require("./ReturnWebhookSpec"), exports);
114
116
  __exportStar(require("./ReturnChatStatus"), exports);
@@ -11,6 +11,7 @@ export declare namespace Snippet {
11
11
  generation_id: string;
12
12
  id: string;
13
13
  text: string;
14
+ transcribed_text?: string | null;
14
15
  utterance_index?: number | null;
15
16
  }
16
17
  }
@@ -43,5 +43,6 @@ exports.Snippet = core.serialization.object({
43
43
  generationId: core.serialization.property("generation_id", core.serialization.string()),
44
44
  id: core.serialization.string(),
45
45
  text: core.serialization.string(),
46
+ transcribedText: core.serialization.property("transcribed_text", core.serialization.string().optional()),
46
47
  utteranceIndex: core.serialization.property("utterance_index", core.serialization.number().optional()),
47
48
  });
@@ -13,6 +13,7 @@ export declare namespace SnippetAudioChunk {
13
13
  is_last_chunk: boolean;
14
14
  snippet_id: string;
15
15
  text: string;
16
+ transcribed_text?: string | null;
16
17
  utterance_index?: number | null;
17
18
  }
18
19
  }
@@ -45,5 +45,6 @@ exports.SnippetAudioChunk = core.serialization.object({
45
45
  isLastChunk: core.serialization.property("is_last_chunk", core.serialization.boolean()),
46
46
  snippetId: core.serialization.property("snippet_id", core.serialization.string()),
47
47
  text: core.serialization.string(),
48
+ transcribedText: core.serialization.property("transcribed_text", core.serialization.string().optional()),
48
49
  utteranceIndex: core.serialization.property("utterance_index", core.serialization.number().optional()),
49
50
  });
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.11.1";
1
+ export declare const SDK_VERSION = "0.11.2";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.11.1";
4
+ exports.SDK_VERSION = "0.11.2";
@@ -5,6 +5,8 @@ const Client_1 = require("../../api/resources/expressionMeasurement/client/Clien
5
5
  const BatchClient_1 = require("./batch/BatchClient");
6
6
  const StreamingClient_1 = require("./streaming/StreamingClient");
7
7
  class ExpressionMeasurement extends Client_1.ExpressionMeasurement {
8
+ // BatchClient here is overridden from the generated version, we wrap expression measurement jobs in
9
+ // a helper that makes it easier to await the result of a job.
8
10
  get batch() {
9
11
  var _a;
10
12
  return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new BatchClient_1.BatchClient(this._options)));
@@ -1,6 +1,7 @@
1
1
  import { Batch as FernClient } from "../../../api/resources/expressionMeasurement/resources/batch/client/Client";
2
2
  import * as Hume from "../../../api";
3
3
  import { Job } from "./Job";
4
+ import * as core from "../../../core";
4
5
  export declare class BatchClient extends FernClient {
5
- startInferenceJob(request?: Hume.expressionMeasurement.batch.InferenceBaseRequest, requestOptions?: FernClient.RequestOptions): Promise<Job>;
6
+ startInferenceJob(request?: Hume.expressionMeasurement.batch.InferenceBaseRequest, requestOptions?: FernClient.RequestOptions): core.HttpResponsePromise<Job>;
6
7
  }
@@ -1,26 +1,52 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
11
35
  Object.defineProperty(exports, "__esModule", { value: true });
12
36
  exports.BatchClient = void 0;
13
37
  const Client_1 = require("../../../api/resources/expressionMeasurement/resources/batch/client/Client");
14
38
  const Job_1 = require("./Job");
39
+ const core = __importStar(require("../../../core"));
15
40
  class BatchClient extends Client_1.Batch {
16
- startInferenceJob() {
17
- const _super = Object.create(null, {
18
- startInferenceJob: { get: () => super.startInferenceJob }
19
- });
20
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
21
- const { jobId } = yield _super.startInferenceJob.call(this, request, requestOptions);
22
- return new Job_1.Job(jobId, this);
23
- });
41
+ // This just wraps the return value of the base class's `startInferenceJob` method
42
+ // and returns a `Job` instance (has helper functions to await the job's result) instead of a raw job ID.
43
+ startInferenceJob(request = {}, requestOptions) {
44
+ return core.HttpResponsePromise.fromPromise(super
45
+ .startInferenceJob(request, requestOptions)
46
+ .withRawResponse()
47
+ .then((result) => {
48
+ return { data: new Job_1.Job(result.data.jobId, this), rawResponse: result.rawResponse };
49
+ }));
24
50
  }
25
51
  }
26
52
  exports.BatchClient = BatchClient;