@corti/sdk 0.9.1-rc → 0.10.0-rc.1
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.d.ts +3 -0
- package/dist/cjs/Client.js +13 -8
- package/dist/cjs/api/errors/BadGatewayError.d.ts +9 -0
- package/dist/cjs/api/errors/BadGatewayError.js +52 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +11 -1
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateAgent.d.ts +2 -0
- package/dist/cjs/api/resources/agents/types/AgentsCreateAgentAgentType.d.ts +12 -0
- package/dist/cjs/api/resources/agents/types/AgentsCreateAgentAgentType.js +11 -0
- package/dist/cjs/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +1 -1
- package/dist/cjs/api/resources/agents/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/agents/types/index.js +1 -0
- package/dist/cjs/api/resources/auth/client/Client.js +1 -0
- package/dist/cjs/api/resources/codes/client/Client.d.ts +59 -0
- package/dist/cjs/api/resources/codes/client/Client.js +187 -0
- package/dist/cjs/api/resources/codes/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/codes/client/index.js +17 -0
- package/dist/cjs/api/resources/codes/client/requests/CodesGeneralPredictRequest.d.ts +23 -0
- package/dist/cjs/api/resources/codes/client/requests/CodesGeneralPredictRequest.js +5 -0
- package/dist/cjs/api/resources/codes/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/codes/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/codes/index.d.ts +1 -0
- package/dist/cjs/api/resources/codes/index.js +17 -0
- package/dist/cjs/api/resources/documents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/documents/client/Client.js +6 -1
- package/dist/cjs/api/resources/facts/client/Client.js +6 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/interactions/client/Client.js +5 -0
- package/dist/cjs/api/resources/recordings/client/Client.js +4 -0
- package/dist/cjs/api/resources/templates/client/Client.js +3 -0
- package/dist/cjs/api/resources/transcripts/client/Client.d.ts +15 -1
- package/dist/cjs/api/resources/transcripts/client/Client.js +76 -1
- package/dist/cjs/api/types/AgentsCreateExpertReference.d.ts +15 -0
- package/dist/cjs/api/types/AgentsCreateExpertReference.js +5 -0
- package/dist/cjs/api/types/AgentsCreateMcpServer.d.ts +2 -0
- package/dist/cjs/api/types/AgentsExpertReference.d.ts +5 -3
- package/dist/cjs/api/types/AgentsMcpServer.d.ts +2 -0
- package/dist/cjs/api/types/CodesGeneralReadResponse.d.ts +17 -0
- package/dist/cjs/api/types/CodesGeneralReadResponse.js +5 -0
- package/dist/cjs/api/types/CodesGeneralReadResponseEvidencesItem.d.ts +9 -0
- package/dist/cjs/api/types/CodesGeneralReadResponseEvidencesItem.js +5 -0
- package/dist/cjs/api/types/CodesGeneralResponse.d.ts +11 -0
- package/dist/cjs/api/types/CodesGeneralResponse.js +5 -0
- package/dist/cjs/api/types/CommonAiContext.d.ts +5 -0
- package/dist/cjs/api/types/CommonAiContext.js +5 -0
- package/dist/cjs/api/types/CommonCodingSystemEnum.d.ts +9 -0
- package/dist/cjs/api/types/CommonCodingSystemEnum.js +11 -0
- package/dist/cjs/api/types/CommonDocumentIdContext.d.ts +9 -0
- package/dist/cjs/api/types/CommonDocumentIdContext.js +5 -0
- package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +1 -1
- package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +1 -1
- package/dist/cjs/api/types/DocumentsCreateRequestWithTemplate.d.ts +1 -1
- package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateKey.d.ts +2 -2
- package/dist/cjs/api/types/ErrorResponse.d.ts +4 -5
- package/dist/cjs/api/types/TranscriptsResponse.d.ts +4 -0
- package/dist/cjs/api/types/TranscriptsStatusEnum.d.ts +12 -0
- package/dist/cjs/api/types/TranscriptsStatusEnum.js +11 -0
- package/dist/cjs/api/types/TranscriptsStatusResponse.d.ts +8 -0
- package/dist/cjs/api/types/TranscriptsStatusResponse.js +5 -0
- package/dist/cjs/api/types/index.d.ts +9 -0
- package/dist/cjs/api/types/index.js +9 -0
- package/dist/cjs/custom/CortiClient.d.ts +3 -0
- package/dist/cjs/custom/CortiClient.js +5 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/serialization/resources/agents/client/requests/AgentsCreateAgent.d.ts +2 -0
- package/dist/cjs/serialization/resources/agents/client/requests/AgentsCreateAgent.js +2 -0
- package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentAgentType.d.ts +10 -0
- package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentAgentType.js +41 -0
- package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +2 -2
- package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.js +2 -2
- package/dist/cjs/serialization/resources/agents/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/agents/types/index.js +1 -0
- package/dist/cjs/serialization/resources/codes/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/codes/client/index.js +17 -0
- package/dist/cjs/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.d.ts +16 -0
- package/dist/cjs/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.js +47 -0
- package/dist/cjs/serialization/resources/codes/client/requests/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/codes/client/requests/index.js +5 -0
- package/dist/cjs/serialization/resources/codes/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/codes/index.js +17 -0
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -1
- package/dist/cjs/serialization/types/AgentsCreateExpertReference.d.ts +15 -0
- package/dist/cjs/serialization/types/AgentsCreateExpertReference.js +46 -0
- package/dist/cjs/serialization/types/AgentsCreateMcpServer.d.ts +1 -0
- package/dist/cjs/serialization/types/AgentsCreateMcpServer.js +1 -0
- package/dist/cjs/serialization/types/AgentsExpertReference.d.ts +3 -2
- package/dist/cjs/serialization/types/AgentsExpertReference.js +3 -2
- package/dist/cjs/serialization/types/AgentsMcpServer.d.ts +1 -0
- package/dist/cjs/serialization/types/AgentsMcpServer.js +1 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponse.d.ts +17 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponse.js +48 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponseEvidencesItem.d.ts +13 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponseEvidencesItem.js +44 -0
- package/dist/cjs/serialization/types/CodesGeneralResponse.d.ts +16 -0
- package/dist/cjs/serialization/types/CodesGeneralResponse.js +47 -0
- package/dist/cjs/serialization/types/CommonAiContext.d.ts +12 -0
- package/dist/cjs/serialization/types/CommonAiContext.js +43 -0
- package/dist/cjs/serialization/types/CommonCodingSystemEnum.d.ts +10 -0
- package/dist/cjs/serialization/types/CommonCodingSystemEnum.js +41 -0
- package/dist/cjs/serialization/types/CommonDocumentIdContext.d.ts +13 -0
- package/dist/cjs/serialization/types/CommonDocumentIdContext.js +44 -0
- package/dist/cjs/serialization/types/ErrorResponse.d.ts +4 -5
- package/dist/cjs/serialization/types/ErrorResponse.js +6 -5
- package/dist/cjs/serialization/types/TranscriptsResponse.d.ts +3 -0
- package/dist/cjs/serialization/types/TranscriptsResponse.js +3 -0
- package/dist/cjs/serialization/types/TranscriptsStatusEnum.d.ts +10 -0
- package/dist/cjs/serialization/types/TranscriptsStatusEnum.js +41 -0
- package/dist/cjs/serialization/types/TranscriptsStatusResponse.d.ts +13 -0
- package/dist/cjs/serialization/types/TranscriptsStatusResponse.js +44 -0
- package/dist/cjs/serialization/types/index.d.ts +9 -0
- package/dist/cjs/serialization/types/index.js +9 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/errors/BadGatewayError.d.mts +9 -0
- package/dist/esm/api/errors/BadGatewayError.mjs +15 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +11 -1
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateAgent.d.mts +2 -0
- package/dist/esm/api/resources/agents/types/AgentsCreateAgentAgentType.d.mts +12 -0
- package/dist/esm/api/resources/agents/types/AgentsCreateAgentAgentType.mjs +8 -0
- package/dist/esm/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +1 -1
- package/dist/esm/api/resources/agents/types/index.d.mts +1 -0
- package/dist/esm/api/resources/agents/types/index.mjs +1 -0
- package/dist/esm/api/resources/auth/client/Client.mjs +1 -0
- package/dist/esm/api/resources/codes/client/Client.d.mts +59 -0
- package/dist/esm/api/resources/codes/client/Client.mjs +150 -0
- package/dist/esm/api/resources/codes/client/index.d.mts +2 -0
- package/dist/esm/api/resources/codes/client/index.mjs +1 -0
- package/dist/esm/api/resources/codes/client/requests/CodesGeneralPredictRequest.d.mts +23 -0
- package/dist/esm/api/resources/codes/client/requests/CodesGeneralPredictRequest.mjs +4 -0
- package/dist/esm/api/resources/codes/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/codes/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/codes/index.d.mts +1 -0
- package/dist/esm/api/resources/codes/index.mjs +1 -0
- package/dist/esm/api/resources/documents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/documents/client/Client.mjs +6 -1
- package/dist/esm/api/resources/facts/client/Client.mjs +6 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/interactions/client/Client.mjs +5 -0
- package/dist/esm/api/resources/recordings/client/Client.mjs +4 -0
- package/dist/esm/api/resources/templates/client/Client.mjs +3 -0
- package/dist/esm/api/resources/transcripts/client/Client.d.mts +15 -1
- package/dist/esm/api/resources/transcripts/client/Client.mjs +76 -1
- package/dist/esm/api/types/AgentsCreateExpertReference.d.mts +15 -0
- package/dist/esm/api/types/AgentsCreateExpertReference.mjs +4 -0
- package/dist/esm/api/types/AgentsCreateMcpServer.d.mts +2 -0
- package/dist/esm/api/types/AgentsExpertReference.d.mts +5 -3
- package/dist/esm/api/types/AgentsMcpServer.d.mts +2 -0
- package/dist/esm/api/types/CodesGeneralReadResponse.d.mts +17 -0
- package/dist/esm/api/types/CodesGeneralReadResponse.mjs +4 -0
- package/dist/esm/api/types/CodesGeneralReadResponseEvidencesItem.d.mts +9 -0
- package/dist/esm/api/types/CodesGeneralReadResponseEvidencesItem.mjs +4 -0
- package/dist/esm/api/types/CodesGeneralResponse.d.mts +11 -0
- package/dist/esm/api/types/CodesGeneralResponse.mjs +4 -0
- package/dist/esm/api/types/CommonAiContext.d.mts +5 -0
- package/dist/esm/api/types/CommonAiContext.mjs +4 -0
- package/dist/esm/api/types/CommonCodingSystemEnum.d.mts +9 -0
- package/dist/esm/api/types/CommonCodingSystemEnum.mjs +8 -0
- package/dist/esm/api/types/CommonDocumentIdContext.d.mts +9 -0
- package/dist/esm/api/types/CommonDocumentIdContext.mjs +4 -0
- package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +1 -1
- package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +1 -1
- package/dist/esm/api/types/DocumentsCreateRequestWithTemplate.d.mts +1 -1
- package/dist/esm/api/types/DocumentsCreateRequestWithTemplateKey.d.mts +2 -2
- package/dist/esm/api/types/ErrorResponse.d.mts +4 -5
- package/dist/esm/api/types/TranscriptsResponse.d.mts +4 -0
- package/dist/esm/api/types/TranscriptsStatusEnum.d.mts +12 -0
- package/dist/esm/api/types/TranscriptsStatusEnum.mjs +8 -0
- package/dist/esm/api/types/TranscriptsStatusResponse.d.mts +8 -0
- package/dist/esm/api/types/TranscriptsStatusResponse.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +9 -0
- package/dist/esm/api/types/index.mjs +9 -0
- package/dist/esm/custom/CortiClient.d.mts +3 -0
- package/dist/esm/custom/CortiClient.mjs +5 -0
- package/dist/esm/index.d.mts +4 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/esm/serialization/resources/agents/client/requests/AgentsCreateAgent.d.mts +2 -0
- package/dist/esm/serialization/resources/agents/client/requests/AgentsCreateAgent.mjs +2 -0
- package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentAgentType.d.mts +10 -0
- package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentAgentType.mjs +5 -0
- package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +2 -2
- package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.mjs +2 -2
- package/dist/esm/serialization/resources/agents/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/agents/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/codes/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/codes/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.d.mts +16 -0
- package/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.mjs +11 -0
- package/dist/esm/serialization/resources/codes/client/requests/index.d.mts +1 -0
- package/dist/esm/serialization/resources/codes/client/requests/index.mjs +1 -0
- package/dist/esm/serialization/resources/codes/index.d.mts +1 -0
- package/dist/esm/serialization/resources/codes/index.mjs +1 -0
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -0
- package/dist/esm/serialization/types/AgentsCreateExpertReference.d.mts +15 -0
- package/dist/esm/serialization/types/AgentsCreateExpertReference.mjs +10 -0
- package/dist/esm/serialization/types/AgentsCreateMcpServer.d.mts +1 -0
- package/dist/esm/serialization/types/AgentsCreateMcpServer.mjs +1 -0
- package/dist/esm/serialization/types/AgentsExpertReference.d.mts +3 -2
- package/dist/esm/serialization/types/AgentsExpertReference.mjs +3 -2
- package/dist/esm/serialization/types/AgentsMcpServer.d.mts +1 -0
- package/dist/esm/serialization/types/AgentsMcpServer.mjs +1 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponse.d.mts +17 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponse.mjs +12 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponseEvidencesItem.d.mts +13 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponseEvidencesItem.mjs +8 -0
- package/dist/esm/serialization/types/CodesGeneralResponse.d.mts +16 -0
- package/dist/esm/serialization/types/CodesGeneralResponse.mjs +11 -0
- package/dist/esm/serialization/types/CommonAiContext.d.mts +12 -0
- package/dist/esm/serialization/types/CommonAiContext.mjs +7 -0
- package/dist/esm/serialization/types/CommonCodingSystemEnum.d.mts +10 -0
- package/dist/esm/serialization/types/CommonCodingSystemEnum.mjs +5 -0
- package/dist/esm/serialization/types/CommonDocumentIdContext.d.mts +13 -0
- package/dist/esm/serialization/types/CommonDocumentIdContext.mjs +8 -0
- package/dist/esm/serialization/types/ErrorResponse.d.mts +4 -5
- package/dist/esm/serialization/types/ErrorResponse.mjs +6 -5
- package/dist/esm/serialization/types/TranscriptsResponse.d.mts +3 -0
- package/dist/esm/serialization/types/TranscriptsResponse.mjs +3 -0
- package/dist/esm/serialization/types/TranscriptsStatusEnum.d.mts +10 -0
- package/dist/esm/serialization/types/TranscriptsStatusEnum.mjs +5 -0
- package/dist/esm/serialization/types/TranscriptsStatusResponse.d.mts +13 -0
- package/dist/esm/serialization/types/TranscriptsStatusResponse.mjs +8 -0
- package/dist/esm/serialization/types/index.d.mts +9 -0
- package/dist/esm/serialization/types/index.mjs +9 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Transcripts } from "./api/resources/transcripts/client/Client.js";
|
|
|
10
10
|
import { Facts } from "./api/resources/facts/client/Client.js";
|
|
11
11
|
import { Documents } from "./api/resources/documents/client/Client.js";
|
|
12
12
|
import { Templates } from "./api/resources/templates/client/Client.js";
|
|
13
|
+
import { Codes } from "./api/resources/codes/client/Client.js";
|
|
13
14
|
import { Agents } from "./api/resources/agents/client/Client.js";
|
|
14
15
|
import { Stream } from "./api/resources/stream/client/Client.js";
|
|
15
16
|
import { Transcribe } from "./api/resources/transcribe/client/Client.js";
|
|
@@ -47,6 +48,7 @@ export declare class CortiClient {
|
|
|
47
48
|
protected _facts: Facts | undefined;
|
|
48
49
|
protected _documents: Documents | undefined;
|
|
49
50
|
protected _templates: Templates | undefined;
|
|
51
|
+
protected _codes: Codes | undefined;
|
|
50
52
|
protected _auth: Auth | undefined;
|
|
51
53
|
protected _agents: Agents | undefined;
|
|
52
54
|
protected _stream: Stream | undefined;
|
|
@@ -58,6 +60,7 @@ export declare class CortiClient {
|
|
|
58
60
|
get facts(): Facts;
|
|
59
61
|
get documents(): Documents;
|
|
60
62
|
get templates(): Templates;
|
|
63
|
+
get codes(): Codes;
|
|
61
64
|
get auth(): Auth;
|
|
62
65
|
get agents(): Agents;
|
|
63
66
|
get stream(): Stream;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -55,17 +55,18 @@ const Client_js_4 = require("./api/resources/transcripts/client/Client.js");
|
|
|
55
55
|
const Client_js_5 = require("./api/resources/facts/client/Client.js");
|
|
56
56
|
const Client_js_6 = require("./api/resources/documents/client/Client.js");
|
|
57
57
|
const Client_js_7 = require("./api/resources/templates/client/Client.js");
|
|
58
|
-
const Client_js_8 = require("./api/resources/
|
|
59
|
-
const Client_js_9 = require("./api/resources/
|
|
60
|
-
const Client_js_10 = require("./api/resources/
|
|
58
|
+
const Client_js_8 = require("./api/resources/codes/client/Client.js");
|
|
59
|
+
const Client_js_9 = require("./api/resources/agents/client/Client.js");
|
|
60
|
+
const Client_js_10 = require("./api/resources/stream/client/Client.js");
|
|
61
|
+
const Client_js_11 = require("./api/resources/transcribe/client/Client.js");
|
|
61
62
|
class CortiClient {
|
|
62
63
|
constructor(_options) {
|
|
63
64
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
64
65
|
"Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
|
|
65
66
|
"X-Fern-Language": "JavaScript",
|
|
66
67
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
67
|
-
"X-Fern-SDK-Version": "0.
|
|
68
|
-
"User-Agent": "@corti/sdk/0.
|
|
68
|
+
"X-Fern-SDK-Version": "0.10.0-rc.1",
|
|
69
|
+
"User-Agent": "@corti/sdk/0.10.0-rc.1",
|
|
69
70
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
70
71
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
71
72
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -99,21 +100,25 @@ class CortiClient {
|
|
|
99
100
|
var _a;
|
|
100
101
|
return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_7.Templates(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
101
102
|
}
|
|
103
|
+
get codes() {
|
|
104
|
+
var _a;
|
|
105
|
+
return ((_a = this._codes) !== null && _a !== void 0 ? _a : (this._codes = new Client_js_8.Codes(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
106
|
+
}
|
|
102
107
|
get auth() {
|
|
103
108
|
var _a;
|
|
104
109
|
return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new Client_js_1.Auth(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
105
110
|
}
|
|
106
111
|
get agents() {
|
|
107
112
|
var _a;
|
|
108
|
-
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new
|
|
113
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_9.Agents(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
109
114
|
}
|
|
110
115
|
get stream() {
|
|
111
116
|
var _a;
|
|
112
|
-
return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new
|
|
117
|
+
return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new Client_js_10.Stream(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
113
118
|
}
|
|
114
119
|
get transcribe() {
|
|
115
120
|
var _a;
|
|
116
|
-
return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new
|
|
121
|
+
return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new Client_js_11.Transcribe(Object.assign(Object.assign({}, this._options), { token: () => __awaiter(this, void 0, void 0, function* () { return yield this._oauthTokenProvider.getToken(); }) }))));
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
124
|
exports.CortiClient = CortiClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.js";
|
|
5
|
+
import * as Corti from "../index.js";
|
|
6
|
+
import * as core from "../../core/index.js";
|
|
7
|
+
export declare class BadGatewayError extends errors.CortiError {
|
|
8
|
+
constructor(body: Corti.ErrorResponse, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.BadGatewayError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
41
|
+
class BadGatewayError extends errors.CortiError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "BadGatewayError",
|
|
45
|
+
statusCode: 502,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, BadGatewayError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.BadGatewayError = BadGatewayError;
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./BadRequestError.js"), exports);
|
|
|
20
20
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
21
21
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
22
22
|
__exportStar(require("./UnauthorizedError.js"), exports);
|
|
23
|
+
__exportStar(require("./BadGatewayError.js"), exports);
|
|
@@ -189,7 +189,7 @@ export declare class Agents {
|
|
|
189
189
|
getContext(id: string, contextId: string, request?: Corti.AgentsGetContextRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Corti.AgentsContext>;
|
|
190
190
|
private __getContext;
|
|
191
191
|
/**
|
|
192
|
-
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the
|
|
192
|
+
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
|
|
193
193
|
*
|
|
194
194
|
* @param {Corti.AgentsGetRegistryExpertsRequest} request
|
|
195
195
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -105,6 +105,7 @@ class Agents {
|
|
|
105
105
|
queryParameters: _queryParams,
|
|
106
106
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
107
107
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
108
|
+
withCredentials: true,
|
|
108
109
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
109
110
|
});
|
|
110
111
|
if (_response.ok) {
|
|
@@ -192,6 +193,7 @@ class Agents {
|
|
|
192
193
|
}),
|
|
193
194
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
194
195
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
196
|
+
withCredentials: true,
|
|
195
197
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
196
198
|
});
|
|
197
199
|
if (_response.ok) {
|
|
@@ -265,6 +267,7 @@ class Agents {
|
|
|
265
267
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
266
268
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
267
269
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
270
|
+
withCredentials: true,
|
|
268
271
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
269
272
|
});
|
|
270
273
|
if (_response.ok) {
|
|
@@ -340,6 +343,7 @@ class Agents {
|
|
|
340
343
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
341
344
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
342
345
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
346
|
+
withCredentials: true,
|
|
343
347
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
344
348
|
});
|
|
345
349
|
if (_response.ok) {
|
|
@@ -418,6 +422,7 @@ class Agents {
|
|
|
418
422
|
}),
|
|
419
423
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
420
424
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
425
|
+
withCredentials: true,
|
|
421
426
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
422
427
|
});
|
|
423
428
|
if (_response.ok) {
|
|
@@ -493,6 +498,7 @@ class Agents {
|
|
|
493
498
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
494
499
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
495
500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
501
|
+
withCredentials: true,
|
|
496
502
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
497
503
|
});
|
|
498
504
|
if (_response.ok) {
|
|
@@ -585,6 +591,7 @@ class Agents {
|
|
|
585
591
|
}),
|
|
586
592
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
587
593
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
594
|
+
withCredentials: true,
|
|
588
595
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
589
596
|
});
|
|
590
597
|
if (_response.ok) {
|
|
@@ -668,6 +675,7 @@ class Agents {
|
|
|
668
675
|
queryParameters: _queryParams,
|
|
669
676
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
670
677
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
678
|
+
withCredentials: true,
|
|
671
679
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
672
680
|
});
|
|
673
681
|
if (_response.ok) {
|
|
@@ -754,6 +762,7 @@ class Agents {
|
|
|
754
762
|
queryParameters: _queryParams,
|
|
755
763
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
756
764
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
765
|
+
withCredentials: true,
|
|
757
766
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
758
767
|
});
|
|
759
768
|
if (_response.ok) {
|
|
@@ -802,7 +811,7 @@ class Agents {
|
|
|
802
811
|
});
|
|
803
812
|
}
|
|
804
813
|
/**
|
|
805
|
-
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the
|
|
814
|
+
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
|
|
806
815
|
*
|
|
807
816
|
* @param {Corti.AgentsGetRegistryExpertsRequest} request
|
|
808
817
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -840,6 +849,7 @@ class Agents {
|
|
|
840
849
|
queryParameters: _queryParams,
|
|
841
850
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
842
851
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
852
|
+
withCredentials: true,
|
|
843
853
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
844
854
|
});
|
|
845
855
|
if (_response.ok) {
|
|
@@ -16,6 +16,8 @@ export interface AgentsCreateAgent {
|
|
|
16
16
|
ephemeral?: boolean | null;
|
|
17
17
|
/** The name of the agent. */
|
|
18
18
|
name: string;
|
|
19
|
+
/** Optional type of agent. */
|
|
20
|
+
agentType?: Corti.AgentsCreateAgentAgentType;
|
|
19
21
|
/** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */
|
|
20
22
|
systemPrompt?: string;
|
|
21
23
|
/** A brief description of the agent's capabilities. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Optional type of agent.
|
|
6
|
+
*/
|
|
7
|
+
export type AgentsCreateAgentAgentType = "expert" | "orchestrator" | "interviewing-expert";
|
|
8
|
+
export declare const AgentsCreateAgentAgentType: {
|
|
9
|
+
readonly Expert: "expert";
|
|
10
|
+
readonly Orchestrator: "orchestrator";
|
|
11
|
+
readonly InterviewingExpert: "interviewing-expert";
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AgentsCreateAgentAgentType = void 0;
|
|
7
|
+
exports.AgentsCreateAgentAgentType = {
|
|
8
|
+
Expert: "expert",
|
|
9
|
+
Orchestrator: "orchestrator",
|
|
10
|
+
InterviewingExpert: "interviewing-expert",
|
|
11
|
+
};
|
|
@@ -2,4 +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 AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.
|
|
5
|
+
export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsCreateExpertReference;
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AgentsCreateAgentAgentType.js"), exports);
|
|
17
18
|
__exportStar(require("./AgentsCreateAgentExpertsItem.js"), exports);
|
|
18
19
|
__exportStar(require("./AgentsMessageSendResponse.js"), exports);
|
|
@@ -87,6 +87,7 @@ class Auth {
|
|
|
87
87
|
})), { scope: "openid", grant_type: "client_credentials" }),
|
|
88
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
89
89
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
90
|
+
withCredentials: true,
|
|
90
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
91
92
|
});
|
|
92
93
|
if (_response.ok) {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as Corti from "../../../index.js";
|
|
7
|
+
export declare namespace Codes {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Override the Tenant-Name header */
|
|
14
|
+
tenantName: core.Supplier<string>;
|
|
15
|
+
/** Additional headers to include in requests. */
|
|
16
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
17
|
+
}
|
|
18
|
+
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
20
|
+
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
|
+
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
24
|
+
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the Tenant-Name header */
|
|
26
|
+
tenantName?: string;
|
|
27
|
+
/** Additional headers to include in the request. */
|
|
28
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export declare class Codes {
|
|
32
|
+
protected readonly _options: Codes.Options;
|
|
33
|
+
constructor(_options: Codes.Options);
|
|
34
|
+
/**
|
|
35
|
+
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request, and the maximum number of codes to return per system can also be defined.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Highest confidence bundle of codes, as selected by the code prediction model<br/>- `Candidates`: Full list of candidate codes as predicted by the model, rank sorted by model confidence with maximum possible value of 50.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
|
|
36
|
+
*
|
|
37
|
+
* @param {Corti.CodesGeneralPredictRequest} request
|
|
38
|
+
* @param {Codes.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Corti.BadRequestError}
|
|
41
|
+
* @throws {@link Corti.ForbiddenError}
|
|
42
|
+
* @throws {@link Corti.InternalServerError}
|
|
43
|
+
* @throws {@link Corti.BadGatewayError}
|
|
44
|
+
* @throws {@link Corti.GatewayTimeoutError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.codes.predict({
|
|
48
|
+
* system: ["icd10cm", "cpt"],
|
|
49
|
+
* context: [{
|
|
50
|
+
* type: "text",
|
|
51
|
+
* text: "Short arm splint applied in ED for pain control."
|
|
52
|
+
* }],
|
|
53
|
+
* maxCandidates: 5
|
|
54
|
+
* })
|
|
55
|
+
*/
|
|
56
|
+
predict(request: Corti.CodesGeneralPredictRequest, requestOptions?: Codes.RequestOptions): core.HttpResponsePromise<Corti.CodesGeneralResponse>;
|
|
57
|
+
private __predict;
|
|
58
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Codes = void 0;
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const Corti = __importStar(require("../../../index.js"));
|
|
51
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
52
|
+
const serializers = __importStar(require("../../../../serialization/index.js"));
|
|
53
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
|
+
class Codes {
|
|
55
|
+
constructor(_options) {
|
|
56
|
+
this._options = _options;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request, and the maximum number of codes to return per system can also be defined.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Highest confidence bundle of codes, as selected by the code prediction model<br/>- `Candidates`: Full list of candidate codes as predicted by the model, rank sorted by model confidence with maximum possible value of 50.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
|
|
60
|
+
*
|
|
61
|
+
* @param {Corti.CodesGeneralPredictRequest} request
|
|
62
|
+
* @param {Codes.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Corti.BadRequestError}
|
|
65
|
+
* @throws {@link Corti.ForbiddenError}
|
|
66
|
+
* @throws {@link Corti.InternalServerError}
|
|
67
|
+
* @throws {@link Corti.BadGatewayError}
|
|
68
|
+
* @throws {@link Corti.GatewayTimeoutError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.codes.predict({
|
|
72
|
+
* system: ["icd10cm", "cpt"],
|
|
73
|
+
* context: [{
|
|
74
|
+
* type: "text",
|
|
75
|
+
* text: "Short arm splint applied in ED for pain control."
|
|
76
|
+
* }],
|
|
77
|
+
* maxCandidates: 5
|
|
78
|
+
* })
|
|
79
|
+
*/
|
|
80
|
+
predict(request, requestOptions) {
|
|
81
|
+
return core.HttpResponsePromise.fromPromise(this.__predict(request, requestOptions));
|
|
82
|
+
}
|
|
83
|
+
__predict(request, requestOptions) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const _response = yield core.fetcher({
|
|
87
|
+
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/coding/"),
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
90
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
91
|
+
"Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
|
|
92
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
93
|
+
contentType: "application/json",
|
|
94
|
+
requestType: "json",
|
|
95
|
+
body: serializers.CodesGeneralPredictRequest.jsonOrThrow(request, {
|
|
96
|
+
unrecognizedObjectKeys: "strip",
|
|
97
|
+
omitUndefined: true,
|
|
98
|
+
}),
|
|
99
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
100
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
101
|
+
withCredentials: true,
|
|
102
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
103
|
+
});
|
|
104
|
+
if (_response.ok) {
|
|
105
|
+
return {
|
|
106
|
+
data: serializers.CodesGeneralResponse.parseOrThrow(_response.body, {
|
|
107
|
+
unrecognizedObjectKeys: "passthrough",
|
|
108
|
+
allowUnrecognizedUnionMembers: true,
|
|
109
|
+
allowUnrecognizedEnumValues: true,
|
|
110
|
+
skipValidation: true,
|
|
111
|
+
breadcrumbsPrefix: ["response"],
|
|
112
|
+
}),
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (_response.error.reason === "status-code") {
|
|
117
|
+
switch (_response.error.statusCode) {
|
|
118
|
+
case 400:
|
|
119
|
+
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
120
|
+
case 403:
|
|
121
|
+
throw new Corti.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
122
|
+
unrecognizedObjectKeys: "passthrough",
|
|
123
|
+
allowUnrecognizedUnionMembers: true,
|
|
124
|
+
allowUnrecognizedEnumValues: true,
|
|
125
|
+
skipValidation: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
}), _response.rawResponse);
|
|
128
|
+
case 500:
|
|
129
|
+
throw new Corti.InternalServerError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
130
|
+
unrecognizedObjectKeys: "passthrough",
|
|
131
|
+
allowUnrecognizedUnionMembers: true,
|
|
132
|
+
allowUnrecognizedEnumValues: true,
|
|
133
|
+
skipValidation: true,
|
|
134
|
+
breadcrumbsPrefix: ["response"],
|
|
135
|
+
}), _response.rawResponse);
|
|
136
|
+
case 502:
|
|
137
|
+
throw new Corti.BadGatewayError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
138
|
+
unrecognizedObjectKeys: "passthrough",
|
|
139
|
+
allowUnrecognizedUnionMembers: true,
|
|
140
|
+
allowUnrecognizedEnumValues: true,
|
|
141
|
+
skipValidation: true,
|
|
142
|
+
breadcrumbsPrefix: ["response"],
|
|
143
|
+
}), _response.rawResponse);
|
|
144
|
+
case 504:
|
|
145
|
+
throw new Corti.GatewayTimeoutError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
skipValidation: true,
|
|
150
|
+
breadcrumbsPrefix: ["response"],
|
|
151
|
+
}), _response.rawResponse);
|
|
152
|
+
default:
|
|
153
|
+
throw new errors.CortiError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.body,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
switch (_response.error.reason) {
|
|
161
|
+
case "non-json":
|
|
162
|
+
throw new errors.CortiError({
|
|
163
|
+
statusCode: _response.error.statusCode,
|
|
164
|
+
body: _response.error.rawBody,
|
|
165
|
+
rawResponse: _response.rawResponse,
|
|
166
|
+
});
|
|
167
|
+
case "timeout":
|
|
168
|
+
throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /tools/coding/.");
|
|
169
|
+
case "unknown":
|
|
170
|
+
throw new errors.CortiError({
|
|
171
|
+
message: _response.error.errorMessage,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
_getAuthorizationHeader() {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
180
|
+
if (bearer != null) {
|
|
181
|
+
return `Bearer ${bearer}`;
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.Codes = Codes;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
* system: ["icd10cm", "cpt"],
|
|
9
|
+
* context: [{
|
|
10
|
+
* type: "text",
|
|
11
|
+
* text: "Short arm splint applied in ED for pain control."
|
|
12
|
+
* }],
|
|
13
|
+
* maxCandidates: 5
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface CodesGeneralPredictRequest {
|
|
17
|
+
/** List of coding systems for prediction */
|
|
18
|
+
system: Corti.CommonCodingSystemEnum[];
|
|
19
|
+
/** Select either `text` or `documentId` as input context to the model for code prediction. Evidence indices in the response map to this array. */
|
|
20
|
+
context: Corti.CommonAiContext[];
|
|
21
|
+
/** Maximum number of code candidates to include in the response (per system). */
|
|
22
|
+
maxCandidates?: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CodesGeneralPredictRequest } from "./CodesGeneralPredictRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|