@humeai/audio-decisions 0.1.0 → 0.2.0

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 (72) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/resources/decisions/client/Client.d.ts +6 -6
  4. package/dist/cjs/api/resources/decisions/client/Client.js +6 -6
  5. package/dist/cjs/api/resources/decisions/client/requests/DecisionsUpload.d.ts +2 -2
  6. package/dist/cjs/api/resources/decisions/client/requests/InputTokensRequest.d.ts +1 -1
  7. package/dist/cjs/api/types/Answer.d.ts +3 -3
  8. package/dist/cjs/api/types/Question.d.ts +3 -3
  9. package/dist/cjs/api/types/Questions.d.ts +1 -1
  10. package/dist/cjs/api/types/Span.d.ts +11 -0
  11. package/dist/cjs/api/types/SpanAnswer.d.ts +8 -0
  12. package/dist/cjs/api/types/{MomentQuestion.d.ts → SpanQuestion.d.ts} +1 -1
  13. package/dist/cjs/api/types/index.d.ts +3 -3
  14. package/dist/cjs/api/types/index.js +3 -3
  15. package/dist/cjs/audio-helpers/results.d.ts +2 -2
  16. package/dist/cjs/serialization/types/Answer.d.ts +4 -4
  17. package/dist/cjs/serialization/types/Answer.js +2 -2
  18. package/dist/cjs/serialization/types/Question.d.ts +4 -4
  19. package/dist/cjs/serialization/types/Question.js +2 -2
  20. package/dist/cjs/serialization/types/{Moment.d.ts → Span.d.ts} +2 -2
  21. package/dist/cjs/serialization/types/{Moment.js → Span.js} +2 -2
  22. package/dist/cjs/serialization/types/SpanAnswer.d.ts +10 -0
  23. package/dist/cjs/serialization/types/{MomentAnswer.js → SpanAnswer.js} +4 -4
  24. package/dist/cjs/serialization/types/{MomentQuestion.d.ts → SpanQuestion.d.ts} +2 -2
  25. package/dist/cjs/serialization/types/{MomentQuestion.js → SpanQuestion.js} +2 -2
  26. package/dist/cjs/serialization/types/index.d.ts +3 -3
  27. package/dist/cjs/serialization/types/index.js +3 -3
  28. package/dist/cjs/version.d.ts +1 -1
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/esm/BaseClient.mjs +2 -2
  31. package/dist/esm/api/resources/decisions/client/Client.d.mts +6 -6
  32. package/dist/esm/api/resources/decisions/client/Client.mjs +6 -6
  33. package/dist/esm/api/resources/decisions/client/requests/DecisionsUpload.d.mts +2 -2
  34. package/dist/esm/api/resources/decisions/client/requests/InputTokensRequest.d.mts +1 -1
  35. package/dist/esm/api/types/Answer.d.mts +3 -3
  36. package/dist/esm/api/types/Question.d.mts +3 -3
  37. package/dist/esm/api/types/Questions.d.mts +1 -1
  38. package/dist/esm/api/types/Span.d.mts +11 -0
  39. package/dist/esm/api/types/SpanAnswer.d.mts +8 -0
  40. package/dist/esm/api/types/{MomentQuestion.d.mts → SpanQuestion.d.mts} +1 -1
  41. package/dist/esm/api/types/index.d.mts +3 -3
  42. package/dist/esm/api/types/index.mjs +3 -3
  43. package/dist/esm/audio-helpers/results.d.mts +2 -2
  44. package/dist/esm/serialization/types/Answer.d.mts +4 -4
  45. package/dist/esm/serialization/types/Answer.mjs +2 -2
  46. package/dist/esm/serialization/types/Question.d.mts +4 -4
  47. package/dist/esm/serialization/types/Question.mjs +2 -2
  48. package/dist/esm/serialization/types/{Moment.d.mts → Span.d.mts} +2 -2
  49. package/dist/esm/serialization/types/{Moment.mjs → Span.mjs} +1 -1
  50. package/dist/esm/serialization/types/SpanAnswer.d.mts +10 -0
  51. package/dist/esm/serialization/types/SpanAnswer.mjs +6 -0
  52. package/dist/esm/serialization/types/{MomentQuestion.d.mts → SpanQuestion.d.mts} +2 -2
  53. package/dist/esm/serialization/types/{MomentQuestion.mjs → SpanQuestion.mjs} +1 -1
  54. package/dist/esm/serialization/types/index.d.mts +3 -3
  55. package/dist/esm/serialization/types/index.mjs +3 -3
  56. package/dist/esm/version.d.mts +1 -1
  57. package/dist/esm/version.mjs +1 -1
  58. package/package.json +1 -1
  59. package/reference.md +2 -2
  60. package/dist/cjs/api/types/Moment.d.ts +0 -11
  61. package/dist/cjs/api/types/MomentAnswer.d.ts +0 -8
  62. package/dist/cjs/serialization/types/MomentAnswer.d.ts +0 -10
  63. package/dist/esm/api/types/Moment.d.mts +0 -11
  64. package/dist/esm/api/types/MomentAnswer.d.mts +0 -8
  65. package/dist/esm/serialization/types/MomentAnswer.d.mts +0 -10
  66. package/dist/esm/serialization/types/MomentAnswer.mjs +0 -6
  67. /package/dist/cjs/api/types/{Moment.js → Span.js} +0 -0
  68. /package/dist/cjs/api/types/{MomentAnswer.js → SpanAnswer.js} +0 -0
  69. /package/dist/cjs/api/types/{MomentQuestion.js → SpanQuestion.js} +0 -0
  70. /package/dist/esm/api/types/{Moment.mjs → Span.mjs} +0 -0
  71. /package/dist/esm/api/types/{MomentAnswer.mjs → SpanAnswer.mjs} +0 -0
  72. /package/dist/esm/api/types/{MomentQuestion.mjs → SpanQuestion.mjs} +0 -0
