@corti/sdk 0.2.0 → 0.3.0-rc

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 (87) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/facts/client/Client.d.ts +19 -0
  3. package/dist/cjs/api/resources/facts/client/Client.js +87 -0
  4. package/dist/cjs/api/resources/facts/client/requests/FactsExtractRequest.d.ts +19 -0
  5. package/dist/cjs/api/resources/facts/client/requests/FactsExtractRequest.js +5 -0
  6. package/dist/cjs/api/resources/facts/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/transcripts/client/Client.d.ts +2 -2
  8. package/dist/cjs/api/resources/transcripts/client/Client.js +2 -2
  9. package/dist/cjs/api/types/CommonTextContext.d.ts +9 -0
  10. package/dist/cjs/api/types/CommonTextContext.js +5 -0
  11. package/dist/cjs/api/types/CommonUsageInfo.d.ts +3 -0
  12. package/dist/cjs/api/types/DocumentsContext.d.ts +1 -12
  13. package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +2 -0
  14. package/dist/cjs/api/types/DocumentsContextWithString.d.ts +2 -0
  15. package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +2 -0
  16. package/dist/cjs/api/types/FactsExtractResponse.d.ts +11 -0
  17. package/dist/cjs/api/types/FactsExtractResponse.js +5 -0
  18. package/dist/cjs/api/types/FactsExtractResponseFactsItem.d.ts +9 -0
  19. package/dist/cjs/api/types/FactsExtractResponseFactsItem.js +5 -0
  20. package/dist/cjs/api/types/index.d.ts +3 -0
  21. package/dist/cjs/api/types/index.js +3 -0
  22. package/dist/cjs/serialization/resources/facts/client/requests/FactsExtractRequest.d.ts +14 -0
  23. package/dist/cjs/serialization/resources/facts/client/requests/FactsExtractRequest.js +45 -0
  24. package/dist/cjs/serialization/resources/facts/client/requests/index.d.ts +1 -0
  25. package/dist/cjs/serialization/resources/facts/client/requests/index.js +3 -1
  26. package/dist/cjs/serialization/types/CommonTextContext.d.ts +13 -0
  27. package/dist/cjs/serialization/types/CommonTextContext.js +44 -0
  28. package/dist/cjs/serialization/types/DocumentsContext.d.ts +1 -10
  29. package/dist/cjs/serialization/types/DocumentsContext.js +5 -10
  30. package/dist/cjs/serialization/types/DocumentsContextWithFacts.d.ts +1 -0
  31. package/dist/cjs/serialization/types/DocumentsContextWithFacts.js +1 -0
  32. package/dist/cjs/serialization/types/DocumentsContextWithString.d.ts +1 -0
  33. package/dist/cjs/serialization/types/DocumentsContextWithString.js +1 -0
  34. package/dist/cjs/serialization/types/DocumentsContextWithTranscript.d.ts +1 -0
  35. package/dist/cjs/serialization/types/DocumentsContextWithTranscript.js +1 -0
  36. package/dist/cjs/serialization/types/FactsExtractResponse.d.ts +16 -0
  37. package/dist/cjs/serialization/types/FactsExtractResponse.js +47 -0
  38. package/dist/cjs/serialization/types/FactsExtractResponseFactsItem.d.ts +13 -0
  39. package/dist/cjs/serialization/types/FactsExtractResponseFactsItem.js +44 -0
  40. package/dist/cjs/serialization/types/index.d.ts +3 -0
  41. package/dist/cjs/serialization/types/index.js +3 -0
  42. package/dist/cjs/version.d.ts +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/esm/Client.mjs +2 -2
  45. package/dist/esm/api/resources/facts/client/Client.d.mts +19 -0
  46. package/dist/esm/api/resources/facts/client/Client.mjs +87 -0
  47. package/dist/esm/api/resources/facts/client/requests/FactsExtractRequest.d.mts +19 -0
  48. package/dist/esm/api/resources/facts/client/requests/FactsExtractRequest.mjs +4 -0
  49. package/dist/esm/api/resources/facts/client/requests/index.d.mts +1 -0
  50. package/dist/esm/api/resources/transcripts/client/Client.d.mts +2 -2
  51. package/dist/esm/api/resources/transcripts/client/Client.mjs +2 -2
  52. package/dist/esm/api/types/CommonTextContext.d.mts +9 -0
  53. package/dist/esm/api/types/CommonTextContext.mjs +4 -0
  54. package/dist/esm/api/types/CommonUsageInfo.d.mts +3 -0
  55. package/dist/esm/api/types/DocumentsContext.d.mts +1 -12
  56. package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +2 -0
  57. package/dist/esm/api/types/DocumentsContextWithString.d.mts +2 -0
  58. package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +2 -0
  59. package/dist/esm/api/types/FactsExtractResponse.d.mts +11 -0
  60. package/dist/esm/api/types/FactsExtractResponse.mjs +4 -0
  61. package/dist/esm/api/types/FactsExtractResponseFactsItem.d.mts +9 -0
  62. package/dist/esm/api/types/FactsExtractResponseFactsItem.mjs +4 -0
  63. package/dist/esm/api/types/index.d.mts +3 -0
  64. package/dist/esm/api/types/index.mjs +3 -0
  65. package/dist/esm/serialization/resources/facts/client/requests/FactsExtractRequest.d.mts +14 -0
  66. package/dist/esm/serialization/resources/facts/client/requests/FactsExtractRequest.mjs +9 -0
  67. package/dist/esm/serialization/resources/facts/client/requests/index.d.mts +1 -0
  68. package/dist/esm/serialization/resources/facts/client/requests/index.mjs +1 -0
  69. package/dist/esm/serialization/types/CommonTextContext.d.mts +13 -0
  70. package/dist/esm/serialization/types/CommonTextContext.mjs +8 -0
  71. package/dist/esm/serialization/types/DocumentsContext.d.mts +1 -10
  72. package/dist/esm/serialization/types/DocumentsContext.mjs +5 -10
  73. package/dist/esm/serialization/types/DocumentsContextWithFacts.d.mts +1 -0
  74. package/dist/esm/serialization/types/DocumentsContextWithFacts.mjs +1 -0
  75. package/dist/esm/serialization/types/DocumentsContextWithString.d.mts +1 -0
  76. package/dist/esm/serialization/types/DocumentsContextWithString.mjs +1 -0
  77. package/dist/esm/serialization/types/DocumentsContextWithTranscript.d.mts +1 -0
  78. package/dist/esm/serialization/types/DocumentsContextWithTranscript.mjs +1 -0
  79. package/dist/esm/serialization/types/FactsExtractResponse.d.mts +16 -0
  80. package/dist/esm/serialization/types/FactsExtractResponse.mjs +11 -0
  81. package/dist/esm/serialization/types/FactsExtractResponseFactsItem.d.mts +13 -0
  82. package/dist/esm/serialization/types/FactsExtractResponseFactsItem.mjs +8 -0
  83. package/dist/esm/serialization/types/index.d.mts +3 -0
  84. package/dist/esm/serialization/types/index.mjs +3 -0
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/package.json +1 -1
@@ -63,8 +63,8 @@ class CortiClient {
63
63
  "Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
64
64
  "X-Fern-Language": "JavaScript",
65
65
  "X-Fern-SDK-Name": "@corti/sdk",
66
- "X-Fern-SDK-Version": "0.2.0",
67
- "User-Agent": "@corti/sdk/0.2.0",
66
+ "X-Fern-SDK-Version": "0.3.0-rc",
67
+ "User-Agent": "@corti/sdk/0.3.0-rc",
68
68
  "X-Fern-Runtime": core.RUNTIME.type,
69
69
  "X-Fern-Runtime-Version": core.RUNTIME.version,
70
70
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -108,5 +108,24 @@ export declare class Facts {
108
108
  */
109
109
  update(id: Corti.Uuid, factId: Corti.Uuid, request?: Corti.FactsUpdateRequest, requestOptions?: Facts.RequestOptions): core.HttpResponsePromise<Corti.FactsUpdateResponse>;
110
110
  private __update;
111
+ /**
112
+ * Extract facts from provided text, without storing them.
113
+ *
114
+ * @param {Corti.FactsExtractRequest} request
115
+ * @param {Facts.RequestOptions} requestOptions - Request-specific configuration.
116
+ *
117
+ * @throws {@link Corti.GatewayTimeoutError}
118
+ *
119
+ * @example
120
+ * await client.facts.extract({
121
+ * context: [{
122
+ * type: "text",
123
+ * text: "text"
124
+ * }],
125
+ * outputLanguage: "outputLanguage"
126
+ * })
127
+ */
128
+ extract(request: Corti.FactsExtractRequest, requestOptions?: Facts.RequestOptions): core.HttpResponsePromise<Corti.FactsExtractResponse>;
129
+ private __extract;
111
130
  protected _getAuthorizationHeader(): Promise<string | undefined>;
112
131
  }
@@ -454,6 +454,93 @@ class Facts {
454
454
  }
455
455
  });
