phenoml 13.0.0 → 14.0.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 (174) hide show
  1. package/dist/cjs/BaseClient.d.ts +3 -0
  2. package/dist/cjs/BaseClient.js +17 -2
  3. package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
  4. package/dist/cjs/api/resources/agent/client/Client.js +41 -21
  5. package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +11 -0
  6. package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +1 -0
  7. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +13 -25
  8. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +19 -70
  9. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +4 -1
  10. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +7 -1
  11. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +4 -1
  12. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +5 -2
  13. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
  14. package/dist/cjs/api/resources/cohort/client/Client.js +1 -1
  15. package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
  16. package/dist/cjs/api/resources/construe/client/Client.js +134 -22
  17. package/dist/cjs/api/resources/construe/client/requests/ExtractRequest.d.ts +60 -1
  18. package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +14 -7
  19. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +18 -1
  20. package/dist/cjs/api/resources/fhir/client/Client.js +10 -6
  21. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -7
  22. package/dist/cjs/api/resources/fhirProvider/client/Client.js +17 -14
  23. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +5 -3
  24. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +1 -1
  25. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +1 -1
  26. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +6 -4
  27. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +10 -5
  28. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +17 -6
  29. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +23 -12
  30. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +2 -1
  31. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +9 -2
  32. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -1
  33. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +1 -1
  34. package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -1
  35. package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
  36. package/dist/cjs/api/resources/summary/client/Client.d.ts +74 -9
  37. package/dist/cjs/api/resources/summary/client/Client.js +80 -15
  38. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +67 -11
  39. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.ts +4 -4
  40. package/dist/cjs/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.ts +4 -4
  41. package/dist/cjs/api/resources/summary/types/index.d.ts +0 -2
  42. package/dist/cjs/api/resources/summary/types/index.js +0 -2
  43. package/dist/cjs/api/resources/tools/client/Client.d.ts +7 -3
  44. package/dist/cjs/api/resources/tools/client/Client.js +11 -7
  45. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +1 -0
  46. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +3 -2
  47. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +3 -1
  48. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +4 -4
  49. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +4 -4
  50. package/dist/cjs/api/resources/tools/types/McpServer.d.ts +10 -0
  51. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +12 -16
  52. package/dist/cjs/api/resources/tools/types/McpServerTool.d.ts +14 -0
  53. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +7 -20
  54. package/dist/cjs/api/resources/tools/types/index.d.ts +2 -0
  55. package/dist/cjs/api/resources/tools/types/index.js +2 -0
  56. package/dist/cjs/api/resources/workflows/client/Client.d.ts +21 -9
  57. package/dist/cjs/api/resources/workflows/client/Client.js +43 -15
  58. package/dist/cjs/api/resources/workflows/client/requests/CreateWorkflowRequest.d.ts +3 -2
  59. package/dist/cjs/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.ts +11 -1
  60. package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.ts +6 -5
  61. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  62. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  63. package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
  64. package/dist/cjs/core/auth/BasicAuth.js +7 -1
  65. package/dist/cjs/core/auth/index.d.ts +1 -1
  66. package/dist/cjs/core/auth/index.js +3 -1
  67. package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
  68. package/dist/cjs/core/fetcher/Fetcher.js +13 -8
  69. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  70. package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
  71. package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
  72. package/dist/cjs/core/url/index.d.ts +1 -0
  73. package/dist/cjs/core/url/index.js +3 -1
  74. package/dist/cjs/core/url/qs.d.ts +2 -1
  75. package/dist/cjs/core/url/qs.js +24 -12
  76. package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
  77. package/dist/cjs/errors/phenomlError.d.ts +3 -1
  78. package/dist/cjs/errors/phenomlError.js +4 -1
  79. package/dist/cjs/errors/phenomlTimeoutError.d.ts +4 -1
  80. package/dist/cjs/errors/phenomlTimeoutError.js +4 -1
  81. package/dist/cjs/version.d.ts +1 -1
  82. package/dist/cjs/version.js +1 -1
  83. package/dist/esm/BaseClient.d.mts +3 -0
  84. package/dist/esm/BaseClient.mjs +17 -2
  85. package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
  86. package/dist/esm/api/resources/agent/client/Client.mjs +41 -21
  87. package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +11 -0
  88. package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +1 -0
  89. package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +13 -25
  90. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +19 -70
  91. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +4 -1
  92. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +7 -1
  93. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +4 -1
  94. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +5 -2
  95. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
  96. package/dist/esm/api/resources/cohort/client/Client.mjs +1 -1
  97. package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
  98. package/dist/esm/api/resources/construe/client/Client.mjs +134 -22
  99. package/dist/esm/api/resources/construe/client/requests/ExtractRequest.d.mts +60 -1
  100. package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +14 -7
  101. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +18 -1
  102. package/dist/esm/api/resources/fhir/client/Client.mjs +10 -6
  103. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -7
  104. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +17 -14
  105. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +5 -3
  106. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +1 -1
  107. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +1 -1
  108. package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +6 -4
  109. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +10 -5
  110. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +17 -6
  111. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +23 -12
  112. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +2 -1
  113. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +9 -2
  114. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -1
  115. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +1 -1
  116. package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -1
  117. package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
  118. package/dist/esm/api/resources/summary/client/Client.d.mts +74 -9
  119. package/dist/esm/api/resources/summary/client/Client.mjs +80 -15
  120. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +67 -11
  121. package/dist/esm/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.mts +4 -4
  122. package/dist/esm/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.mts +4 -4
  123. package/dist/esm/api/resources/summary/types/index.d.mts +0 -2
  124. package/dist/esm/api/resources/summary/types/index.mjs +0 -2
  125. package/dist/esm/api/resources/tools/client/Client.d.mts +7 -3
  126. package/dist/esm/api/resources/tools/client/Client.mjs +11 -7
  127. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +1 -0
  128. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +3 -2
  129. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +3 -1
  130. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +4 -4
  131. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +4 -4
  132. package/dist/esm/api/resources/tools/types/McpServer.d.mts +10 -0
  133. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +12 -16
  134. package/dist/esm/api/resources/tools/types/McpServerTool.d.mts +14 -0
  135. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +7 -20
  136. package/dist/esm/api/resources/tools/types/index.d.mts +2 -0
  137. package/dist/esm/api/resources/tools/types/index.mjs +2 -0
  138. package/dist/esm/api/resources/workflows/client/Client.d.mts +21 -9
  139. package/dist/esm/api/resources/workflows/client/Client.mjs +43 -15
  140. package/dist/esm/api/resources/workflows/client/requests/CreateWorkflowRequest.d.mts +3 -2
  141. package/dist/esm/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.mts +11 -1
  142. package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.mts +6 -5
  143. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  144. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  145. package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
  146. package/dist/esm/core/auth/BasicAuth.mjs +7 -1
  147. package/dist/esm/core/auth/index.d.mts +1 -1
  148. package/dist/esm/core/auth/index.mjs +1 -0
  149. package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
  150. package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
  151. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  152. package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
  153. package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
  154. package/dist/esm/core/url/index.d.mts +1 -0
  155. package/dist/esm/core/url/index.mjs +1 -0
  156. package/dist/esm/core/url/qs.d.mts +2 -1
  157. package/dist/esm/core/url/qs.mjs +24 -12
  158. package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
  159. package/dist/esm/errors/phenomlError.d.mts +3 -1
  160. package/dist/esm/errors/phenomlError.mjs +4 -1
  161. package/dist/esm/errors/phenomlTimeoutError.d.mts +4 -1
  162. package/dist/esm/errors/phenomlTimeoutError.mjs +4 -1
  163. package/dist/esm/version.d.mts +1 -1
  164. package/dist/esm/version.mjs +1 -1
  165. package/package.json +2 -2
  166. package/reference.md +140 -124
  167. package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +0 -13
  168. package/dist/cjs/api/resources/summary/types/FhirResource.d.ts +0 -6
  169. package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +0 -13
  170. package/dist/esm/api/resources/summary/types/FhirResource.d.mts +0 -6
  171. /package/dist/cjs/api/resources/{summary/types/FhirBundle.js → tools/types/McpServer.js} +0 -0
  172. /package/dist/cjs/api/resources/{summary/types/FhirResource.js → tools/types/McpServerTool.js} +0 -0
  173. /package/dist/esm/api/resources/{summary/types/FhirBundle.mjs → tools/types/McpServer.mjs} +0 -0
  174. /package/dist/esm/api/resources/{summary/types/FhirResource.mjs → tools/types/McpServerTool.mjs} +0 -0