package/README.md CHANGED
@@ -201,7 +201,7 @@ const result = await client.decisions.createChunked({
201
201
  context: "A call in which a voice AI agent helps a caller reschedule an appointment.",
202
202
  questions: {
203
203
  agent_glitches: {
204
- type: "moment",
204
+ type: "span",
205
205
  instructions: "Where does the agent glitch, slur or sound robotic?",
206
206
  },
207
207
  talks_over_caller: {
@@ -219,16 +219,16 @@ for (const chunk of result.chunks) {
219
219
  continue;
220
220
  }
221
221
  const answer = chunk.response.answers.agent_glitches;
222
- if (answer.type === "moment") {
223
- for (const moment of answer.moments) {
224
- // Moments are measured from the start of the chunk.
225
- console.log(`${chunk.startMs + moment.audioStartMs} to ${chunk.startMs + moment.audioEndMs} ms`);
222
+ if (answer.type === "span") {
223
+ for (const span of answer.spans) {
224
+ // Span times are measured from the start of the chunk.
225
+ console.log(`${chunk.startMs + span.audioStartMs} to ${chunk.startMs + span.audioEndMs} ms`);
226
226
  }
227
227
  }
228
228
  }
229
229
  ```
230
230
 
231
- Each chunk's `startMs` and `endMs` give where it starts and ends in the recording, so add its `startMs` to a moment's times to place the moment in the recording. Pass `startMs` and `endMs` to `createChunked` to send only part of the recording.
231
+ Each chunk's `startMs` and `endMs` give where it starts and ends in the recording, so add its `startMs` to a span's times to place the span in the recording. Pass `startMs` and `endMs` to `createChunked` to send only part of the recording.
232
232
 
233
233
  ### Chunk length
234
234
 
@@ -265,14 +265,14 @@ if (result.complete) {
265
265
  }
266
266
  ```
267
267
 
268
- To ask how much of the call something describes, count the chunks whose `noul` passes a threshold instead. A `moment` answer needs no combining once its times are placed in the recording.
268
+ To ask how much of the call something describes, count the chunks whose `noul` passes a threshold instead. A `span` answer needs no combining once its times are placed in the recording.
269
269
 
270
270
  ### Where cuts fall
271
271
 
272
272
  1. A WAV file is cut between samples, after it is mixed down.
273
- 2. An MP3 file is cut between frames, without being decoded, so chunks can differ in length by a frame or more; a frame lasts 24 to 72 ms. A frame can depend on the frames before it, so every chunk after the first starts with frames repeated from the end of the chunk before, usually a fraction of a second and up to about 2 seconds at the lowest bitrates. They count toward `maxChunkMs` and are included in the chunk's `startMs`, so a moment near a cut can appear in both chunks. Most MP3 files also start with a few tens of milliseconds of silence that the encoder added and players skip. Times are measured from where a player starts the file, so the first chunk's `startMs` can be below 0.
273
+ 2. An MP3 file is cut between frames, without being decoded, so chunks can differ in length by a frame or more; a frame lasts 24 to 72 ms. A frame can depend on the frames before it, so every chunk after the first starts with frames repeated from the end of the chunk before, usually a fraction of a second and up to about 2 seconds at the lowest bitrates. They count toward `maxChunkMs` and are included in the chunk's `startMs`, so a span near a cut can appear in both chunks. Most MP3 files also start with a few tens of milliseconds of silence that the encoder added and players skip. Times are measured from where a player starts the file, so the first chunk's `startMs` can be below 0.
274
274
 
275
- In both formats, an event that crosses a cut, such as the agent talking over the caller for a second or two around it, is heard in part by each chunk. A `moment` question can return it as two shorter moments, as one that ends or starts at the cut, or not at all, and a `noul` answer about it can come out lower in both chunks than for audio that holds the whole event. The frames an MP3 chunk repeats are there so it can be decoded, and cannot be relied on to cover an event at a cut.
275
+ In both formats, an event that crosses a cut, such as the agent talking over the caller for a second or two around it, is heard in part by each chunk. A `span` question can return it as two shorter spans, as one that ends or starts at the cut, or not at all, and a `noul` answer about it can come out lower in both chunks than for audio that holds the whole event. The frames an MP3 chunk repeats are there so it can be decoded, and cannot be relied on to cover an event at a cut.
276
276
 
277
277
  ### Failures and resuming
278
278
 
@@ -304,7 +304,7 @@ for await (const chunk of client.decisions.iterCreateChunked({
304
304
  request: {
305
305
  questions: {
306
306
  agent_glitches: {
307
- type: "moment",
307
+ type: "span",
308
308
  instructions: "Where does the agent glitch, slur or sound robotic?",
309
309
  },
310
310
  },
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@humeai/audio-decisions",
46
- "X-Fern-SDK-Version": "0.1.0",
47
- "User-Agent": "@humeai/audio-decisions/0.1.0",
46
+ "X-Fern-SDK-Version": "0.2.0",
47
+ "User-Agent": "@humeai/audio-decisions/0.2.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -67,7 +67,7 @@ export declare class DecisionsClient {
67
67
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
68
68
  * },
69
69
  * "agent_glitches": {
70
- * type: "moment",
70
+ * type: "span",
71
71
  * instructions: "Where does the agent glitch, slur or sound robotic?"
72
72
  * }
73
73
  * }
@@ -144,7 +144,7 @@ export declare class DecisionsClient {
144
144
  * context: "A clip from a licensed corpus of scripted speech by consenting voice actors, being labeled to train an expressive text-to-speech model.",
145
145
  * questions: {
146
146
  * "vocal_bursts": {
147
- * type: "moment",
147
+ * type: "span",
148
148
  * instructions: "Where does the speaker laugh, sigh, gasp or make another vocal burst?"
149
149
  * }
150
150
  * }
@@ -198,7 +198,7 @@ export declare class DecisionsClient {
198
198
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
199
199
  * },
200
200
  * "agent_glitches": {
201
- * type: "moment",
201
+ * type: "span",
202
202
  * instructions: "Where does the agent glitch, slur or sound robotic?"
203
203
  * }
204
204
  * }
@@ -209,7 +209,7 @@ export declare class DecisionsClient {
209
209
  /**
210
210
  * Cuts a recording longer than `create` accepts into chunks and sends each chunk to the model in its own `create` request. The recording is never sent as one file. The model processes each chunk independently, hearing only that chunk, so every answer describes its chunk alone and nothing combines the answers across chunks. Each request has its own `runId` and its own billing. Each chunk's result is yielded as soon as its request is done, so it can be saved or reported before the next chunk is sent.
211
211
  *
212
- * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A moment's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
212
+ * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A span's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
213
213
  *
214
214
  * The whole recording is read into memory before the first request, so that a file that cannot be split is rejected before anything is sent and billed. A WAV file is mixed down before it is cut, as `downmixStrategy` asks. Each chunk is copied only while its request is sent, so memory use stays near the size of the recording and its mixed-down copy. An hour of 16-bit stereo WAV at 48 kHz is about 690 MB, and about 230 MB once mixed down.
215
215
  *
@@ -230,7 +230,7 @@ export declare class DecisionsClient {
230
230
  * request: {
231
231
  * questions: {
232
232
  * "agent_glitches": {
233
- * type: "moment",
233
+ * type: "span",
234
234
  * instructions: "Where does the agent glitch, slur or sound robotic?"
235
235
  * }
236
236
  * }
@@ -265,7 +265,7 @@ export declare class DecisionsClient {
265
265
  * request: {
266
266
  * questions: {
267
267
  * "agent_glitches": {
268
- * type: "moment",
268
+ * type: "span",
269
269
  * instructions: "Where does the agent glitch, slur or sound robotic?"
270
270
  * }
271
271
  * }
@@ -115,7 +115,7 @@ class DecisionsClient {
115
115
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
116
116
  * },
117
117
  * "agent_glitches": {
118
- * type: "moment",
118
+ * type: "span",
119
119
  * instructions: "Where does the agent glitch, slur or sound robotic?"
120
120
  * }
121
121
  * }
@@ -192,7 +192,7 @@ class DecisionsClient {
192
192
  * context: "A clip from a licensed corpus of scripted speech by consenting voice actors, being labeled to train an expressive text-to-speech model.",
193
193
  * questions: {
194
194
  * "vocal_bursts": {
195
- * type: "moment",
195
+ * type: "span",
196
196
  * instructions: "Where does the speaker laugh, sigh, gasp or make another vocal burst?"
197
197
  * }
198
198
  * }
@@ -367,7 +367,7 @@ class DecisionsClient {
367
367
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
368
368
  * },
369
369
  * "agent_glitches": {
370
- * type: "moment",
370
+ * type: "span",
371
371
  * instructions: "Where does the agent glitch, slur or sound robotic?"
372
372
  * }
373
373
  * }
@@ -482,7 +482,7 @@ class DecisionsClient {
482
482
  /**
483
483
  * Cuts a recording longer than `create` accepts into chunks and sends each chunk to the model in its own `create` request. The recording is never sent as one file. The model processes each chunk independently, hearing only that chunk, so every answer describes its chunk alone and nothing combines the answers across chunks. Each request has its own `runId` and its own billing. Each chunk's result is yielded as soon as its request is done, so it can be saved or reported before the next chunk is sent.
484
484
  *
485
- * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A moment's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
485
+ * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A span's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
486
486
  *
487
487
  * The whole recording is read into memory before the first request, so that a file that cannot be split is rejected before anything is sent and billed. A WAV file is mixed down before it is cut, as `downmixStrategy` asks. Each chunk is copied only while its request is sent, so memory use stays near the size of the recording and its mixed-down copy. An hour of 16-bit stereo WAV at 48 kHz is about 690 MB, and about 230 MB once mixed down.
488
488
  *
@@ -503,7 +503,7 @@ class DecisionsClient {
503
503
  * request: {
504
504
  * questions: {
505
505
  * "agent_glitches": {
506
- * type: "moment",
506
+ * type: "span",
507
507
  * instructions: "Where does the agent glitch, slur or sound robotic?"
508
508
  * }
509
509
  * }
@@ -540,7 +540,7 @@ class DecisionsClient {
540
540
  * request: {
541
541
  * questions: {
542
542
  * "agent_glitches": {
543
- * type: "moment",
543
+ * type: "span",
544
544
  * instructions: "Where does the agent glitch, slur or sound robotic?"
545
545
  * }
546
546
  * }
@@ -31,7 +31,7 @@ import type * as Decisions from "../../../../index.js";
31
31
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
32
32
  * },
33
33
  * "agent_glitches": {
34
- * type: "moment",
34
+ * type: "span",
35
35
  * instructions: "Where does the agent glitch, slur or sound robotic?"
36
36
  * }
37
37
  * }
@@ -104,7 +104,7 @@ import type * as Decisions from "../../../../index.js";
104
104
  * context: "A clip from a licensed corpus of scripted speech by consenting voice actors, being labeled to train an expressive text-to-speech model.",
105
105
  * questions: {
106
106
  * "vocal_bursts": {
107
- * type: "moment",
107
+ * type: "span",
108
108
  * instructions: "Where does the speaker laugh, sigh, gasp or make another vocal burst?"
109
109
  * }
110
110
  * }
@@ -29,7 +29,7 @@ import type * as Decisions from "../../../../index.js";
29
29
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
30
30
  * },
31
31
  * "agent_glitches": {
32
- * type: "moment",
32
+ * type: "span",
33
33
  * instructions: "Where does the agent glitch, slur or sound robotic?"
34
34
  * }
35
35
  * }
@@ -2,7 +2,7 @@ import type * as Decisions from "../index.js";
2
2
  /**
3
3
  * The answer to one question. `type` names the question's primitive and determines the answer's fields. Treat an unrecognized `type` as unknown rather than as an error.
4
4
  */
5
- export type Answer = Decisions.Answer.Noul | Decisions.Answer.Choice | Decisions.Answer.Score | Decisions.Answer.Moment;
5
+ export type Answer = Decisions.Answer.Noul | Decisions.Answer.Choice | Decisions.Answer.Score | Decisions.Answer.Span;
6
6
  export declare namespace Answer {
7
7
  interface Noul extends Decisions.NoulAnswer {
8
8
  type: "noul";
@@ -13,7 +13,7 @@ export declare namespace Answer {
13
13
  interface Score extends Decisions.ScoreAnswer {
14
14
  type: "score";
15
15
  }
16
- interface Moment extends Decisions.MomentAnswer {
17
- type: "moment";
16
+ interface Span extends Decisions.SpanAnswer {
17
+ type: "span";
18
18
  }
19
19
  }
@@ -2,7 +2,7 @@ import type * as Decisions from "../index.js";
2
2
  /**
3
3
  * A question. `type` names its primitive, which determines the question's options and the structure of its answer.
4
4
  */
5
- export type Question = Decisions.Question.Noul | Decisions.Question.Choice | Decisions.Question.Score | Decisions.Question.Moment;
5
+ export type Question = Decisions.Question.Noul | Decisions.Question.Choice | Decisions.Question.Score | Decisions.Question.Span;
6
6
  export declare namespace Question {
7
7
  interface Noul extends Decisions.NoulQuestion {
8
8
  type: "noul";
@@ -13,7 +13,7 @@ export declare namespace Question {
13
13
  interface Score extends Decisions.ScoreQuestion {
14
14
  type: "score";
15
15
  }
16
- interface Moment extends Decisions.MomentQuestion {
17
- type: "moment";
16
+ interface Span extends Decisions.SpanQuestion {
17
+ type: "span";
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  import type * as Decisions from "../index.js";
2
2
  /**
3
- * The questions to answer: at most 20 `noul`, `choice` and `score` questions together, and at most 5 `moment` questions. Each key is a question ID you choose, such as `agent_tone`, and can be any non-empty string of up to 256 characters. The response returns each answer under the same ID.
3
+ * The questions to answer: at most 20 `noul`, `choice` and `score` questions together, and at most 5 `span` questions. Each key is a question ID you choose, such as `agent_tone`, and can be any non-empty string of up to 256 characters. The response returns each answer under the same ID.
4
4
  */
5
5
  export type Questions = {
6
6
  [key: string]: Decisions.Question;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A span where the described event may occur.
3
+ */
4
+ export interface Span {
5
+ /** Where the span begins, in milliseconds from the start of the audio file. */
6
+ audioStartMs: number;
7
+ /** Where the span ends, in milliseconds from the start of the audio file. */
8
+ audioEndMs: number;
9
+ /** The probability that the event occurs in the span. */
10
+ probability: number;
11
+ }
@@ -0,0 +1,8 @@
1
+ import type * as Decisions from "../index.js";
2
+ /**
3
+ * The answer to a `span` question.
4
+ */
5
+ export interface SpanAnswer {
6
+ /** The spans where the described event may occur, in order of `audio_start_ms`. Overlapping candidates are merged. An empty array means the event was not found. */
7
+ spans: Decisions.Span[];
8
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Asks when an event occurs in the audio.
3
3
  */
4
- export interface MomentQuestion {
4
+ export interface SpanQuestion {
5
5
  /** The question, written in natural language. */
6
6
  instructions: string;
7
7
  }
@@ -10,9 +10,6 @@ export * from "./ErrorCode.js";
10
10
  export * from "./ErrorType.js";
11
11
  export * from "./GatewayError.js";
12
12
  export * from "./InputTokensResponse.js";
13
- export * from "./Moment.js";
14
- export * from "./MomentAnswer.js";
15
- export * from "./MomentQuestion.js";
16
13
  export * from "./NoulAnswer.js";
17
14
  export * from "./NoulCriteria.js";
18
15
  export * from "./NoulQuestion.js";
@@ -26,3 +23,6 @@ export * from "./RunSummary.js";
26
23
  export * from "./RunsPage.js";
27
24
  export * from "./ScoreAnswer.js";
28
25
  export * from "./ScoreQuestion.js";
26
+ export * from "./Span.js";
27
+ export * from "./SpanAnswer.js";
28
+ export * from "./SpanQuestion.js";
@@ -26,9 +26,6 @@ __exportStar(require("./ErrorCode.js"), exports);
26
26
  __exportStar(require("./ErrorType.js"), exports);
27
27
  __exportStar(require("./GatewayError.js"), exports);
28
28
  __exportStar(require("./InputTokensResponse.js"), exports);
29
- __exportStar(require("./Moment.js"), exports);
30
- __exportStar(require("./MomentAnswer.js"), exports);
31
- __exportStar(require("./MomentQuestion.js"), exports);
32
29
  __exportStar(require("./NoulAnswer.js"), exports);
33
30
  __exportStar(require("./NoulCriteria.js"), exports);
34
31
  __exportStar(require("./NoulQuestion.js"), exports);
@@ -42,3 +39,6 @@ __exportStar(require("./RunSummary.js"), exports);
42
39
  __exportStar(require("./RunsPage.js"), exports);
43
40
  __exportStar(require("./ScoreAnswer.js"), exports);
44
41
  __exportStar(require("./ScoreQuestion.js"), exports);
42
+ __exportStar(require("./Span.js"), exports);
43
+ __exportStar(require("./SpanAnswer.js"), exports);
44
+ __exportStar(require("./SpanQuestion.js"), exports);
@@ -7,8 +7,8 @@ interface ChunkPosition {
7
7
  /** Position of the chunk in the recording, starting at 0. */
8
8
  readonly index: number;
9
9
  /**
10
- * Where the chunk starts in the recording, in milliseconds. A moment's `audioStartMs` and
11
- * `audioEndMs` are measured from the start of the chunk, so add this to place the moment in the
10
+ * Where the chunk starts in the recording, in milliseconds. A span's `audioStartMs` and
11
+ * `audioEndMs` are measured from the start of the chunk, so add this to place the span in the
12
12
  * recording. The first chunk of an MP3 file can start a few tens of milliseconds before 0.
13
13
  */
14
14
  readonly startMs: number;
@@ -2,12 +2,12 @@ import type * as Decisions from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
4
  import { ChoiceAnswer } from "./ChoiceAnswer.js";
5
- import { MomentAnswer } from "./MomentAnswer.js";
6
5
  import { NoulAnswer } from "./NoulAnswer.js";
7
6
  import { ScoreAnswer } from "./ScoreAnswer.js";
7
+ import { SpanAnswer } from "./SpanAnswer.js";
8
8
  export declare const Answer: core.serialization.Schema<serializers.Answer.Raw, Decisions.Answer>;
9
9
  export declare namespace Answer {
10
- type Raw = Answer.Noul | Answer.Choice | Answer.Score | Answer.Moment;
10
+ type Raw = Answer.Noul | Answer.Choice | Answer.Score | Answer.Span;
11
11
  interface Noul extends NoulAnswer.Raw {
12
12
  type: "noul";
13
13
  }
@@ -17,7 +17,7 @@ export declare namespace Answer {
17
17
  interface Score extends ScoreAnswer.Raw {
18
18
  type: "score";
19
19
  }
20
- interface Moment extends MomentAnswer.Raw {
21
- type: "moment";
20
+ interface Span extends SpanAnswer.Raw {
21
+ type: "span";
22
22
  }
23
23
  }
@@ -37,15 +37,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Answer = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
39
  const ChoiceAnswer_js_1 = require("./ChoiceAnswer.js");
40
- const MomentAnswer_js_1 = require("./MomentAnswer.js");
41
40
  const NoulAnswer_js_1 = require("./NoulAnswer.js");
42
41
  const ScoreAnswer_js_1 = require("./ScoreAnswer.js");
42
+ const SpanAnswer_js_1 = require("./SpanAnswer.js");
43
43
  exports.Answer = core.serialization
44
44
  .union("type", {
45
45
  noul: NoulAnswer_js_1.NoulAnswer,
46
46
  choice: ChoiceAnswer_js_1.ChoiceAnswer,
47
47
  score: ScoreAnswer_js_1.ScoreAnswer,
48
- moment: MomentAnswer_js_1.MomentAnswer,
48
+ span: SpanAnswer_js_1.SpanAnswer,
49
49
  })
50
50
  .transform({
51
51
  transform: (value) => value,
@@ -2,12 +2,12 @@ import type * as Decisions from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
4
  import { ChoiceQuestion } from "./ChoiceQuestion.js";
5
- import { MomentQuestion } from "./MomentQuestion.js";
6
5
  import { NoulQuestion } from "./NoulQuestion.js";
7
6
  import { ScoreQuestion } from "./ScoreQuestion.js";
7
+ import { SpanQuestion } from "./SpanQuestion.js";
8
8
  export declare const Question: core.serialization.Schema<serializers.Question.Raw, Decisions.Question>;
9
9
  export declare namespace Question {
10
- type Raw = Question.Noul | Question.Choice | Question.Score | Question.Moment;
10
+ type Raw = Question.Noul | Question.Choice | Question.Score | Question.Span;
11
11
  interface Noul extends NoulQuestion.Raw {
12
12
  type: "noul";
13
13
  }
@@ -17,7 +17,7 @@ export declare namespace Question {
17
17
  interface Score extends ScoreQuestion.Raw {
18
18
  type: "score";
19
19
  }
20
- interface Moment extends MomentQuestion.Raw {
21
- type: "moment";
20
+ interface Span extends SpanQuestion.Raw {
21
+ type: "span";
22
22
  }
23
23
  }
@@ -37,15 +37,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Question = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
39
  const ChoiceQuestion_js_1 = require("./ChoiceQuestion.js");
40
- const MomentQuestion_js_1 = require("./MomentQuestion.js");
41
40
  const NoulQuestion_js_1 = require("./NoulQuestion.js");
42
41
  const ScoreQuestion_js_1 = require("./ScoreQuestion.js");
42
+ const SpanQuestion_js_1 = require("./SpanQuestion.js");
43
43
  exports.Question = core.serialization
44
44
  .union("type", {
45
45
  noul: NoulQuestion_js_1.NoulQuestion,
46
46
  choice: ChoiceQuestion_js_1.ChoiceQuestion,
47
47
  score: ScoreQuestion_js_1.ScoreQuestion,
48
- moment: MomentQuestion_js_1.MomentQuestion,
48
+ span: SpanQuestion_js_1.SpanQuestion,
49
49
  })
50
50
  .transform({
51
51
  transform: (value) => value,
@@ -1,8 +1,8 @@
1
1
  import type * as Decisions from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
- export declare const Moment: core.serialization.ObjectSchema<serializers.Moment.Raw, Decisions.Moment>;
5
- export declare namespace Moment {
4
+ export declare const Span: core.serialization.ObjectSchema<serializers.Span.Raw, Decisions.Span>;
5
+ export declare namespace Span {
6
6
  interface Raw {
7
7
  audio_start_ms: number;
8
8
  audio_end_ms: number;
@@ -34,9 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.Moment = void 0;
37
+ exports.Span = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
- exports.Moment = core.serialization.object({
39
+ exports.Span = core.serialization.object({
40
40
  audioStartMs: core.serialization.property("audio_start_ms", core.serialization.number()),
41
41
  audioEndMs: core.serialization.property("audio_end_ms", core.serialization.number()),
42
42
  probability: core.serialization.number(),
@@ -0,0 +1,10 @@
1
+ import type * as Decisions from "../../api/index.js";
2
+ import * as core from "../../core/index.js";
3
+ import type * as serializers from "../index.js";
4
+ import { Span } from "./Span.js";
5
+ export declare const SpanAnswer: core.serialization.ObjectSchema<serializers.SpanAnswer.Raw, Decisions.SpanAnswer>;
6
+ export declare namespace SpanAnswer {
7
+ interface Raw {
8
+ spans: Span.Raw[];
9
+ }
10
+ }
@@ -34,9 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.MomentAnswer = void 0;
37
+ exports.SpanAnswer = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
- const Moment_js_1 = require("./Moment.js");
40
- exports.MomentAnswer = core.serialization.object({
41
- moments: core.serialization.list(Moment_js_1.Moment),
39
+ const Span_js_1 = require("./Span.js");
40
+ exports.SpanAnswer = core.serialization.object({
41
+ spans: core.serialization.list(Span_js_1.Span),
42
42
  });
@@ -1,8 +1,8 @@
1
1
  import type * as Decisions from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
- export declare const MomentQuestion: core.serialization.ObjectSchema<serializers.MomentQuestion.Raw, Decisions.MomentQuestion>;
5
- export declare namespace MomentQuestion {
4
+ export declare const SpanQuestion: core.serialization.ObjectSchema<serializers.SpanQuestion.Raw, Decisions.SpanQuestion>;
5
+ export declare namespace SpanQuestion {
6
6
  interface Raw {
7
7
  instructions: string;
8
8
  }
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.MomentQuestion = void 0;
37
+ exports.SpanQuestion = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
- exports.MomentQuestion = core.serialization.object({
39
+ exports.SpanQuestion = core.serialization.object({
40
40
  instructions: core.serialization.string(),
41
41
  });
@@ -10,9 +10,6 @@ export * from "./ErrorCode.js";
10
10
  export * from "./ErrorType.js";
11
11
  export * from "./GatewayError.js";
12
12
  export * from "./InputTokensResponse.js";
13
- export * from "./Moment.js";
14
- export * from "./MomentAnswer.js";
15
- export * from "./MomentQuestion.js";
16
13
  export * from "./NoulAnswer.js";
17
14
  export * from "./NoulCriteria.js";
18
15
  export * from "./NoulQuestion.js";
@@ -26,3 +23,6 @@ export * from "./RunSummary.js";
26
23
  export * from "./RunsPage.js";
27
24
  export * from "./ScoreAnswer.js";
28
25
  export * from "./ScoreQuestion.js";
26
+ export * from "./Span.js";
27
+ export * from "./SpanAnswer.js";
28
+ export * from "./SpanQuestion.js";
@@ -26,9 +26,6 @@ __exportStar(require("./ErrorCode.js"), exports);
26
26
  __exportStar(require("./ErrorType.js"), exports);
27
27
  __exportStar(require("./GatewayError.js"), exports);
28
28
  __exportStar(require("./InputTokensResponse.js"), exports);
29
- __exportStar(require("./Moment.js"), exports);
30
- __exportStar(require("./MomentAnswer.js"), exports);
31
- __exportStar(require("./MomentQuestion.js"), exports);
32
29
  __exportStar(require("./NoulAnswer.js"), exports);
33
30
  __exportStar(require("./NoulCriteria.js"), exports);
34
31
  __exportStar(require("./NoulQuestion.js"), exports);
@@ -42,3 +39,6 @@ __exportStar(require("./RunSummary.js"), exports);
42
39
  __exportStar(require("./RunsPage.js"), exports);
43
40
  __exportStar(require("./ScoreAnswer.js"), exports);
44
41
  __exportStar(require("./ScoreQuestion.js"), exports);
42
+ __exportStar(require("./Span.js"), exports);
43
+ __exportStar(require("./SpanAnswer.js"), exports);
44
+ __exportStar(require("./SpanQuestion.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.0";
1
+ export declare const SDK_VERSION = "0.2.0";
@@ -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.1.0";
4
+ exports.SDK_VERSION = "0.2.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@humeai/audio-decisions",
9
- "X-Fern-SDK-Version": "0.1.0",
10
- "User-Agent": "@humeai/audio-decisions/0.1.0",
9
+ "X-Fern-SDK-Version": "0.2.0",
10
+ "User-Agent": "@humeai/audio-decisions/0.2.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -67,7 +67,7 @@ export declare class DecisionsClient {
67
67
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
68
68
  * },
69
69
  * "agent_glitches": {
70
- * type: "moment",
70
+ * type: "span",
71
71
  * instructions: "Where does the agent glitch, slur or sound robotic?"
72
72
  * }
73
73
  * }
@@ -144,7 +144,7 @@ export declare class DecisionsClient {
144
144
  * context: "A clip from a licensed corpus of scripted speech by consenting voice actors, being labeled to train an expressive text-to-speech model.",
145
145
  * questions: {
146
146
  * "vocal_bursts": {
147
- * type: "moment",
147
+ * type: "span",
148
148
  * instructions: "Where does the speaker laugh, sigh, gasp or make another vocal burst?"
149
149
  * }
150
150
  * }
@@ -198,7 +198,7 @@ export declare class DecisionsClient {
198
198
  * criteria: ["Not at all", "2", "3", "4", "Extremely"]
199
199
  * },
200
200
  * "agent_glitches": {
201
- * type: "moment",
201
+ * type: "span",
202
202
  * instructions: "Where does the agent glitch, slur or sound robotic?"
203
203
  * }
204
204
  * }
@@ -209,7 +209,7 @@ export declare class DecisionsClient {
209
209
  /**
210
210
  * Cuts a recording longer than `create` accepts into chunks and sends each chunk to the model in its own `create` request. The recording is never sent as one file. The model processes each chunk independently, hearing only that chunk, so every answer describes its chunk alone and nothing combines the answers across chunks. Each request has its own `runId` and its own billing. Each chunk's result is yielded as soon as its request is done, so it can be saved or reported before the next chunk is sent.
211
211
  *
212
- * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A moment's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
212
+ * The chunks are cut by `iterAudioChunks` in `@humeai/audio-decisions/audio-helpers`, which describes where cuts fall in MP3 and WAV files and how each option works, and are sent one at a time, in order. Each request asks the same questions with the same context. A span's times are measured from the start of its chunk, so add the chunk's `startMs` to place it in the recording.
213
213
  *
214
214
  * The whole recording is read into memory before the first request, so that a file that cannot be split is rejected before anything is sent and billed. A WAV file is mixed down before it is cut, as `downmixStrategy` asks. Each chunk is copied only while its request is sent, so memory use stays near the size of the recording and its mixed-down copy. An hour of 16-bit stereo WAV at 48 kHz is about 690 MB, and about 230 MB once mixed down.
215
215
  *
@@ -230,7 +230,7 @@ export declare class DecisionsClient {
230
230
  * request: {
231
231
  * questions: {
232
232
  * "agent_glitches": {
233
- * type: "moment",
233
+ * type: "span",
234
234
  * instructions: "Where does the agent glitch, slur or sound robotic?"
235
235
  * }
236
236
  * }
@@ -265,7 +265,7 @@ export declare class DecisionsClient {
265
265
  * request: {
266
266
  * questions: {
267
267
  * "agent_glitches": {
268
- * type: "moment",
268
+ * type: "span",
269
269
  * instructions: "Where does the agent glitch, slur or sound robotic?"
270
270
  * }
271
271
  * }