phenoml 5.3.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/cjs/BaseClient.d.ts +2 -0
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agent/client/Client.js +16 -8
  4. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +14 -7
  5. package/dist/cjs/api/resources/agent/types/ChatMessageTemplate.d.ts +0 -2
  6. package/dist/cjs/api/resources/agent/types/ChatSessionTemplate.d.ts +0 -2
  7. package/dist/cjs/api/resources/cohort/client/Client.js +2 -1
  8. package/dist/cjs/api/resources/construe/client/Client.d.ts +7 -8
  9. package/dist/cjs/api/resources/construe/client/Client.js +33 -22
  10. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +55 -0
  11. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.js +12 -0
  12. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.d.ts +5 -0
  14. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +50 -0
  15. package/dist/cjs/api/resources/construe/errors/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/construe/errors/index.js +1 -0
  17. package/dist/cjs/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.ts +2 -0
  18. package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +1 -3
  19. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.d.ts +4 -4
  20. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.js +2 -2
  21. package/dist/cjs/api/resources/construe/types/index.d.ts +0 -3
  22. package/dist/cjs/api/resources/construe/types/index.js +0 -3
  23. package/dist/cjs/api/resources/fhir/client/Client.js +12 -6
  24. package/dist/cjs/api/resources/fhirProvider/client/Client.js +14 -7
  25. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +0 -2
  26. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +10 -5
  27. package/dist/cjs/api/resources/summary/client/Client.js +12 -6
  28. package/dist/cjs/api/resources/summary/types/SummaryTemplate.d.ts +0 -1
  29. package/dist/cjs/api/resources/tools/client/Client.js +8 -4
  30. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +8 -4
  31. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +8 -4
  32. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +0 -2
  33. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +0 -2
  34. package/dist/cjs/api/resources/workflows/client/Client.js +12 -6
  35. package/dist/cjs/api/resources/workflows/types/WorkflowDefinition.d.ts +0 -2
  36. package/dist/cjs/api/resources/workflows/types/WorkflowResponse.d.ts +0 -2
  37. package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -1
  38. package/dist/cjs/core/fetcher/Fetcher.js +4 -4
  39. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  40. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  41. package/dist/cjs/core/headers.js +6 -4
  42. package/dist/cjs/version.d.ts +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/esm/BaseClient.d.mts +2 -0
  45. package/dist/esm/Client.mjs +2 -2
  46. package/dist/esm/api/resources/agent/client/Client.mjs +16 -8
  47. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +14 -7
  48. package/dist/esm/api/resources/agent/types/ChatMessageTemplate.d.mts +0 -2
  49. package/dist/esm/api/resources/agent/types/ChatSessionTemplate.d.mts +0 -2
  50. package/dist/esm/api/resources/cohort/client/Client.mjs +2 -1
  51. package/dist/esm/api/resources/construe/client/Client.d.mts +7 -8
  52. package/dist/esm/api/resources/construe/client/Client.mjs +33 -22
  53. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +55 -0
  54. package/dist/esm/api/resources/construe/client/requests/UploadRequest.mjs +9 -0
  55. package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -0
  56. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.d.mts +5 -0
  57. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +13 -0
  58. package/dist/esm/api/resources/construe/errors/index.d.mts +1 -0
  59. package/dist/esm/api/resources/construe/errors/index.mjs +1 -0
  60. package/dist/esm/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.mts +2 -0
  61. package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +1 -3
  62. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.d.mts +4 -4
  63. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.mjs +2 -2
  64. package/dist/esm/api/resources/construe/types/index.d.mts +0 -3
  65. package/dist/esm/api/resources/construe/types/index.mjs +0 -3
  66. package/dist/esm/api/resources/fhir/client/Client.mjs +12 -6
  67. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +14 -7
  68. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +0 -2
  69. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +10 -5
  70. package/dist/esm/api/resources/summary/client/Client.mjs +12 -6
  71. package/dist/esm/api/resources/summary/types/SummaryTemplate.d.mts +0 -1
  72. package/dist/esm/api/resources/tools/client/Client.mjs +8 -4
  73. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +8 -4
  74. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +8 -4
  75. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +0 -2
  76. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +0 -2
  77. package/dist/esm/api/resources/workflows/client/Client.mjs +12 -6
  78. package/dist/esm/api/resources/workflows/types/WorkflowDefinition.d.mts +0 -2
  79. package/dist/esm/api/resources/workflows/types/WorkflowResponse.d.mts +0 -2
  80. package/dist/esm/core/fetcher/Fetcher.d.mts +2 -1
  81. package/dist/esm/core/fetcher/Fetcher.mjs +4 -4
  82. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  83. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  84. package/dist/esm/core/headers.mjs +6 -4
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/package.json +2 -2
  88. package/reference.md +6 -8
  89. package/dist/cjs/api/resources/construe/types/UploadRequest.d.ts +0 -10
  90. package/dist/cjs/api/resources/construe/types/UploadRequest.js +0 -3
  91. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.d.ts +0 -32
  92. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.js +0 -3
  93. package/dist/cjs/api/resources/construe/types/UploadRequestJson.d.ts +0 -40
  94. package/dist/cjs/api/resources/construe/types/UploadRequestJson.js +0 -3
  95. package/dist/esm/api/resources/construe/types/UploadRequest.d.mts +0 -10
  96. package/dist/esm/api/resources/construe/types/UploadRequest.mjs +0 -2
  97. package/dist/esm/api/resources/construe/types/UploadRequestCsv.d.mts +0 -32
  98. package/dist/esm/api/resources/construe/types/UploadRequestCsv.mjs +0 -2
  99. package/dist/esm/api/resources/construe/types/UploadRequestJson.d.mts +0 -40
  100. package/dist/esm/api/resources/construe/types/UploadRequestJson.mjs +0 -2