@@ -50,11 +50,14 @@ function handleNonStatusCodeError(error, rawResponse, method, path) {
50
50
  rawResponse: rawResponse,
51
51
  });
52
52
  case "timeout":
53
- throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
53
+ throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
54
+ cause: error.cause,
55
+ });
54
56
  case "unknown":
55
57
  throw new errors.phenomlError({
56
58
  message: error.errorMessage,
57
59
  rawResponse: rawResponse,
60
+ cause: error.cause,
58
61
  });
59
62
  default:
60
63
  throw new errors.phenomlError({
@@ -3,10 +3,12 @@ export declare class phenomlError extends Error {
3
3
  readonly statusCode?: number;
4
4
  readonly body?: unknown;
5
5
  readonly rawResponse?: core.RawResponse;
6
- constructor({ message, statusCode, body, rawResponse, }: {
6
+ readonly cause?: unknown;
7
+ constructor({ message, statusCode, body, rawResponse, cause, }: {
7
8
  message?: string;
8
9
  statusCode?: number;
9
10
  body?: unknown;
10
11
  rawResponse?: core.RawResponse;
12
+ cause?: unknown;
11
13
  });
12
14
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.phenomlError = void 0;
5
5
  const json_js_1 = require("../core/json.js");
6
6
  class phenomlError extends Error {
7
- constructor({ message, statusCode, body, rawResponse, }) {
7
+ constructor({ message, statusCode, body, rawResponse, cause, }) {
8
8
  super(buildMessage({ message, statusCode, body }));
9
9
  Object.setPrototypeOf(this, new.target.prototype);
10
10
  if (Error.captureStackTrace) {
@@ -14,6 +14,9 @@ class phenomlError extends Error {
14
14
  this.statusCode = statusCode;
15
15
  this.body = body;
16
16
  this.rawResponse = rawResponse;
17
+ if (cause != null) {
18
+ this.cause = cause;
19
+ }
17
20
  }
18
21
  }
19
22
  exports.phenomlError = phenomlError;
@@ -1,3 +1,6 @@
1
1
  export declare class phenomlTimeoutError extends Error {
2
- constructor(message: string);
2
+ readonly cause?: unknown;
3
+ constructor(message: string, opts?: {
4
+ cause?: unknown;
5
+ });
3
6
  }
@@ -3,13 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.phenomlTimeoutError = void 0;
5
5
  class phenomlTimeoutError extends Error {
6
- constructor(message) {
6
+ constructor(message, opts) {
7
7
  super(message);
8
8
  Object.setPrototypeOf(this, new.target.prototype);
9
9
  if (Error.captureStackTrace) {
10
10
  Error.captureStackTrace(this, this.constructor);
11
11
  }
12
12
  this.name = this.constructor.name;
13
+ if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
14
+ this.cause = opts.cause;
15
+ }
13
16
  }
14
17
  }
15
18
  exports.phenomlTimeoutError = phenomlTimeoutError;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "13.0.0";
1
+ export declare const SDK_VERSION = "14.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "13.0.0";
4
+ exports.SDK_VERSION = "14.0.0";
@@ -1,6 +1,7 @@
1
1
  import { OAuthAuthProvider } from "./auth/OAuthAuthProvider.mjs";
2
2
  import * as core from "./core/index.mjs";
3
3
  import type * as environments from "./environments.mjs";
4
+ export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | OAuthAuthProvider.AuthOptions;
4
5
  export type BaseClientOptions = {
5
6
  environment?: core.Supplier<environments.phenomlEnvironment | string>;
6
7
  /** Specify a custom URL to connect the client to. */
@@ -16,6 +17,8 @@ export type BaseClientOptions = {
16
17
  fetcher?: core.FetchFunction;
17
18
  /** Configure logging for the client. */
18
19
  logging?: core.logging.LogConfig | core.logging.Logger;
20
+ /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
21
+ auth?: AuthOption;
19
22
  } & OAuthAuthProvider.AuthOptions;
20
23
  export interface BaseRequestOptions {
21
24
  /** The maximum time to wait for a response in seconds. */
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "13.0.0",
10
- "User-Agent": "phenoml/13.0.0",
9
+ "X-Fern-SDK-Version": "14.0.0",
10
+ "User-Agent": "phenoml/14.0.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -16,6 +16,21 @@ export function normalizeClientOptions(options) {
16
16
  export function normalizeClientOptionsWithAuth(options) {
17
17
  var _a;
18
18
  const normalized = normalizeClientOptions(options);
19
+ if (options.auth === false) {
20
+ normalized.authProvider = new core.NoOpAuthProvider();
21
+ return normalized;
22
+ }
23
+ if (options.auth != null) {
24
+ if (typeof options.auth === "function") {
25
+ normalized.authProvider = { getAuthRequest: options.auth };
26
+ return normalized;
27
+ }
28
+ if (core.isAuthProvider(options.auth)) {
29
+ normalized.authProvider = options.auth;
30
+ return normalized;
31
+ }
32
+ Object.assign(normalized, options.auth);
33
+ }
19
34
  const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
20
35
  (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = OAuthAuthProvider.createInstance(normalizedWithNoOpAuthProvider));
21
36
  return normalized;
@@ -26,9 +26,11 @@ export declare class AgentClient {
26
26
  *
27
27
  * @example
28
28
  * await client.agent.create({
29
- * name: "name",
30
- * prompts: ["prompt_123", "prompt_456"],
31
- * provider: "provider"
29
+ * name: "Medical Assistant",
30
+ * description: "An AI assistant for medical information processing",
31
+ * prompts: ["prompt_123"],
32
+ * tags: ["medical", "fhir"],
33
+ * provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
32
34
  * })
33
35
  */
34
36
  create(request: phenoml.agent.AgentCreateRequest, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentResponse>;
@@ -81,9 +83,11 @@ export declare class AgentClient {
81
83
  *
82
84
  * @example
83
85
  * await client.agent.update("id", {
84
- * name: "name",
85
- * prompts: ["prompt_123", "prompt_456"],
86
- * provider: "provider"
86
+ * name: "Medical Assistant",
87
+ * description: "Updated description for the medical assistant",
88
+ * prompts: ["prompt_123"],
89
+ * tags: ["medical", "fhir", "updated"],
90
+ * provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
87
91
  * })
88
92
  */
89
93
  update(id: string, request: phenoml.agent.AgentCreateRequest, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentResponse>;
@@ -120,15 +124,12 @@ export declare class AgentClient {
120
124
  * @example
121
125
  * await client.agent.patch("id", [{
122
126
  * op: "replace",
123
- * path: "/name",
124
- * value: "Updated Agent Name"
127
+ * path: "/description",
128
+ * value: "patched description"
125
129
  * }, {
126
130
  * op: "add",
127
131
  * path: "/tags/-",
128
- * value: "new-tag"
129
- * }, {
130
- * op: "remove",
131
- * path: "/description"
132
+ * value: "updated"
132
133
  * }])
133
134
  */
134
135
  patch(id: string, request: phenoml.agent.JsonPatch, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentResponse>;
@@ -149,8 +150,19 @@ export declare class AgentClient {
149
150
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
150
151
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
151
152
  * message: "What is the patient's current condition?",
153
+ * session_id: "session-abc123",
152
154
  * agent_id: "agent-123"
153
155
  * })
156
+ *
157
+ * @example
158
+ * await client.agent.chat({
159
+ * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
160
+ * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
161
+ * message: "Create a patient record for Jane Doe, 32F, diagnosed with iron deficiency anemia. Prescribe ferrous sulfate 325mg daily.",
162
+ * session_id: "session-def456",
163
+ * agent_id: "agent-123",
164
+ * enhanced_reasoning: true
165
+ * })
154
166
  */
155
167
  chat(request: phenoml.agent.AgentChatRequest, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentChatResponse>;
156
168
  private __chat;
@@ -48,9 +48,11 @@ export class AgentClient {
48
48
  *
49
49
  * @example
50
50
  * await client.agent.create({
51
- * name: "name",
52
- * prompts: ["prompt_123", "prompt_456"],
53
- * provider: "provider"
51
+ * name: "Medical Assistant",
52
+ * description: "An AI assistant for medical information processing",
53
+ * prompts: ["prompt_123"],
54
+ * tags: ["medical", "fhir"],
55
+ * provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
54
56
  * })
55
57
  */
56
58
  create(request, requestOptions) {
@@ -66,7 +68,7 @@ export class AgentClient {
66
68
  method: "POST",
67
69
  headers: _headers,
68
70
  contentType: "application/json",
69
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
71
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
70
72
  requestType: "json",
71
73
  body: request,
72
74
  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,
@@ -130,7 +132,11 @@ export class AgentClient {
130
132
  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/list"),
131
133
  method: "GET",
132
134
  headers: _headers,
133
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
135
+ queryString: core.url
136
+ .queryBuilder()
137
+ .addMany(_queryParams)
138
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
139
+ .build(),
134
140
  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,
135
141
  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,
136
142
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -185,7 +191,7 @@ export class AgentClient {
185
191
  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)}`),
186
192
  method: "GET",
187
193
  headers: _headers,
188
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
194
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
189
195
  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,
190
196
  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,
191
197
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -231,9 +237,11 @@ export class AgentClient {
231
237
  *
232
238
  * @example
233
239
  * await client.agent.update("id", {
234
- * name: "name",
235
- * prompts: ["prompt_123", "prompt_456"],
236
- * provider: "provider"
240
+ * name: "Medical Assistant",
241
+ * description: "Updated description for the medical assistant",
242
+ * prompts: ["prompt_123"],
243
+ * tags: ["medical", "fhir", "updated"],
244
+ * provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
237
245
  * })
238
246
  */
239
247
  update(id, request, requestOptions) {
@@ -249,7 +257,7 @@ export class AgentClient {
249
257
  method: "PUT",
250
258
  headers: _headers,
251
259
  contentType: "application/json",
252
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
260
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
253
261
  requestType: "json",
254
262
  body: request,
255
263
  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,
@@ -310,7 +318,7 @@ export class AgentClient {
310
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)}`),
311
319
  method: "DELETE",
312
320
  headers: _headers,
313
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
321
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
314
322
  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,
315
323
  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,
316
324
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -357,15 +365,12 @@ export class AgentClient {
357
365
  * @example
358
366
  * await client.agent.patch("id", [{
359
367
  * op: "replace",
360
- * path: "/name",
361
- * value: "Updated Agent Name"
368
+ * path: "/description",
369
+ * value: "patched description"
362
370
  * }, {
363
371
  * op: "add",
364
372
  * path: "/tags/-",
365
- * value: "new-tag"
366
- * }, {
367
- * op: "remove",
368
- * path: "/description"
373
+ * value: "updated"
369
374
  * }])
370
375
  */
371
376
  patch(id, request, requestOptions) {
@@ -381,7 +386,7 @@ export class AgentClient {
381
386
  method: "PATCH",
382
387
  headers: _headers,
383
388
  contentType: "application/json+patch",
384
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
389
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
385
390
  requestType: "json",
386
391
  body: request,
387
392
  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,
@@ -432,8 +437,19 @@ export class AgentClient {
432
437
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
433
438
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
434
439
  * message: "What is the patient's current condition?",
440
+ * session_id: "session-abc123",
435
441
  * agent_id: "agent-123"
436
442
  * })
443
+ *
444
+ * @example
445
+ * await client.agent.chat({
446
+ * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
447
+ * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
448
+ * message: "Create a patient record for Jane Doe, 32F, diagnosed with iron deficiency anemia. Prescribe ferrous sulfate 325mg daily.",
449
+ * session_id: "session-def456",
450
+ * agent_id: "agent-123",
451
+ * enhanced_reasoning: true
452
+ * })
437
453
  */
438
454
  chat(request, requestOptions) {
439
455
  return core.HttpResponsePromise.fromPromise(this.__chat(request, requestOptions));
@@ -452,7 +468,7 @@ export class AgentClient {
452
468
  method: "POST",
453
469
  headers: _headers,
454
470
  contentType: "application/json",
455
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
471
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
456
472
  requestType: "json",
457
473
  body: _body,
458
474
  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,
@@ -507,7 +523,7 @@ export class AgentClient {
507
523
  method: "POST",
508
524
  headers: _headers,
509
525
  contentType: "application/json",
510
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
526
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
511
527
  requestType: "json",
512
528
  body: _body,
513
529
  responseType: "sse",
@@ -588,7 +604,11 @@ export class AgentClient {
588
604
  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/chat/messages"),
589
605
  method: "GET",
590
606
  headers: _headers,
591
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
607
+ queryString: core.url
608
+ .queryBuilder()
609
+ .addMany(_queryParams)
610
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
611
+ .build(),
592
612
  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,
593
613
  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,
594
614
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -4,8 +4,19 @@
4
4
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
5
5
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
6
6
  * message: "What is the patient's current condition?",
7
+ * session_id: "session-abc123",
7
8
  * agent_id: "agent-123"
8
9
  * }
10
+ *
11
+ * @example
12
+ * {
13
+ * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
14
+ * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
15
+ * message: "Create a patient record for Jane Doe, 32F, diagnosed with iron deficiency anemia. Prescribe ferrous sulfate 325mg daily.",
16
+ * session_id: "session-def456",
17
+ * agent_id: "agent-123",
18
+ * enhanced_reasoning: true
19
+ * }
9
20
  */
10
21
  export interface AgentChatRequest {
11
22
  /**
@@ -4,6 +4,7 @@
4
4
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
5
5
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
6
6
  * message: "What is the patient's current condition?",
7
+ * session_id: "session-abc123",
7
8
  * agent_id: "agent-123"
8
9
  * }
9
10
  */
@@ -24,7 +24,10 @@ export declare class PromptsClient {
24
24
  * @example
25
25
  * await client.agent.prompts.create({
26
26
  * name: "Medical Assistant System Prompt",
27
- * content: "You are a helpful medical assistant specialized in FHIR data processing..."
27
+ * description: "System prompt for medical assistant agent",
28
+ * content: "You are a helpful medical assistant specialized in FHIR data processing.",
29
+ * is_default: false,
30
+ * tags: ["medical", "system"]
28
31
  * })
29
32
  */
30
33
  create(request: phenoml.agent.AgentPromptsCreateRequest, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentPromptsResponse>;
@@ -73,7 +76,13 @@ export declare class PromptsClient {
73
76
  * @throws {@link phenoml.agent.InternalServerError}
74
77
  *
75
78
  * @example
76
- * await client.agent.prompts.update("id")
79
+ * await client.agent.prompts.update("id", {
80
+ * name: "Medical Assistant System Prompt",
81
+ * description: "Updated system prompt",
82
+ * content: "You are a helpful medical assistant. Always cite ICD-10 codes when discussing diagnoses.",
83
+ * is_default: false,
84
+ * tags: ["medical", "system", "updated"]
85
+ * })
77
86
  */
78
87
  update(id: string, request?: phenoml.agent.AgentPromptsUpdateRequest, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentPromptsResponse>;
79
88
  private __update;
@@ -109,31 +118,10 @@ export declare class PromptsClient {
109
118
  * @example
110
119
  * await client.agent.prompts.patch("id", [{
111
120
  * op: "replace",
112
- * path: "/name",
113
- * value: "Updated Agent Name"
114
- * }, {
115
- * op: "add",
116
- * path: "/tags/-",
117
- * value: "new-tag"
118
- * }, {
119
- * op: "remove",
120
- * path: "/description"
121
+ * path: "/content",
122
+ * value: "Updated prompt content."
121
123
  * }])
122
124
  */
123
125
  patch(id: string, request: phenoml.agent.JsonPatch, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentPromptsResponse>;
124
126
  private __patch;
125
- /**
126
- * Loads default agent prompts for the authenticated user
127
- *
128
- * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration.
129
- *
130
- * @throws {@link phenoml.agent.UnauthorizedError}
131
- * @throws {@link phenoml.agent.ForbiddenError}
132
- * @throws {@link phenoml.agent.InternalServerError}
133
- *
134
- * @example
135
- * await client.agent.prompts.loadDefaults()
136
- */
137
- loadDefaults(requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise<phenoml.agent.SuccessResponse>;
138
- private __loadDefaults;
139
127
  }
@@ -33,7 +33,10 @@ export class PromptsClient {
33
33
  * @example
34
34
  * await client.agent.prompts.create({
35
35
  * name: "Medical Assistant System Prompt",
36
- * content: "You are a helpful medical assistant specialized in FHIR data processing..."
36
+ * description: "System prompt for medical assistant agent",
37
+ * content: "You are a helpful medical assistant specialized in FHIR data processing.",
38
+ * is_default: false,
39
+ * tags: ["medical", "system"]
37
40
  * })
38
41
  */
39
42
  create(request, requestOptions) {
@@ -49,7 +52,7 @@ export class PromptsClient {
49
52
  method: "POST",
50
53
  headers: _headers,
51
54
  contentType: "application/json",
52
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
55
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
53
56
  requestType: "json",
54
57
  body: request,
55
58
  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,7 +109,7 @@ export class PromptsClient {
106
109
  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"),
107
110
  method: "GET",
108
111
  headers: _headers,
109
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
112
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
110
113
  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,
111
114
  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,
112
115
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -161,7 +164,7 @@ export class PromptsClient {
161
164
  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)}`),
162
165
  method: "GET",
163
166
  headers: _headers,
164
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
167
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
165
168
  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,
166
169
  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,
167
170
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -206,7 +209,13 @@ export class PromptsClient {
206
209
  * @throws {@link phenoml.agent.InternalServerError}
207
210
  *
208
211
  * @example
209
- * await client.agent.prompts.update("id")
212
+ * await client.agent.prompts.update("id", {
213
+ * name: "Medical Assistant System Prompt",
214
+ * description: "Updated system prompt",
215
+ * content: "You are a helpful medical assistant. Always cite ICD-10 codes when discussing diagnoses.",
216
+ * is_default: false,
217
+ * tags: ["medical", "system", "updated"]
218
+ * })
210
219
  */
211
220
  update(id, request = {}, requestOptions) {
212
221
  return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
@@ -221,7 +230,7 @@ export class PromptsClient {
221
230
  method: "PUT",
222
231
  headers: _headers,
223
232
  contentType: "application/json",
224
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
233
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
225
234
  requestType: "json",
226
235
  body: request,
227
236
  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,
@@ -282,7 +291,7 @@ export class PromptsClient {
282
291
  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)}`),
283
292
  method: "DELETE",
284
293
  headers: _headers,
285
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
294
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
286
295
  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,
287
296
  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,
288
297
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -329,15 +338,8 @@ export class PromptsClient {
329
338
  * @example
330
339
  * await client.agent.prompts.patch("id", [{
331
340
  * op: "replace",
332
- * path: "/name",
333
- * value: "Updated Agent Name"
334
- * }, {
335
- * op: "add",
336
- * path: "/tags/-",
337
- * value: "new-tag"
338
- * }, {
339
- * op: "remove",
340
- * path: "/description"
341
+ * path: "/content",
342
+ * value: "Updated prompt content."
341
343
  * }])
342
344
  */
343
345
  patch(id, request, requestOptions) {
@@ -353,7 +355,7 @@ export class PromptsClient {
353
355
  method: "PATCH",
354
356
  headers: _headers,
355
357
  contentType: "application/json+patch",
356
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
358
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
357
359
  requestType: "json",
358
360
  body: request,
359
361
  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,
@@ -388,57 +390,4 @@ export class PromptsClient {
388
390
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/agent/prompts/{id}");
389
391
  });
390
392
  }
391
- /**
392
- * Loads default agent prompts for the authenticated user
393
- *
394
- * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration.
395
- *
396
- * @throws {@link phenoml.agent.UnauthorizedError}
397
- * @throws {@link phenoml.agent.ForbiddenError}
398
- * @throws {@link phenoml.agent.InternalServerError}
399
- *
400
- * @example
401
- * await client.agent.prompts.loadDefaults()
402
- */
403
- loadDefaults(requestOptions) {
404
- return core.HttpResponsePromise.fromPromise(this.__loadDefaults(requestOptions));
405
- }
406
- __loadDefaults(requestOptions) {
407
- return __awaiter(this, void 0, void 0, function* () {
408
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
409
- const _authRequest = yield this._options.authProvider.getAuthRequest();
410
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
411
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
412
- 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"),
413
- method: "POST",
414
- headers: _headers,
415
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
416
- 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,
417
- 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,
418
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
419
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
420
- logging: this._options.logging,
421
- });
422
- if (_response.ok) {
423
- return { data: _response.body, rawResponse: _response.rawResponse };
424
- }
425
- if (_response.error.reason === "status-code") {
426
- switch (_response.error.statusCode) {
427
- case 401:
428
- throw new phenoml.agent.UnauthorizedError(_response.error.body, _response.rawResponse);
429
- case 403:
430
- throw new phenoml.agent.ForbiddenError(_response.error.body, _response.rawResponse);
431
- case 500:
432
- throw new phenoml.agent.InternalServerError(_response.error.body, _response.rawResponse);
433
- default:
434
- throw new errors.phenomlError({
435
- statusCode: _response.error.statusCode,
436
- body: _response.error.body,
437
- rawResponse: _response.rawResponse,
438
- });
439
- }
440
- }
441
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/agent/prompts/load-defaults");
442
- });
443
- }
444
393
  }
@@ -2,7 +2,10 @@
2
2
  * @example
3
3
  * {
4
4
  * name: "Medical Assistant System Prompt",
5
- * content: "You are a helpful medical assistant specialized in FHIR data processing..."
5
+ * description: "System prompt for medical assistant agent",
6
+ * content: "You are a helpful medical assistant specialized in FHIR data processing.",
7
+ * is_default: false,
8
+ * tags: ["medical", "system"]
6
9
  * }
7
10
  */
8
11
  export interface AgentPromptsCreateRequest {