@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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/facts/client/Client.d.ts +19 -0
- package/dist/cjs/api/resources/facts/client/Client.js +87 -0
- package/dist/cjs/api/resources/facts/client/requests/FactsExtractRequest.d.ts +19 -0
- package/dist/cjs/api/resources/facts/client/requests/FactsExtractRequest.js +5 -0
- package/dist/cjs/api/resources/facts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/transcripts/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/transcripts/client/Client.js +2 -2
- package/dist/cjs/api/types/CommonTextContext.d.ts +9 -0
- package/dist/cjs/api/types/CommonTextContext.js +5 -0
- package/dist/cjs/api/types/CommonUsageInfo.d.ts +3 -0
- package/dist/cjs/api/types/DocumentsContext.d.ts +1 -12
- package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +2 -0
- package/dist/cjs/api/types/DocumentsContextWithString.d.ts +2 -0
- package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +2 -0
- package/dist/cjs/api/types/FactsExtractResponse.d.ts +11 -0
- package/dist/cjs/api/types/FactsExtractResponse.js +5 -0
- package/dist/cjs/api/types/FactsExtractResponseFactsItem.d.ts +9 -0
- package/dist/cjs/api/types/FactsExtractResponseFactsItem.js +5 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/serialization/resources/facts/client/requests/FactsExtractRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/facts/client/requests/FactsExtractRequest.js +45 -0
- package/dist/cjs/serialization/resources/facts/client/requests/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/facts/client/requests/index.js +3 -1
- package/dist/cjs/serialization/types/CommonTextContext.d.ts +13 -0
- package/dist/cjs/serialization/types/CommonTextContext.js +44 -0
- package/dist/cjs/serialization/types/DocumentsContext.d.ts +1 -10
- package/dist/cjs/serialization/types/DocumentsContext.js +5 -10
- package/dist/cjs/serialization/types/DocumentsContextWithFacts.d.ts +1 -0
- package/dist/cjs/serialization/types/DocumentsContextWithFacts.js +1 -0
- package/dist/cjs/serialization/types/DocumentsContextWithString.d.ts +1 -0
- package/dist/cjs/serialization/types/DocumentsContextWithString.js +1 -0
- package/dist/cjs/serialization/types/DocumentsContextWithTranscript.d.ts +1 -0
- package/dist/cjs/serialization/types/DocumentsContextWithTranscript.js +1 -0
- package/dist/cjs/serialization/types/FactsExtractResponse.d.ts +16 -0
- package/dist/cjs/serialization/types/FactsExtractResponse.js +47 -0
- package/dist/cjs/serialization/types/FactsExtractResponseFactsItem.d.ts +13 -0
- package/dist/cjs/serialization/types/FactsExtractResponseFactsItem.js +44 -0
- package/dist/cjs/serialization/types/index.d.ts +3 -0
- package/dist/cjs/serialization/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/facts/client/Client.d.mts +19 -0
- package/dist/esm/api/resources/facts/client/Client.mjs +87 -0
- package/dist/esm/api/resources/facts/client/requests/FactsExtractRequest.d.mts +19 -0
- package/dist/esm/api/resources/facts/client/requests/FactsExtractRequest.mjs +4 -0
- package/dist/esm/api/resources/facts/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/transcripts/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/transcripts/client/Client.mjs +2 -2
- package/dist/esm/api/types/CommonTextContext.d.mts +9 -0
- package/dist/esm/api/types/CommonTextContext.mjs +4 -0
- package/dist/esm/api/types/CommonUsageInfo.d.mts +3 -0
- package/dist/esm/api/types/DocumentsContext.d.mts +1 -12
- package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +2 -0
- package/dist/esm/api/types/DocumentsContextWithString.d.mts +2 -0
- package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +2 -0
- package/dist/esm/api/types/FactsExtractResponse.d.mts +11 -0
- package/dist/esm/api/types/FactsExtractResponse.mjs +4 -0
- package/dist/esm/api/types/FactsExtractResponseFactsItem.d.mts +9 -0
- package/dist/esm/api/types/FactsExtractResponseFactsItem.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/facts/client/requests/FactsExtractRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/facts/client/requests/FactsExtractRequest.mjs +9 -0
- package/dist/esm/serialization/resources/facts/client/requests/index.d.mts +1 -0
- package/dist/esm/serialization/resources/facts/client/requests/index.mjs +1 -0
- package/dist/esm/serialization/types/CommonTextContext.d.mts +13 -0
- package/dist/esm/serialization/types/CommonTextContext.mjs +8 -0
- package/dist/esm/serialization/types/DocumentsContext.d.mts +1 -10
- package/dist/esm/serialization/types/DocumentsContext.mjs +5 -10
- package/dist/esm/serialization/types/DocumentsContextWithFacts.d.mts +1 -0
- package/dist/esm/serialization/types/DocumentsContextWithFacts.mjs +1 -0
- package/dist/esm/serialization/types/DocumentsContextWithString.d.mts +1 -0
- package/dist/esm/serialization/types/DocumentsContextWithString.mjs +1 -0
- package/dist/esm/serialization/types/DocumentsContextWithTranscript.d.mts +1 -0
- package/dist/esm/serialization/types/DocumentsContextWithTranscript.mjs +1 -0
- package/dist/esm/serialization/types/FactsExtractResponse.d.mts +16 -0
- package/dist/esm/serialization/types/FactsExtractResponse.mjs +11 -0
- package/dist/esm/serialization/types/FactsExtractResponseFactsItem.d.mts +13 -0
- package/dist/esm/serialization/types/FactsExtractResponseFactsItem.mjs +8 -0
- package/dist/esm/serialization/types/index.d.mts +3 -0
- package/dist/esm/serialization/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
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.FactsExtractResponse = void 0;
|
|
40
|
+
const core = __importStar(require("../../core/index.js"));
|
|
41
|
+
const FactsExtractResponseFactsItem_js_1 = require("./FactsExtractResponseFactsItem.js");
|
|
42
|
+
const CommonUsageInfo_js_1 = require("./CommonUsageInfo.js");
|
|
43
|
+
exports.FactsExtractResponse = core.serialization.object({
|
|
44
|
+
facts: core.serialization.list(FactsExtractResponseFactsItem_js_1.FactsExtractResponseFactsItem),
|
|
45
|
+
outputLanguage: core.serialization.string(),
|
|
46
|
+
usageInfo: CommonUsageInfo_js_1.CommonUsageInfo,
|
|
47
|
+
});
|
|
@@ -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 FactsExtractResponseFactsItem: core.serialization.ObjectSchema<serializers.FactsExtractResponseFactsItem.Raw, Corti.FactsExtractResponseFactsItem>;
|
|
8
|
+
export declare namespace FactsExtractResponseFactsItem {
|
|
9
|
+
interface Raw {
|
|
10
|
+
group: string;
|
|
11
|
+
value: 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.FactsExtractResponseFactsItem = void 0;
|
|
40
|
+
const core = __importStar(require("../../core/index.js"));
|
|
41
|
+
exports.FactsExtractResponseFactsItem = core.serialization.object({
|
|
42
|
+
group: core.serialization.string(),
|
|
43
|
+
value: core.serialization.string(),
|
|
44
|
+
});
|
|
@@ -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);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.3.0-rc";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -27,8 +27,8 @@ export class CortiClient {
|
|
|
27
27
|
"Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
|
|
28
28
|
"X-Fern-Language": "JavaScript",
|
|
29
29
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
30
|
-
"X-Fern-SDK-Version": "0.
|
|
31
|
-
"User-Agent": "@corti/sdk/0.
|
|
30
|
+
"X-Fern-SDK-Version": "0.3.0-rc",
|
|
31
|
+
"User-Agent": "@corti/sdk/0.3.0-rc",
|
|
32
32
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
33
33
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
34
34
|
}, _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
|
}
|
|
@@ -418,6 +418,93 @@ export class Facts {
|
|
|
418
418
|
}
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Extract facts from provided text, without storing them.
|
|
423
|
+
*
|
|
424
|
+
* @param {Corti.FactsExtractRequest} request
|
|
425
|
+
* @param {Facts.RequestOptions} requestOptions - Request-specific configuration.
|
|
426
|
+
*
|
|
427
|
+
* @throws {@link Corti.GatewayTimeoutError}
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* await client.facts.extract({
|
|
431
|
+
* context: [{
|
|
432
|
+
* type: "text",
|
|
433
|
+
* text: "text"
|
|
434
|
+
* }],
|
|
435
|
+
* outputLanguage: "outputLanguage"
|
|
436
|
+
* })
|
|
437
|
+
*/
|
|
438
|
+
extract(request, requestOptions) {
|
|
439
|
+
return core.HttpResponsePromise.fromPromise(this.__extract(request, requestOptions));
|
|
440
|
+
}
|
|
441
|
+
__extract(request, requestOptions) {
|
|
442
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
443
|
+
var _a, _b;
|
|
444
|
+
const _response = yield core.fetcher({
|
|
445
|
+
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"),
|
|
446
|
+
method: "POST",
|
|
447
|
+
headers: mergeHeaders((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders({
|
|
448
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
449
|
+
"Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
|
|
450
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
451
|
+
contentType: "application/json",
|
|
452
|
+
requestType: "json",
|
|
453
|
+
body: serializers.FactsExtractRequest.jsonOrThrow(request, {
|
|
454
|
+
unrecognizedObjectKeys: "strip",
|
|
455
|
+
omitUndefined: true,
|
|
456
|
+
}),
|
|
457
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
458
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
459
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
460
|
+
});
|
|
461
|
+
if (_response.ok) {
|
|
462
|
+
return {
|
|
463
|
+
data: serializers.FactsExtractResponse.parseOrThrow(_response.body, {
|
|
464
|
+
unrecognizedObjectKeys: "passthrough",
|
|
465
|
+
allowUnrecognizedUnionMembers: true,
|
|
466
|
+
allowUnrecognizedEnumValues: true,
|
|
467
|
+
skipValidation: true,
|
|
468
|
+
breadcrumbsPrefix: ["response"],
|
|
469
|
+
}),
|
|
470
|
+
rawResponse: _response.rawResponse,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
if (_response.error.reason === "status-code") {
|
|
474
|
+
switch (_response.error.statusCode) {
|
|
475
|
+
case 504:
|
|
476
|
+
throw new Corti.GatewayTimeoutError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
477
|
+
unrecognizedObjectKeys: "passthrough",
|
|
478
|
+
allowUnrecognizedUnionMembers: true,
|
|
479
|
+
allowUnrecognizedEnumValues: true,
|
|
480
|
+
skipValidation: true,
|
|
481
|
+
breadcrumbsPrefix: ["response"],
|
|
482
|
+
}), _response.rawResponse);
|
|
483
|
+
default:
|
|
484
|
+
throw new errors.CortiError({
|
|
485
|
+
statusCode: _response.error.statusCode,
|
|
486
|
+
body: _response.error.body,
|
|
487
|
+
rawResponse: _response.rawResponse,
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
switch (_response.error.reason) {
|
|
492
|
+
case "non-json":
|
|
493
|
+
throw new errors.CortiError({
|
|
494
|
+
statusCode: _response.error.statusCode,
|
|
495
|
+
body: _response.error.rawBody,
|
|
496
|
+
rawResponse: _response.rawResponse,
|
|
497
|
+
});
|
|
498
|
+
case "timeout":
|
|
499
|
+
throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /tools/extract-facts.");
|
|
500
|
+
case "unknown":
|
|
501
|
+
throw new errors.CortiError({
|
|
502
|
+
message: _response.error.errorMessage,
|
|
503
|
+
rawResponse: _response.rawResponse,
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
}
|
|
421
508
|
_getAuthorizationHeader() {
|
|
422
509
|
return __awaiter(this, void 0, void 0, function* () {
|
|
423
510
|
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.mjs";
|
|
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
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type FactsCreateRequest } from "./FactsCreateRequest.mjs";
|
|
2
2
|
export { type FactsBatchUpdateRequest } from "./FactsBatchUpdateRequest.mjs";
|
|
3
3
|
export { type FactsUpdateRequest } from "./FactsUpdateRequest.mjs";
|
|
4
|
+
export { type FactsExtractRequest } from "./FactsExtractRequest.mjs";
|
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
@@ -120,7 +120,7 @@ export class Transcripts {
|
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* 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>
|
|
124
124
|
*
|
|
125
125
|
* @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
|
|
126
126
|
* @param {Corti.TranscriptsCreateRequest} request
|
|
@@ -223,7 +223,7 @@ export class Transcripts {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
|
-
*
|
|
226
|
+
* 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>
|
|
227
227
|
*
|
|
228
228
|
* @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
|
|
229
229
|
* @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
|
+
}
|
|
@@ -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.mjs";
|
|
5
|
-
export type DocumentsContext = Corti.
|
|
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.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
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
|
+
}
|
|
@@ -18,6 +18,7 @@ export * from "./DocumentsCreateRequest.mjs";
|
|
|
18
18
|
export * from "./DocumentsCreateRequestWithTemplateKey.mjs";
|
|
19
19
|
export * from "./DocumentsCreateRequestWithTemplate.mjs";
|
|
20
20
|
export * from "./DocumentsSectionInput.mjs";
|
|
21
|
+
export * from "./CommonTextContext.mjs";
|
|
21
22
|
export * from "./FactsCreateInput.mjs";
|
|
22
23
|
export * from "./FactsBatchUpdateInput.mjs";
|
|
23
24
|
export * from "./TranscriptsParticipant.mjs";
|
|
@@ -34,6 +35,8 @@ export * from "./FactsCreateResponse.mjs";
|
|
|
34
35
|
export * from "./FactsListResponse.mjs";
|
|
35
36
|
export * from "./FactsBatchUpdateResponse.mjs";
|
|
36
37
|
export * from "./FactsBatchUpdateItem.mjs";
|
|
38
|
+
export * from "./FactsExtractResponseFactsItem.mjs";
|
|
39
|
+
export * from "./FactsExtractResponse.mjs";
|
|
37
40
|
export * from "./InteractionsGetResponse.mjs";
|
|
38
41
|
export * from "./InteractionsCreateResponse.mjs";
|
|
39
42
|
export * from "./InteractionsListResponse.mjs";
|
|
@@ -18,6 +18,7 @@ export * from "./DocumentsCreateRequest.mjs";
|
|
|
18
18
|
export * from "./DocumentsCreateRequestWithTemplateKey.mjs";
|
|
19
19
|
export * from "./DocumentsCreateRequestWithTemplate.mjs";
|
|
20
20
|
export * from "./DocumentsSectionInput.mjs";
|
|
21
|
+
export * from "./CommonTextContext.mjs";
|
|
21
22
|
export * from "./FactsCreateInput.mjs";
|
|
22
23
|
export * from "./FactsBatchUpdateInput.mjs";
|
|
23
24
|
export * from "./TranscriptsParticipant.mjs";
|
|
@@ -34,6 +35,8 @@ export * from "./FactsCreateResponse.mjs";
|
|
|
34
35
|
export * from "./FactsListResponse.mjs";
|
|
35
36
|
export * from "./FactsBatchUpdateResponse.mjs";
|
|
36
37
|
export * from "./FactsBatchUpdateItem.mjs";
|
|
38
|
+
export * from "./FactsExtractResponseFactsItem.mjs";
|
|
39
|
+
export * from "./FactsExtractResponse.mjs";
|
|
37
40
|
export * from "./InteractionsGetResponse.mjs";
|
|
38
41
|
export * from "./InteractionsCreateResponse.mjs";
|
|
39
42
|
export * from "./InteractionsListResponse.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../../index.mjs";
|
|
5
|
+
import * as Corti from "../../../../../api/index.mjs";
|
|
6
|
+
import * as core from "../../../../../core/index.mjs";
|
|
7
|
+
import { CommonTextContext } from "../../../../types/CommonTextContext.mjs";
|
|
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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../../../../core/index.mjs";
|
|
5
|
+
import { CommonTextContext } from "../../../../types/CommonTextContext.mjs";
|
|
6
|
+
export const FactsExtractRequest = core.serialization.object({
|
|
7
|
+
context: core.serialization.list(CommonTextContext),
|
|
8
|
+
outputLanguage: core.serialization.string(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../index.mjs";
|
|
5
|
+
import * as Corti from "../../api/index.mjs";
|
|
6
|
+
import * as core from "../../core/index.mjs";
|
|
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,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../core/index.mjs";
|
|
5
|
+
export const CommonTextContext = core.serialization.object({
|
|
6
|
+
type: core.serialization.stringLiteral("text"),
|
|
7
|
+
text: core.serialization.string(),
|
|
8
|
+
});
|
|
@@ -9,14 +9,5 @@ import { DocumentsContextWithTranscript } from "./DocumentsContextWithTranscript
|
|
|
9
9
|
import { DocumentsContextWithString } from "./DocumentsContextWithString.mjs";
|
|
10
10
|
export declare const DocumentsContext: core.serialization.Schema<serializers.DocumentsContext.Raw, Corti.DocumentsContext>;
|
|
11
11
|
export declare namespace DocumentsContext {
|
|
12
|
-
type Raw =
|
|
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
|
}
|
|
@@ -5,13 +5,8 @@ import * as core from "../../core/index.mjs";
|
|
|
5
5
|
import { DocumentsContextWithFacts } from "./DocumentsContextWithFacts.mjs";
|
|
6
6
|
import { DocumentsContextWithTranscript } from "./DocumentsContextWithTranscript.mjs";
|
|
7
7
|
import { DocumentsContextWithString } from "./DocumentsContextWithString.mjs";
|
|
8
|
-
export const DocumentsContext = core.serialization
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
.transform({
|
|
15
|
-
transform: (value) => value,
|
|
16
|
-
untransform: (value) => value,
|
|
17
|
-
});
|
|
8
|
+
export const DocumentsContext = core.serialization.undiscriminatedUnion([
|
|
9
|
+
DocumentsContextWithFacts,
|
|
10
|
+
DocumentsContextWithTranscript,
|
|
11
|
+
DocumentsContextWithString,
|
|
12
|
+
]);
|
|
@@ -8,6 +8,7 @@ import { FactsContext } from "./FactsContext.mjs";
|
|
|
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
|
}
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
import * as core from "../../core/index.mjs";
|
|
5
5
|
import { FactsContext } from "./FactsContext.mjs";
|
|
6
6
|
export const DocumentsContextWithFacts = core.serialization.object({
|
|
7
|
+
type: core.serialization.stringLiteral("facts"),
|
|
7
8
|
data: core.serialization.list(FactsContext),
|
|
8
9
|
});
|
|
@@ -7,6 +7,7 @@ import * as core from "../../core/index.mjs";
|
|
|
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
|
}
|