@@ -11,6 +11,8 @@ export interface BaseClientOptions {
11
11
  timeoutInSeconds?: number;
12
12
  /** The default number of times to retry the request. Defaults to 2. */
13
13
  maxRetries?: number;
14
+ /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
15
+ fetch?: typeof fetch;
14
16
  fetcher?: core.FetchFunction;
15
17
  }
16
18
  export interface BaseRequestOptions {
@@ -52,8 +52,8 @@ class phenomlClient {
52
52
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "phenoml",
55
- "X-Fern-SDK-Version": "5.3.0",
56
- "User-Agent": "phenoml/5.3.0",
55
+ "X-Fern-SDK-Version": "6.1.0",
56
+ "User-Agent": "phenoml/6.1.0",
57
57
  "X-Fern-Runtime": core.RUNTIME.type,
58
58
  "X-Fern-Runtime-Version": core.RUNTIME.version,
59
59
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -92,7 +92,7 @@ class Agent {
92
92
  }
93
93
  __create(request, requestOptions) {
94
94
  return __awaiter(this, void 0, void 0, function* () {
95
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
95
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
96
96
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
97
97
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
98
98
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/create"),
@@ -105,6 +105,7 @@ class Agent {
105
105
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
106
106
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
107
107
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
108
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
108
109
  });
109
110
  if (_response.ok) {
110
111
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -164,7 +165,7 @@ class Agent {
164
165
  }
165
166
  __list() {
166
167
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
167
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
168
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
168
169
  const { tags } = request;
169
170
  const _queryParams = {};
170
171
  if (tags != null) {
@@ -179,6 +180,7 @@ class Agent {
179
180
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
180
181
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
181
182
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
183
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
182
184
  });
183
185
  if (_response.ok) {
184
186
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -235,7 +237,7 @@ class Agent {
235
237
  }
236
238
  __get(id, requestOptions) {
237
239
  return __awaiter(this, void 0, void 0, function* () {
238
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
240
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
239
241
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
240
242
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
241
243
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -245,6 +247,7 @@ class Agent {
245
247
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
246
248
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
247
249
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
250
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
248
251
  });
249
252
  if (_response.ok) {
250
253
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -309,7 +312,7 @@ class Agent {
309
312
  }
310
313
  __update(id, request, requestOptions) {
311
314
  return __awaiter(this, void 0, void 0, function* () {
312
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
315
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
313
316
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
314
317
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
315
318
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -322,6 +325,7 @@ class Agent {
322
325
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
323
326
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
324
327
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
328
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
325
329
  });
326
330
  if (_response.ok) {
327
331
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -382,7 +386,7 @@ class Agent {
382
386
  }
383
387
  __delete(id, requestOptions) {
384
388
  return __awaiter(this, void 0, void 0, function* () {
385
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
389
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
386
390
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
387
391
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
388
392
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -392,6 +396,7 @@ class Agent {
392
396
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
393
397
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
394
398
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
399
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
395
400
  });
396
401
  if (_response.ok) {
397
402
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -463,7 +468,7 @@ class Agent {
463
468
  }
464
469
  __patch(id, request, requestOptions) {
465
470
  return __awaiter(this, void 0, void 0, function* () {
466
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
471
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
467
472
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
468
473
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
469
474
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -476,6 +481,7 @@ class Agent {
476
481
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
477
482
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
478
483
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
484
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
479
485
  });
480
486
  if (_response.ok) {
481
487
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -541,7 +547,7 @@ class Agent {
541
547
  }
542
548
  __chat(request, requestOptions) {
543
549
  return __awaiter(this, void 0, void 0, function* () {
544
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
550
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
545
551
  const { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
546
552
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
547
553
  Authorization: yield this._getAuthorizationHeader(),
@@ -559,6 +565,7 @@ class Agent {
559
565
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
560
566
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
561
567
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
568
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
562
569
  });
563
570
  if (_response.ok) {
564
571
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -621,7 +628,7 @@ class Agent {
621
628
  }
622
629
  __getChatMessages(request, requestOptions) {
623
630
  return __awaiter(this, void 0, void 0, function* () {
624
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
631
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
625
632
  const { chat_session_id: chatSessionId, num_messages: numMessages, role, order } = request;
626
633
  const _queryParams = {};
627
634
  _queryParams.chat_session_id = chatSessionId;
@@ -643,6 +650,7 @@ class Agent {
643
650
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
644
651
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
645
652
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
653
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
646
654
  });
647
655
  if (_response.ok) {
648
656
  return {
@@ -75,7 +75,7 @@ class Prompts {
75
75
  }
76
76
  __create(request, requestOptions) {
77
77
  return __awaiter(this, void 0, void 0, function* () {
78
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
79
79
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
80
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
81
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts"),
@@ -88,6 +88,7 @@ class Prompts {
88
88
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
89
89
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
90
90
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
91
92
  });
92
93
  if (_response.ok) {
93
94
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -144,7 +145,7 @@ class Prompts {
144
145
  }
145
146
  __list(requestOptions) {
146
147
  return __awaiter(this, void 0, void 0, function* () {
147
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
148
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
148
149
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
149
150
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
150
151
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts/list"),
@@ -154,6 +155,7 @@ class Prompts {
154
155
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
155
156
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
156
157
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
158
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
157
159
  });
158
160
  if (_response.ok) {
159
161
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -210,7 +212,7 @@ class Prompts {
210
212
  }
211
213
  __get(id, requestOptions) {
212
214
  return __awaiter(this, void 0, void 0, function* () {
213
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
215
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
214
216
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
215
217
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
216
218
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -220,6 +222,7 @@ class Prompts {
220
222
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
221
223
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
222
224
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
225
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
223
226
  });
224
227
  if (_response.ok) {
225
228
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -280,7 +283,7 @@ class Prompts {
280
283
  }
281
284
  __update(id_1) {
282
285
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
283
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
286
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
284
287
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
288
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
286
289
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -293,6 +296,7 @@ class Prompts {
293
296
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
294
297
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
295
298
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
299
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
296
300
  });
297
301
  if (_response.ok) {
298
302
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -353,7 +357,7 @@ class Prompts {
353
357
  }
354
358
  __delete(id, requestOptions) {
355
359
  return __awaiter(this, void 0, void 0, function* () {
356
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
360
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
357
361
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
358
362
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
359
363
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -363,6 +367,7 @@ class Prompts {
363
367
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
364
368
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
365
369
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
370
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
366
371
  });
367
372
  if (_response.ok) {
368
373
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -434,7 +439,7 @@ class Prompts {
434
439
  }
435
440
  __patch(id, request, requestOptions) {
436
441
  return __awaiter(this, void 0, void 0, function* () {
437
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
442
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
438
443
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
439
444
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
440
445
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -447,6 +452,7 @@ class Prompts {
447
452
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
448
453
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
449
454
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
455
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
450
456
  });
451
457
  if (_response.ok) {
452
458
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -505,7 +511,7 @@ class Prompts {
505
511
  }
506
512
  __loadDefaults(requestOptions) {
507
513
  return __awaiter(this, void 0, void 0, function* () {
508
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
514
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
509
515
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
510
516
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
511
517
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts/load-defaults"),
@@ -515,6 +521,7 @@ class Prompts {
515
521
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
516
522
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
517
523
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
524
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
518
525
  });
519
526
  if (_response.ok) {
520
527
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -17,8 +17,6 @@ export interface ChatMessageTemplate {
17
17
  created?: string;
18
18
  /** Message updated time */
19
19
  updated?: string;
20
- /** User ID */
21
- user_id?: string;
22
20
  /** Function name */
23
21
  function_name?: string;
24
22
  /** Function arguments */
@@ -1,8 +1,6 @@
1
1
  export interface ChatSessionTemplate {
2
2
  /** Chat session ID */
3
3
  id?: string;
4
- /** User ID */
5
- user_id?: string;
6
4
  /** Chat session ID */
7
5
  session_id?: string;
8
6
  /** Chat session status */
@@ -73,7 +73,7 @@ class Cohort {
73
73
  }
74
74
  __analyze(request, requestOptions) {
75
75
  return __awaiter(this, void 0, void 0, function* () {
76
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
77
77
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
78
78
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
79
79
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "cohort"),
@@ -86,6 +86,7 @@ class Cohort {
86
86
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
87
87
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
88
88
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
89
90
  });
90
91
  if (_response.ok) {
91
92
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -12,8 +12,9 @@ export declare class Construe {
12
12
  constructor(_options: Construe.Options);
13
13
  /**
14
14
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
15
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
16
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
15
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
16
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
17
+ * transitions from "processing" to "ready" or "failed".
17
18
  *
18
19
  * @param {phenoml.construe.UploadRequest} request
19
20
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,12 +28,9 @@ export declare class Construe {
27
28
  *
28
29
  * @example
29
30
  * await client.construe.uploadCodeSystem({
30
- * format: "csv",
31
31
  * name: "CUSTOM_CODES",
32
32
  * version: "1.0",
33
- * file: "file",
34
- * code_col: "code",
35
- * desc_col: "description"
33
+ * format: "csv"
36
34
  * })
37
35
  */
38
36
  uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
@@ -47,8 +45,10 @@ export declare class Construe {
47
45
  *
48
46
  * @throws {@link phenoml.construe.BadRequestError}
49
47
  * @throws {@link phenoml.construe.UnauthorizedError}
50
- * @throws {@link phenoml.construe.FailedDependencyError}
48
+ * @throws {@link phenoml.construe.NotFoundError}
51
49
  * @throws {@link phenoml.construe.InternalServerError}
50
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
51
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
52
52
  *
53
53
  * @example
54
54
  * await client.construe.extractCodes({
@@ -253,7 +253,6 @@ export declare class Construe {
253
253
  * @throws {@link phenoml.construe.NotFoundError}
254
254
  * @throws {@link phenoml.construe.InternalServerError}
255
255
  * @throws {@link phenoml.construe.NotImplementedError}
256
- * @throws {@link phenoml.construe.ServiceUnavailableError}
257
256
  *
258
257
  * @example
259
258
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -55,8 +55,9 @@ class Construe {
55
55
  }
56
56
  /**
57
57
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
58
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
59
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
58
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
59
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
60
+ * transitions from "processing" to "ready" or "failed".
60
61
  *
61
62
  * @param {phenoml.construe.UploadRequest} request
62
63
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -70,12 +71,9 @@ class Construe {
70
71
  *
71
72
  * @example
72
73
  * await client.construe.uploadCodeSystem({
73
- * format: "csv",
74
74
  * name: "CUSTOM_CODES",
75
75
  * version: "1.0",
76
- * file: "file",
77
- * code_col: "code",
78
- * desc_col: "description"
76
+ * format: "csv"
79
77
  * })
80
78
  */
81
79
  uploadCodeSystem(request, requestOptions) {
@@ -83,7 +81,7 @@ class Construe {
83
81
  }
84
82
  __uploadCodeSystem(request, requestOptions) {
85
83
  return __awaiter(this, void 0, void 0, function* () {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
84
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
87
85
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
88
86
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
89
87
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/upload"),
@@ -96,6 +94,7 @@ class Construe {
96
94
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
97
95
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
98
96
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
97
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
99
98
  });
100
99
  if (_response.ok) {
101
100
  return {
@@ -152,8 +151,10 @@ class Construe {
152
151
  *
153
152
  * @throws {@link phenoml.construe.BadRequestError}
154
153
  * @throws {@link phenoml.construe.UnauthorizedError}
155
- * @throws {@link phenoml.construe.FailedDependencyError}
154
+ * @throws {@link phenoml.construe.NotFoundError}
156
155
  * @throws {@link phenoml.construe.InternalServerError}
156
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
157
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
157
158
  *
158
159
  * @example
159
160
  * await client.construe.extractCodes({
@@ -165,7 +166,7 @@ class Construe {
165
166
  }
166
167
  __extractCodes(request, requestOptions) {
167
168
  return __awaiter(this, void 0, void 0, function* () {
168
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
169
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
169
170
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
170
171
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
171
172
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/extract"),
@@ -178,6 +179,7 @@ class Construe {
178
179
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
179
180
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
180
181
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
182
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
181
183
  });
182
184
  if (_response.ok) {
183
185
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -188,10 +190,14 @@ class Construe {
188
190
  throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
189
191
  case 401:
190
192
  throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
191
- case 424:
192
- throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
193
+ case 404:
194
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
193
195
  case 500:
194
196
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
197
+ case 503:
198
+ throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
199
+ case 504:
200
+ throw new phenoml.construe.GatewayTimeoutError(_response.error.body, _response.rawResponse);
195
201
  default:
196
202
  throw new errors.phenomlError({
197
203
  statusCode: _response.error.statusCode,
@@ -233,7 +239,7 @@ class Construe {
233
239
  }
234
240
  __listAvailableCodeSystems(requestOptions) {
235
241
  return __awaiter(this, void 0, void 0, function* () {
236
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
242
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
237
243
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
238
244
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
239
245
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/codes/systems"),
@@ -243,6 +249,7 @@ class Construe {
243
249
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
244
250
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
245
251
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
252
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
246
253
  });
247
254
  if (_response.ok) {
248
255
  return {
@@ -303,7 +310,7 @@ class Construe {
303
310
  }
304
311
  __getCodeSystemDetail(codesystem_1) {
305
312
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
306
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
313
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
307
314
  const { version } = request;
308
315
  const _queryParams = {};
309
316
  if (version != null) {
@@ -318,6 +325,7 @@ class Construe {
318
325
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
319
326
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
320
327
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
328
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
321
329
  });
322
330
  if (_response.ok) {
323
331
  return {
@@ -384,7 +392,7 @@ class Construe {
384
392
  }
385
393
  __deleteCustomCodeSystem(codesystem_1) {
386
394
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
387
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
395
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
388
396
  const { version } = request;
389
397
  const _queryParams = {};
390
398
  if (version != null) {
@@ -399,6 +407,7 @@ class Construe {
399
407
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
400
408
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
401
409
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
410
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
402
411
  });
403
412
  if (_response.ok) {
404
413
  return {
@@ -470,7 +479,7 @@ class Construe {
470
479
  }
471
480
  __exportCustomCodeSystem(codesystem_1) {
472
481
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
473
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
482
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
474
483
  const { version } = request;
475
484
  const _queryParams = {};
476
485
  if (version != null) {
@@ -485,6 +494,7 @@ class Construe {
485
494
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
486
495
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
487
496
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
488
498
  });
489
499
  if (_response.ok) {
490
500
  return {
@@ -559,7 +569,7 @@ class Construe {
559
569
  }
560
570
  __listCodesInACodeSystem(codesystem_1) {
561
571
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
562
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
572
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
563
573
  const { version, cursor, limit } = request;
564
574
  const _queryParams = {};
565
575
  if (version != null) {
@@ -580,6 +590,7 @@ class Construe {
580
590
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
581
591
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
582
592
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
593
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
583
594
  });
584
595
  if (_response.ok) {
585
596
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -644,7 +655,7 @@ class Construe {
644
655
  }
645
656
  __getASpecificCode(codesystem_1, codeId_1) {
646
657
  return __awaiter(this, arguments, void 0, function* (codesystem, codeId, request = {}, requestOptions) {
647
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
658
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
648
659
  const { version } = request;
649
660
  const _queryParams = {};
650
661
  if (version != null) {
@@ -659,6 +670,7 @@ class Construe {
659
670
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
660
671
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
661
672
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
673
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
662
674
  });
663
675
  if (_response.ok) {
664
676
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -740,7 +752,7 @@ class Construe {
740
752
  }
741
753
  __semanticSearchEmbeddingBased(codesystem, request, requestOptions) {
742
754
  return __awaiter(this, void 0, void 0, function* () {
743
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
755
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
744
756
  const { text, version, limit } = request;
745
757
  const _queryParams = {};
746
758
  _queryParams.text = text;
@@ -759,6 +771,7 @@ class Construe {
759
771
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
760
772
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
761
773
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
774
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
762
775
  });
763
776
  if (_response.ok) {
764
777
  return {
@@ -836,7 +849,6 @@ class Construe {
836
849
  * @throws {@link phenoml.construe.NotFoundError}
837
850
  * @throws {@link phenoml.construe.InternalServerError}
838
851
  * @throws {@link phenoml.construe.NotImplementedError}
839
- * @throws {@link phenoml.construe.ServiceUnavailableError}
840
852
  *
841
853
  * @example
842
854
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -850,7 +862,7 @@ class Construe {
850
862
  }
851
863
  __terminologyServerTextSearch(codesystem, request, requestOptions) {
852
864
  return __awaiter(this, void 0, void 0, function* () {
853
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
865
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
854
866
  const { q, version, limit } = request;
855
867
  const _queryParams = {};
856
868
  _queryParams.q = q;
@@ -869,6 +881,7 @@ class Construe {
869
881
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
870
882
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
871
883
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
884
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
872
885
  });
873
886
  if (_response.ok) {
874
887
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -885,8 +898,6 @@ class Construe {
885
898
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
886
899
  case 501:
887
900
  throw new phenoml.construe.NotImplementedError(_response.error.body, _response.rawResponse);
888
- case 503:
889
- throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
890
901
  default:
891
902
  throw new errors.phenomlError({
892
903
  statusCode: _response.error.statusCode,