456
456
  }
457
+ /**
458
+ * Extract facts from provided text, without storing them.
459
+ *
460
+ * @param {Corti.FactsExtractRequest} request
461
+ * @param {Facts.RequestOptions} requestOptions - Request-specific configuration.
462
+ *
463
+ * @throws {@link Corti.GatewayTimeoutError}
464
+ *
465
+ * @example
466
+ * await client.facts.extract({
467
+ * context: [{
468
+ * type: "text",
469
+ * text: "text"
470
+ * }],
471
+ * outputLanguage: "outputLanguage"
472
+ * })
473
+ */
474
+ extract(request, requestOptions) {
475
+ return core.HttpResponsePromise.fromPromise(this.__extract(request, requestOptions));
476
+ }
477
+ __extract(request, requestOptions) {
478
+ return __awaiter(this, void 0, void 0, function* () {
479
+ var _a, _b;
480
+ const _response = yield core.fetcher({
481
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).base, "tools/extract-facts"),
482
+ method: "POST",
483
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
484
+ Authorization: yield this._getAuthorizationHeader(),
485
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
486
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
487
+ contentType: "application/json",
488
+ requestType: "json",
489
+ body: serializers.FactsExtractRequest.jsonOrThrow(request, {
490
+ unrecognizedObjectKeys: "strip",
491
+ omitUndefined: true,
492
+ }),
493
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
494
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
495
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
496
+ });
497
+ if (_response.ok) {
498
+ return {
499
+ data: serializers.FactsExtractResponse.parseOrThrow(_response.body, {
500
+ unrecognizedObjectKeys: "passthrough",
501
+ allowUnrecognizedUnionMembers: true,
502
+ allowUnrecognizedEnumValues: true,
503
+ skipValidation: true,
504
+ breadcrumbsPrefix: ["response"],
505
+ }),
506
+ rawResponse: _response.rawResponse,
507
+ };
508
+ }
509
+ if (_response.error.reason === "status-code") {
510
+ switch (_response.error.statusCode) {
511
+ case 504:
512
+ throw new Corti.GatewayTimeoutError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
513
+ unrecognizedObjectKeys: "passthrough",
514
+ allowUnrecognizedUnionMembers: true,
515
+ allowUnrecognizedEnumValues: true,
516
+ skipValidation: true,
517
+ breadcrumbsPrefix: ["response"],
518
+ }), _response.rawResponse);
519
+ default:
520
+ throw new errors.CortiError({
521
+ statusCode: _response.error.statusCode,
522
+ body: _response.error.body,
523
+ rawResponse: _response.rawResponse,
524
+ });
525
+ }
526
+ }
527
+ switch (_response.error.reason) {
528
+ case "non-json":
529
+ throw new errors.CortiError({
530
+ statusCode: _response.error.statusCode,
531
+ body: _response.error.rawBody,
532
+ rawResponse: _response.rawResponse,
533
+ });
534
+ case "timeout":
535
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /tools/extract-facts.");
536
+ case "unknown":
537
+ throw new errors.CortiError({
538
+ message: _response.error.errorMessage,
539
+ rawResponse: _response.rawResponse,
540
+ });
541
+ }
542
+ });
543
+ }
457
544
  _getAuthorizationHeader() {
458
545
  return __awaiter(this, void 0, void 0, function* () {
459
546
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * context: [{
9
+ * type: "text",
10
+ * text: "text"
11
+ * }],
12
+ * outputLanguage: "outputLanguage"
13
+ * }
14
+ */
15
+ export interface FactsExtractRequest {
16
+ context: Corti.CommonTextContext[];
17
+ /** The desired output language code for extracted facts. Check [languages page](/about/languages) for more. */
18
+ outputLanguage: string;
19
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export { type FactsCreateRequest } from "./FactsCreateRequest.js";
2
2
  export { type FactsBatchUpdateRequest } from "./FactsBatchUpdateRequest.js";
3
3
  export { type FactsUpdateRequest } from "./FactsUpdateRequest.js";
4
+ export { type FactsExtractRequest } from "./FactsExtractRequest.js";
@@ -50,7 +50,7 @@ export declare class Transcripts {
50
50
  list(id: Corti.Uuid, request?: Corti.TranscriptsListRequest, requestOptions?: Transcripts.RequestOptions): core.HttpResponsePromise<Corti.TranscriptsListResponse>;
51
51
  private __list;
52
52
  /**
53
- * Creates a new transcript for an interaction.
53
+ * Create a transcript from an audio file attached, via `/recordings` endpoint, to the interaction.<br/><Note>Each interaction may have more than one audio file and transcript associated with it. While audio files up to 60min in total duration, or 150MB in total size, may be attached to an interaction, synchronous processing is only supported for audio files less than ~2min in duration.<br/><br/>If an audio file takes longer to transcribe than the 25sec synchronous processing timeout, then it will continue to process asynchronously. In this scenario, an empty transcript will be returned with a location header that can be used to retrieve the final transcript.<br/><br/>The client can poll the Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/status`) for transcript status changes:<br/>- `200 OK` with status `processing`, `completed`, or `failed`<br/>- `404 Not Found` if the `interactionId` or `transcriptId` are invalid<br/><br/>The completed transcript can be retrieved via the Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/`).</Note>
54
54
  *
55
55
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
56
56
  * @param {Corti.TranscriptsCreateRequest} request
@@ -71,7 +71,7 @@ export declare class Transcripts {
71
71
  create(id: Corti.Uuid, request: Corti.TranscriptsCreateRequest, requestOptions?: Transcripts.RequestOptions): core.HttpResponsePromise<Corti.TranscriptsResponse>;
72
72
  private __create;
73
73
  /**
74
- * Retrieves the transcript for a specific interaction.
74
+ * Retrieve a transcript from a specific interaction.<br/><Note>Each interaction may have more than one transcript associated with it. Use the List Transcript request (`GET /interactions/{id}/transcripts/`) to see all transcriptIds available for the interaction.<br/><br/>The client can poll this Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/status`) for transcript status changes:<br/>- `200 OK` with status `processing`, `completed`, or `failed`<br/>- `404 Not Found` if the `interactionId` or `transcriptId` are invalid<br/><br/>Status of `completed` indicates the transcript is finalized. If the transcript is retrieved while status is `processing`, then it will be incomplete.</Note>
75
75
  *
76
76
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
77
77
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -156,7 +156,7 @@ class Transcripts {
156
156
  });
157
157
  }
158
158
  /**
159
- * Creates a new transcript for an interaction.
159
+ * Create a transcript from an audio file attached, via `/recordings` endpoint, to the interaction.<br/><Note>Each interaction may have more than one audio file and transcript associated with it. While audio files up to 60min in total duration, or 150MB in total size, may be attached to an interaction, synchronous processing is only supported for audio files less than ~2min in duration.<br/><br/>If an audio file takes longer to transcribe than the 25sec synchronous processing timeout, then it will continue to process asynchronously. In this scenario, an empty transcript will be returned with a location header that can be used to retrieve the final transcript.<br/><br/>The client can poll the Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/status`) for transcript status changes:<br/>- `200 OK` with status `processing`, `completed`, or `failed`<br/>- `404 Not Found` if the `interactionId` or `transcriptId` are invalid<br/><br/>The completed transcript can be retrieved via the Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/`).</Note>
160
160
  *
161
161
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
162
162
  * @param {Corti.TranscriptsCreateRequest} request
@@ -259,7 +259,7 @@ class Transcripts {
259
259
  });
260
260
  }
261
261
  /**
262
- * Retrieves the transcript for a specific interaction.
262
+ * Retrieve a transcript from a specific interaction.<br/><Note>Each interaction may have more than one transcript associated with it. Use the List Transcript request (`GET /interactions/{id}/transcripts/`) to see all transcriptIds available for the interaction.<br/><br/>The client can poll this Get Transcript endpoint (`GET /interactions/{id}/transcripts/{transcriptId}/status`) for transcript status changes:<br/>- `200 OK` with status `processing`, `completed`, or `failed`<br/>- `404 Not Found` if the `interactionId` or `transcriptId` are invalid<br/><br/>Status of `completed` indicates the transcript is finalized. If the transcript is retrieved while status is `processing`, then it will be incomplete.</Note>
263
263
  *
264
264
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
265
265
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CommonTextContext {
5
+ /** The type of context, always "text" in this context. */
6
+ type: "text";
7
+ /** A text string to be used as input to the model. */
8
+ text: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * Credits consumed for this request.
6
+ */
4
7
  export interface CommonUsageInfo {
5
8
  creditsConsumed: number;
6
9
  }
@@ -2,15 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export type DocumentsContext = Corti.DocumentsContext.Facts | Corti.DocumentsContext.Transcript | Corti.DocumentsContext.String;
6
- export declare namespace DocumentsContext {
7
- interface Facts extends Corti.DocumentsContextWithFacts {
8
- type: "facts";
9
- }
10
- interface Transcript extends Corti.DocumentsContextWithTranscript {
11
- type: "transcript";
12
- }
13
- interface String extends Corti.DocumentsContextWithString {
14
- type: "string";
15
- }
16
- }
5
+ export type DocumentsContext = Corti.DocumentsContextWithFacts | Corti.DocumentsContextWithTranscript | Corti.DocumentsContextWithString;
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface DocumentsContextWithFacts {
6
+ /** The type of context data that will be used in the request: `Facts`, `Transcript`, or `String`. */
7
+ type: "facts";
6
8
  /** An array of facts. */
7
9
  data: Corti.FactsContext[];
8
10
  }
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface DocumentsContextWithString {
5
+ /** The type of context data that will be used in the request: `Facts`, `Transcript`, or `String`. */
6
+ type: "string";
5
7
  /** String data can include any text to be reasoned over for document generation: Transcript text, facts, or other narrative information. */
6
8
  data: string;
7
9
  }
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface DocumentsContextWithTranscript {
6
+ /** The type of context data that will be used in the request: `Facts`, `Transcript`, or `String`. */
7
+ type: "transcript";
6
8
  /** Transcript object can accept the full transcript in one string, or individual transcript segments. */
7
9
  data: Corti.CommonTranscriptRequest;
8
10
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../index.js";
5
+ export interface FactsExtractResponse {
6
+ /** List of extracted facts based on the provided input context. */
7
+ facts: Corti.FactsExtractResponseFactsItem[];
8
+ /** The language locale of the output. */
9
+ outputLanguage: string;
10
+ usageInfo: Corti.CommonUsageInfo;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface FactsExtractResponseFactsItem {
5
+ /** The fact group key the fact belongs to. */
6
+ group: string;
7
+ /** An individual, atomic fact. */
8
+ value: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -18,6 +18,7 @@ export * from "./DocumentsCreateRequest.js";
18
18
  export * from "./DocumentsCreateRequestWithTemplateKey.js";
19
19
  export * from "./DocumentsCreateRequestWithTemplate.js";
20
20
  export * from "./DocumentsSectionInput.js";
21
+ export * from "./CommonTextContext.js";
21
22
  export * from "./FactsCreateInput.js";
22
23
  export * from "./FactsBatchUpdateInput.js";
23
24
  export * from "./TranscriptsParticipant.js";
@@ -34,6 +35,8 @@ export * from "./FactsCreateResponse.js";
34
35
  export * from "./FactsListResponse.js";
35
36
  export * from "./FactsBatchUpdateResponse.js";
36
37
  export * from "./FactsBatchUpdateItem.js";
38
+ export * from "./FactsExtractResponseFactsItem.js";
39
+ export * from "./FactsExtractResponse.js";
37
40
  export * from "./InteractionsGetResponse.js";
38
41
  export * from "./InteractionsCreateResponse.js";
39
42
  export * from "./InteractionsListResponse.js";
@@ -34,6 +34,7 @@ __exportStar(require("./DocumentsCreateRequest.js"), exports);
34
34
  __exportStar(require("./DocumentsCreateRequestWithTemplateKey.js"), exports);
35
35
  __exportStar(require("./DocumentsCreateRequestWithTemplate.js"), exports);
36
36
  __exportStar(require("./DocumentsSectionInput.js"), exports);
37
+ __exportStar(require("./CommonTextContext.js"), exports);
37
38
  __exportStar(require("./FactsCreateInput.js"), exports);
38
39
  __exportStar(require("./FactsBatchUpdateInput.js"), exports);
39
40
  __exportStar(require("./TranscriptsParticipant.js"), exports);
@@ -50,6 +51,8 @@ __exportStar(require("./FactsCreateResponse.js"), exports);
50
51
  __exportStar(require("./FactsListResponse.js"), exports);
51
52
  __exportStar(require("./FactsBatchUpdateResponse.js"), exports);
52
53
  __exportStar(require("./FactsBatchUpdateItem.js"), exports);
54
+ __exportStar(require("./FactsExtractResponseFactsItem.js"), exports);
55
+ __exportStar(require("./FactsExtractResponse.js"), exports);
53
56
  __exportStar(require("./InteractionsGetResponse.js"), exports);
54
57
  __exportStar(require("./InteractionsCreateResponse.js"), exports);
55
58
  __exportStar(require("./InteractionsListResponse.js"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../index.js";
5
+ import * as Corti from "../../../../../api/index.js";
6
+ import * as core from "../../../../../core/index.js";
7
+ import { CommonTextContext } from "../../../../types/CommonTextContext.js";
8
+ export declare const FactsExtractRequest: core.serialization.Schema<serializers.FactsExtractRequest.Raw, Corti.FactsExtractRequest>;
9
+ export declare namespace FactsExtractRequest {
10
+ interface Raw {
11
+ context: CommonTextContext.Raw[];
12
+ outputLanguage: string;
13
+ }
14
+ }
@@ -0,0 +1,45 @@
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.FactsExtractRequest = void 0;
40
+ const core = __importStar(require("../../../../../core/index.js"));
41
+ const CommonTextContext_js_1 = require("../../../../types/CommonTextContext.js");
42
+ exports.FactsExtractRequest = core.serialization.object({
43
+ context: core.serialization.list(CommonTextContext_js_1.CommonTextContext),
44
+ outputLanguage: core.serialization.string(),
45
+ });
@@ -1,3 +1,4 @@
1
1
  export { FactsCreateRequest } from "./FactsCreateRequest.js";
2
2
  export { FactsBatchUpdateRequest } from "./FactsBatchUpdateRequest.js";
3
3
  export { FactsUpdateRequest } from "./FactsUpdateRequest.js";
4
+ export { FactsExtractRequest } from "./FactsExtractRequest.js";
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FactsUpdateRequest = exports.FactsBatchUpdateRequest = exports.FactsCreateRequest = void 0;
3
+ exports.FactsExtractRequest = exports.FactsUpdateRequest = exports.FactsBatchUpdateRequest = exports.FactsCreateRequest = void 0;
4
4
  var FactsCreateRequest_js_1 = require("./FactsCreateRequest.js");
5
5
  Object.defineProperty(exports, "FactsCreateRequest", { enumerable: true, get: function () { return FactsCreateRequest_js_1.FactsCreateRequest; } });
6
6
  var FactsBatchUpdateRequest_js_1 = require("./FactsBatchUpdateRequest.js");
7
7
  Object.defineProperty(exports, "FactsBatchUpdateRequest", { enumerable: true, get: function () { return FactsBatchUpdateRequest_js_1.FactsBatchUpdateRequest; } });
8
8
  var FactsUpdateRequest_js_1 = require("./FactsUpdateRequest.js");
9
9
  Object.defineProperty(exports, "FactsUpdateRequest", { enumerable: true, get: function () { return FactsUpdateRequest_js_1.FactsUpdateRequest; } });
10
+ var FactsExtractRequest_js_1 = require("./FactsExtractRequest.js");
11
+ Object.defineProperty(exports, "FactsExtractRequest", { enumerable: true, get: function () { return FactsExtractRequest_js_1.FactsExtractRequest; } });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index.js";
5
+ import * as Corti from "../../api/index.js";
6
+ import * as core from "../../core/index.js";
7
+ export declare const CommonTextContext: core.serialization.ObjectSchema<serializers.CommonTextContext.Raw, Corti.CommonTextContext>;
8
+ export declare namespace CommonTextContext {
9
+ interface Raw {
10
+ type: "text";
11
+ text: string;
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.CommonTextContext = void 0;
40
+ const core = __importStar(require("../../core/index.js"));
41
+ exports.CommonTextContext = core.serialization.object({
42
+ type: core.serialization.stringLiteral("text"),
43
+ text: core.serialization.string(),
44
+ });
@@ -9,14 +9,5 @@ import { DocumentsContextWithTranscript } from "./DocumentsContextWithTranscript
9
9
  import { DocumentsContextWithString } from "./DocumentsContextWithString.js";
10
10
  export declare const DocumentsContext: core.serialization.Schema<serializers.DocumentsContext.Raw, Corti.DocumentsContext>;
11
11
  export declare namespace DocumentsContext {
12
- type Raw = DocumentsContext.Facts | DocumentsContext.Transcript | DocumentsContext.String;
13
- interface Facts extends DocumentsContextWithFacts.Raw {
14
- type: "facts";
15
- }
16
- interface Transcript extends DocumentsContextWithTranscript.Raw {
17
- type: "transcript";
18
- }
19
- interface String extends DocumentsContextWithString.Raw {
20
- type: "string";
21
- }
12
+ type Raw = DocumentsContextWithFacts.Raw | DocumentsContextWithTranscript.Raw | DocumentsContextWithString.Raw;
22
13
  }
@@ -41,13 +41,8 @@ const core = __importStar(require("../../core/index.js"));
41
41
  const DocumentsContextWithFacts_js_1 = require("./DocumentsContextWithFacts.js");
42
42
  const DocumentsContextWithTranscript_js_1 = require("./DocumentsContextWithTranscript.js");
43
43
  const DocumentsContextWithString_js_1 = require("./DocumentsContextWithString.js");
44
- exports.DocumentsContext = core.serialization
45
- .union("type", {
46
- facts: DocumentsContextWithFacts_js_1.DocumentsContextWithFacts,
47
- transcript: DocumentsContextWithTranscript_js_1.DocumentsContextWithTranscript,
48
- string: DocumentsContextWithString_js_1.DocumentsContextWithString,
49
- })
50
- .transform({
51
- transform: (value) => value,
52
- untransform: (value) => value,
53
- });
44
+ exports.DocumentsContext = core.serialization.undiscriminatedUnion([
45
+ DocumentsContextWithFacts_js_1.DocumentsContextWithFacts,
46
+ DocumentsContextWithTranscript_js_1.DocumentsContextWithTranscript,
47
+ DocumentsContextWithString_js_1.DocumentsContextWithString,
48
+ ]);
@@ -8,6 +8,7 @@ import { FactsContext } from "./FactsContext.js";
8
8
  export declare const DocumentsContextWithFacts: core.serialization.ObjectSchema<serializers.DocumentsContextWithFacts.Raw, Corti.DocumentsContextWithFacts>;
9
9
  export declare namespace DocumentsContextWithFacts {
10
10
  interface Raw {
11
+ type: "facts";
11
12
  data: FactsContext.Raw[];
12
13
  }
13
14
  }
@@ -40,5 +40,6 @@ exports.DocumentsContextWithFacts = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const FactsContext_js_1 = require("./FactsContext.js");
42
42
  exports.DocumentsContextWithFacts = core.serialization.object({
43
+ type: core.serialization.stringLiteral("facts"),
43
44
  data: core.serialization.list(FactsContext_js_1.FactsContext),
44
45
  });
@@ -7,6 +7,7 @@ import * as core from "../../core/index.js";
7
7
  export declare const DocumentsContextWithString: core.serialization.ObjectSchema<serializers.DocumentsContextWithString.Raw, Corti.DocumentsContextWithString>;
8
8
  export declare namespace DocumentsContextWithString {
9
9
  interface Raw {
10
+ type: "string";
10
11
  data: string;
11
12
  }
12
13
  }
@@ -39,5 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.DocumentsContextWithString = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  exports.DocumentsContextWithString = core.serialization.object({
42
+ type: core.serialization.stringLiteral("string"),
42
43
  data: core.serialization.string(),
43
44
  });
@@ -8,6 +8,7 @@ import { CommonTranscriptRequest } from "./CommonTranscriptRequest.js";
8
8
  export declare const DocumentsContextWithTranscript: core.serialization.ObjectSchema<serializers.DocumentsContextWithTranscript.Raw, Corti.DocumentsContextWithTranscript>;
9
9
  export declare namespace DocumentsContextWithTranscript {
10
10
  interface Raw {
11
+ type: "transcript";
11
12
  data: CommonTranscriptRequest.Raw;
12
13
  }
13
14
  }
@@ -40,5 +40,6 @@ exports.DocumentsContextWithTranscript = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const CommonTranscriptRequest_js_1 = require("./CommonTranscriptRequest.js");
42
42
  exports.DocumentsContextWithTranscript = core.serialization.object({
43
+ type: core.serialization.stringLiteral("transcript"),
43
44
  data: CommonTranscriptRequest_js_1.CommonTranscriptRequest,
44
45
  });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index.js";
5
+ import * as Corti from "../../api/index.js";
6
+ import * as core from "../../core/index.js";
7
+ import { FactsExtractResponseFactsItem } from "./FactsExtractResponseFactsItem.js";
8
+ import { CommonUsageInfo } from "./CommonUsageInfo.js";
9
+ export declare const FactsExtractResponse: core.serialization.ObjectSchema<serializers.FactsExtractResponse.Raw, Corti.FactsExtractResponse>;
10
+ export declare namespace FactsExtractResponse {
11
+ interface Raw {
12
+ facts: FactsExtractResponseFactsItem.Raw[];
13
+ outputLanguage: string;
14
+ usageInfo: CommonUsageInfo.Raw;
15
+ }
16
+ }