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.
- package/dist/cjs/BaseClient.d.ts +3 -0
- package/dist/cjs/BaseClient.js +17 -2
- package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
- package/dist/cjs/api/resources/agent/client/Client.js +41 -21
- package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +1 -0
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +13 -25
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +19 -70
- package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +4 -1
- package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +7 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +4 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +5 -2
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
- package/dist/cjs/api/resources/cohort/client/Client.js +1 -1
- package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
- package/dist/cjs/api/resources/construe/client/Client.js +134 -22
- package/dist/cjs/api/resources/construe/client/requests/ExtractRequest.d.ts +60 -1
- package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +14 -7
- package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +18 -1
- package/dist/cjs/api/resources/fhir/client/Client.js +10 -6
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -7
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +17 -14
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +5 -3
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +1 -1
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +1 -1
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +6 -4
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +10 -5
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +17 -6
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +23 -12
- package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +2 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +9 -2
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +1 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -1
- package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/client/Client.d.ts +74 -9
- package/dist/cjs/api/resources/summary/client/Client.js +80 -15
- package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +67 -11
- package/dist/cjs/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.ts +4 -4
- package/dist/cjs/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.ts +4 -4
- package/dist/cjs/api/resources/summary/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/summary/types/index.js +0 -2
- package/dist/cjs/api/resources/tools/client/Client.d.ts +7 -3
- package/dist/cjs/api/resources/tools/client/Client.js +11 -7
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +1 -0
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +3 -2
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +3 -1
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/types/McpServer.d.ts +10 -0
- package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +12 -16
- package/dist/cjs/api/resources/tools/types/McpServerTool.d.ts +14 -0
- package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +7 -20
- package/dist/cjs/api/resources/tools/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/tools/types/index.js +2 -0
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +21 -9
- package/dist/cjs/api/resources/workflows/client/Client.js +43 -15
- package/dist/cjs/api/resources/workflows/client/requests/CreateWorkflowRequest.d.ts +3 -2
- package/dist/cjs/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.ts +11 -1
- package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.ts +6 -5
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
- package/dist/cjs/core/auth/AuthProvider.js +7 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/auth/index.d.ts +1 -1
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
- package/dist/cjs/core/fetcher/Fetcher.js +13 -8
- package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/qs.d.ts +2 -1
- package/dist/cjs/core/url/qs.js +24 -12
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/errors/phenomlError.d.ts +3 -1
- package/dist/cjs/errors/phenomlError.js +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/BaseClient.mjs +17 -2
- package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
- package/dist/esm/api/resources/agent/client/Client.mjs +41 -21
- package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +11 -0
- package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +1 -0
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +13 -25
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +19 -70
- package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +4 -1
- package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +7 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +4 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +5 -2
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
- package/dist/esm/api/resources/cohort/client/Client.mjs +1 -1
- package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
- package/dist/esm/api/resources/construe/client/Client.mjs +134 -22
- package/dist/esm/api/resources/construe/client/requests/ExtractRequest.d.mts +60 -1
- package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +14 -7
- package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +18 -1
- package/dist/esm/api/resources/fhir/client/Client.mjs +10 -6
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -7
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +17 -14
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +5 -3
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +1 -1
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +1 -1
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +6 -4
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +10 -5
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +17 -6
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +23 -12
- package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +2 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +9 -2
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +1 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -1
- package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/client/Client.d.mts +74 -9
- package/dist/esm/api/resources/summary/client/Client.mjs +80 -15
- package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +67 -11
- package/dist/esm/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.mts +4 -4
- package/dist/esm/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.mts +4 -4
- package/dist/esm/api/resources/summary/types/index.d.mts +0 -2
- package/dist/esm/api/resources/summary/types/index.mjs +0 -2
- package/dist/esm/api/resources/tools/client/Client.d.mts +7 -3
- package/dist/esm/api/resources/tools/client/Client.mjs +11 -7
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +1 -0
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +3 -2
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +3 -1
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/types/McpServer.d.mts +10 -0
- package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +12 -16
- package/dist/esm/api/resources/tools/types/McpServerTool.d.mts +14 -0
- package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +7 -20
- package/dist/esm/api/resources/tools/types/index.d.mts +2 -0
- package/dist/esm/api/resources/tools/types/index.mjs +2 -0
- package/dist/esm/api/resources/workflows/client/Client.d.mts +21 -9
- package/dist/esm/api/resources/workflows/client/Client.mjs +43 -15
- package/dist/esm/api/resources/workflows/client/requests/CreateWorkflowRequest.d.mts +3 -2
- package/dist/esm/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.mts +11 -1
- package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.mts +6 -5
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -1
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/auth/index.d.mts +1 -1
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
- package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/qs.d.mts +2 -1
- package/dist/esm/core/url/qs.mjs +24 -12
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/errors/phenomlError.d.mts +3 -1
- package/dist/esm/errors/phenomlError.mjs +4 -1
- package/dist/esm/errors/phenomlTimeoutError.d.mts +4 -1
- package/dist/esm/errors/phenomlTimeoutError.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +140 -124
- package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +0 -13
- package/dist/cjs/api/resources/summary/types/FhirResource.d.ts +0 -6
- package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +0 -13
- package/dist/esm/api/resources/summary/types/FhirResource.d.mts +0 -6
- /package/dist/cjs/api/resources/{summary/types/FhirBundle.js → tools/types/McpServer.js} +0 -0
- /package/dist/cjs/api/resources/{summary/types/FhirResource.js → tools/types/McpServerTool.js} +0 -0
- /package/dist/esm/api/resources/{summary/types/FhirBundle.mjs → tools/types/McpServer.mjs} +0 -0
- /package/dist/esm/api/resources/{summary/types/FhirResource.mjs → tools/types/McpServerTool.mjs} +0 -0
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OAuthAuthProvider } from "./auth/OAuthAuthProvider.js";
|
|
2
2
|
import * as core from "./core/index.js";
|
|
3
3
|
import type * as environments from "./environments.js";
|
|
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. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "phenoml",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "phenoml/
|
|
46
|
+
"X-Fern-SDK-Version": "14.0.0",
|
|
47
|
+
"User-Agent": "phenoml/14.0.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -53,6 +53,21 @@ function normalizeClientOptions(options) {
|
|
|
53
53
|
function normalizeClientOptionsWithAuth(options) {
|
|
54
54
|
var _a;
|
|
55
55
|
const normalized = normalizeClientOptions(options);
|
|
56
|
+
if (options.auth === false) {
|
|
57
|
+
normalized.authProvider = new core.NoOpAuthProvider();
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
if (options.auth != null) {
|
|
61
|
+
if (typeof options.auth === "function") {
|
|
62
|
+
normalized.authProvider = { getAuthRequest: options.auth };
|
|
63
|
+
return normalized;
|
|
64
|
+
}
|
|
65
|
+
if (core.isAuthProvider(options.auth)) {
|
|
66
|
+
normalized.authProvider = options.auth;
|
|
67
|
+
return normalized;
|
|
68
|
+
}
|
|
69
|
+
Object.assign(normalized, options.auth);
|
|
70
|
+
}
|
|
56
71
|
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
57
72
|
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = OAuthAuthProvider_js_1.OAuthAuthProvider.createInstance(normalizedWithNoOpAuthProvider));
|
|
58
73
|
return normalized;
|
|
@@ -26,9 +26,11 @@ export declare class AgentClient {
|
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* await client.agent.create({
|
|
29
|
-
* name: "
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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: "
|
|
85
|
-
*
|
|
86
|
-
*
|
|
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: "/
|
|
124
|
-
* value: "
|
|
127
|
+
* path: "/description",
|
|
128
|
+
* value: "patched description"
|
|
125
129
|
* }, {
|
|
126
130
|
* op: "add",
|
|
127
131
|
* path: "/tags/-",
|
|
128
|
-
* value: "
|
|
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;
|
|
@@ -84,9 +84,11 @@ class AgentClient {
|
|
|
84
84
|
*
|
|
85
85
|
* @example
|
|
86
86
|
* await client.agent.create({
|
|
87
|
-
* name: "
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* name: "Medical Assistant",
|
|
88
|
+
* description: "An AI assistant for medical information processing",
|
|
89
|
+
* prompts: ["prompt_123"],
|
|
90
|
+
* tags: ["medical", "fhir"],
|
|
91
|
+
* provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
|
|
90
92
|
* })
|
|
91
93
|
*/
|
|
92
94
|
create(request, requestOptions) {
|
|
@@ -102,7 +104,7 @@ class AgentClient {
|
|
|
102
104
|
method: "POST",
|
|
103
105
|
headers: _headers,
|
|
104
106
|
contentType: "application/json",
|
|
105
|
-
|
|
107
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
106
108
|
requestType: "json",
|
|
107
109
|
body: request,
|
|
108
110
|
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,7 +168,11 @@ class AgentClient {
|
|
|
166
168
|
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"),
|
|
167
169
|
method: "GET",
|
|
168
170
|
headers: _headers,
|
|
169
|
-
|
|
171
|
+
queryString: core.url
|
|
172
|
+
.queryBuilder()
|
|
173
|
+
.addMany(_queryParams)
|
|
174
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
175
|
+
.build(),
|
|
170
176
|
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,
|
|
171
177
|
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,
|
|
172
178
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -221,7 +227,7 @@ class AgentClient {
|
|
|
221
227
|
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)}`),
|
|
222
228
|
method: "GET",
|
|
223
229
|
headers: _headers,
|
|
224
|
-
|
|
230
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
225
231
|
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,
|
|
226
232
|
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,
|
|
227
233
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -267,9 +273,11 @@ class AgentClient {
|
|
|
267
273
|
*
|
|
268
274
|
* @example
|
|
269
275
|
* await client.agent.update("id", {
|
|
270
|
-
* name: "
|
|
271
|
-
*
|
|
272
|
-
*
|
|
276
|
+
* name: "Medical Assistant",
|
|
277
|
+
* description: "Updated description for the medical assistant",
|
|
278
|
+
* prompts: ["prompt_123"],
|
|
279
|
+
* tags: ["medical", "fhir", "updated"],
|
|
280
|
+
* provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
|
|
273
281
|
* })
|
|
274
282
|
*/
|
|
275
283
|
update(id, request, requestOptions) {
|
|
@@ -285,7 +293,7 @@ class AgentClient {
|
|
|
285
293
|
method: "PUT",
|
|
286
294
|
headers: _headers,
|
|
287
295
|
contentType: "application/json",
|
|
288
|
-
|
|
296
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
289
297
|
requestType: "json",
|
|
290
298
|
body: request,
|
|
291
299
|
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,
|
|
@@ -346,7 +354,7 @@ class AgentClient {
|
|
|
346
354
|
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)}`),
|
|
347
355
|
method: "DELETE",
|
|
348
356
|
headers: _headers,
|
|
349
|
-
|
|
357
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
350
358
|
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,
|
|
351
359
|
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,
|
|
352
360
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -393,15 +401,12 @@ class AgentClient {
|
|
|
393
401
|
* @example
|
|
394
402
|
* await client.agent.patch("id", [{
|
|
395
403
|
* op: "replace",
|
|
396
|
-
* path: "/
|
|
397
|
-
* value: "
|
|
404
|
+
* path: "/description",
|
|
405
|
+
* value: "patched description"
|
|
398
406
|
* }, {
|
|
399
407
|
* op: "add",
|
|
400
408
|
* path: "/tags/-",
|
|
401
|
-
* value: "
|
|
402
|
-
* }, {
|
|
403
|
-
* op: "remove",
|
|
404
|
-
* path: "/description"
|
|
409
|
+
* value: "updated"
|
|
405
410
|
* }])
|
|
406
411
|
*/
|
|
407
412
|
patch(id, request, requestOptions) {
|
|
@@ -417,7 +422,7 @@ class AgentClient {
|
|
|
417
422
|
method: "PATCH",
|
|
418
423
|
headers: _headers,
|
|
419
424
|
contentType: "application/json+patch",
|
|
420
|
-
|
|
425
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
421
426
|
requestType: "json",
|
|
422
427
|
body: request,
|
|
423
428
|
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,
|
|
@@ -468,8 +473,19 @@ class AgentClient {
|
|
|
468
473
|
* "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
469
474
|
* "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
470
475
|
* message: "What is the patient's current condition?",
|
|
476
|
+
* session_id: "session-abc123",
|
|
471
477
|
* agent_id: "agent-123"
|
|
472
478
|
* })
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* await client.agent.chat({
|
|
482
|
+
* "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
483
|
+
* "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
484
|
+
* message: "Create a patient record for Jane Doe, 32F, diagnosed with iron deficiency anemia. Prescribe ferrous sulfate 325mg daily.",
|
|
485
|
+
* session_id: "session-def456",
|
|
486
|
+
* agent_id: "agent-123",
|
|
487
|
+
* enhanced_reasoning: true
|
|
488
|
+
* })
|
|
473
489
|
*/
|
|
474
490
|
chat(request, requestOptions) {
|
|
475
491
|
return core.HttpResponsePromise.fromPromise(this.__chat(request, requestOptions));
|
|
@@ -488,7 +504,7 @@ class AgentClient {
|
|
|
488
504
|
method: "POST",
|
|
489
505
|
headers: _headers,
|
|
490
506
|
contentType: "application/json",
|
|
491
|
-
|
|
507
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
492
508
|
requestType: "json",
|
|
493
509
|
body: _body,
|
|
494
510
|
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,
|
|
@@ -543,7 +559,7 @@ class AgentClient {
|
|
|
543
559
|
method: "POST",
|
|
544
560
|
headers: _headers,
|
|
545
561
|
contentType: "application/json",
|
|
546
|
-
|
|
562
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
547
563
|
requestType: "json",
|
|
548
564
|
body: _body,
|
|
549
565
|
responseType: "sse",
|
|
@@ -624,7 +640,11 @@ class AgentClient {
|
|
|
624
640
|
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"),
|
|
625
641
|
method: "GET",
|
|
626
642
|
headers: _headers,
|
|
627
|
-
|
|
643
|
+
queryString: core.url
|
|
644
|
+
.queryBuilder()
|
|
645
|
+
.addMany(_queryParams)
|
|
646
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
647
|
+
.build(),
|
|
628
648
|
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,
|
|
629
649
|
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,
|
|
630
650
|
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
|
-
*
|
|
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: "/
|
|
113
|
-
* value: "Updated
|
|
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
|
}
|
|
@@ -69,7 +69,10 @@ class PromptsClient {
|
|
|
69
69
|
* @example
|
|
70
70
|
* await client.agent.prompts.create({
|
|
71
71
|
* name: "Medical Assistant System Prompt",
|
|
72
|
-
*
|
|
72
|
+
* description: "System prompt for medical assistant agent",
|
|
73
|
+
* content: "You are a helpful medical assistant specialized in FHIR data processing.",
|
|
74
|
+
* is_default: false,
|
|
75
|
+
* tags: ["medical", "system"]
|
|
73
76
|
* })
|
|
74
77
|
*/
|
|
75
78
|
create(request, requestOptions) {
|
|
@@ -85,7 +88,7 @@ class PromptsClient {
|
|
|
85
88
|
method: "POST",
|
|
86
89
|
headers: _headers,
|
|
87
90
|
contentType: "application/json",
|
|
88
|
-
|
|
91
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
89
92
|
requestType: "json",
|
|
90
93
|
body: request,
|
|
91
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,
|
|
@@ -142,7 +145,7 @@ class PromptsClient {
|
|
|
142
145
|
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"),
|
|
143
146
|
method: "GET",
|
|
144
147
|
headers: _headers,
|
|
145
|
-
|
|
148
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
146
149
|
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,
|
|
147
150
|
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,
|
|
148
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -197,7 +200,7 @@ class PromptsClient {
|
|
|
197
200
|
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)}`),
|
|
198
201
|
method: "GET",
|
|
199
202
|
headers: _headers,
|
|
200
|
-
|
|
203
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
201
204
|
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,
|
|
202
205
|
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,
|
|
203
206
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -242,7 +245,13 @@ class PromptsClient {
|
|
|
242
245
|
* @throws {@link phenoml.agent.InternalServerError}
|
|
243
246
|
*
|
|
244
247
|
* @example
|
|
245
|
-
* await client.agent.prompts.update("id"
|
|
248
|
+
* await client.agent.prompts.update("id", {
|
|
249
|
+
* name: "Medical Assistant System Prompt",
|
|
250
|
+
* description: "Updated system prompt",
|
|
251
|
+
* content: "You are a helpful medical assistant. Always cite ICD-10 codes when discussing diagnoses.",
|
|
252
|
+
* is_default: false,
|
|
253
|
+
* tags: ["medical", "system", "updated"]
|
|
254
|
+
* })
|
|
246
255
|
*/
|
|
247
256
|
update(id, request = {}, requestOptions) {
|
|
248
257
|
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
@@ -257,7 +266,7 @@ class PromptsClient {
|
|
|
257
266
|
method: "PUT",
|
|
258
267
|
headers: _headers,
|
|
259
268
|
contentType: "application/json",
|
|
260
|
-
|
|
269
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
261
270
|
requestType: "json",
|
|
262
271
|
body: request,
|
|
263
272
|
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,
|
|
@@ -318,7 +327,7 @@ class PromptsClient {
|
|
|
318
327
|
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)}`),
|
|
319
328
|
method: "DELETE",
|
|
320
329
|
headers: _headers,
|
|
321
|
-
|
|
330
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
322
331
|
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
332
|
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
333
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -365,15 +374,8 @@ class PromptsClient {
|
|
|
365
374
|
* @example
|
|
366
375
|
* await client.agent.prompts.patch("id", [{
|
|
367
376
|
* op: "replace",
|
|
368
|
-
* path: "/
|
|
369
|
-
* value: "Updated
|
|
370
|
-
* }, {
|
|
371
|
-
* op: "add",
|
|
372
|
-
* path: "/tags/-",
|
|
373
|
-
* value: "new-tag"
|
|
374
|
-
* }, {
|
|
375
|
-
* op: "remove",
|
|
376
|
-
* path: "/description"
|
|
377
|
+
* path: "/content",
|
|
378
|
+
* value: "Updated prompt content."
|
|
377
379
|
* }])
|
|
378
380
|
*/
|
|
379
381
|
patch(id, request, requestOptions) {
|
|
@@ -389,7 +391,7 @@ class PromptsClient {
|
|
|
389
391
|
method: "PATCH",
|
|
390
392
|
headers: _headers,
|
|
391
393
|
contentType: "application/json+patch",
|
|
392
|
-
|
|
394
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
393
395
|
requestType: "json",
|
|
394
396
|
body: request,
|
|
395
397
|
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,
|
|
@@ -424,58 +426,5 @@ class PromptsClient {
|
|
|
424
426
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/agent/prompts/{id}");
|
|
425
427
|
});
|
|
426
428
|
}
|
|
427
|
-
/**
|
|
428
|
-
* Loads default agent prompts for the authenticated user
|
|
429
|
-
*
|
|
430
|
-
* @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
431
|
-
*
|
|
432
|
-
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
433
|
-
* @throws {@link phenoml.agent.ForbiddenError}
|
|
434
|
-
* @throws {@link phenoml.agent.InternalServerError}
|
|
435
|
-
*
|
|
436
|
-
* @example
|
|
437
|
-
* await client.agent.prompts.loadDefaults()
|
|
438
|
-
*/
|
|
439
|
-
loadDefaults(requestOptions) {
|
|
440
|
-
return core.HttpResponsePromise.fromPromise(this.__loadDefaults(requestOptions));
|
|
441
|
-
}
|
|
442
|
-
__loadDefaults(requestOptions) {
|
|
443
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
445
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
446
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
447
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
448
|
-
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"),
|
|
449
|
-
method: "POST",
|
|
450
|
-
headers: _headers,
|
|
451
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
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,
|
|
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,
|
|
454
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
456
|
-
logging: this._options.logging,
|
|
457
|
-
});
|
|
458
|
-
if (_response.ok) {
|
|
459
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
460
|
-
}
|
|
461
|
-
if (_response.error.reason === "status-code") {
|
|
462
|
-
switch (_response.error.statusCode) {
|
|
463
|
-
case 401:
|
|
464
|
-
throw new phenoml.agent.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
465
|
-
case 403:
|
|
466
|
-
throw new phenoml.agent.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
467
|
-
case 500:
|
|
468
|
-
throw new phenoml.agent.InternalServerError(_response.error.body, _response.rawResponse);
|
|
469
|
-
default:
|
|
470
|
-
throw new errors.phenomlError({
|
|
471
|
-
statusCode: _response.error.statusCode,
|
|
472
|
-
body: _response.error.body,
|
|
473
|
-
rawResponse: _response.rawResponse,
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agent/prompts/load-defaults");
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
429
|
}
|
|
481
430
|
exports.PromptsClient = PromptsClient;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* name: "Medical Assistant System Prompt",
|
|
5
|
-
*
|
|
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 {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
|
-
* {
|
|
3
|
+
* {
|
|
4
|
+
* name: "Medical Assistant System Prompt",
|
|
5
|
+
* description: "Updated system prompt",
|
|
6
|
+
* content: "You are a helpful medical assistant. Always cite ICD-10 codes when discussing diagnoses.",
|
|
7
|
+
* is_default: false,
|
|
8
|
+
* tags: ["medical", "system", "updated"]
|
|
9
|
+
* }
|
|
4
10
|
*/
|
|
5
11
|
export interface AgentPromptsUpdateRequest {
|
|
6
12
|
/** Prompt name */
|
|
@@ -24,7 +24,10 @@ export declare class AuthClient {
|
|
|
24
24
|
* @throws {@link phenoml.authtoken.InternalServerError}
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
|
-
* await client.authtoken.auth.getToken(
|
|
27
|
+
* await client.authtoken.auth.getToken({
|
|
28
|
+
* client_id: "your_client_id",
|
|
29
|
+
* client_secret: "your_client_secret"
|
|
30
|
+
* })
|
|
28
31
|
*/
|
|
29
32
|
getToken(request?: phenoml.authtoken.ClientCredentialsRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<phenoml.authtoken.TokenResponse>;
|
|
30
33
|
private __getToken;
|
|
@@ -69,7 +69,10 @@ class AuthClient {
|
|
|
69
69
|
* @throws {@link phenoml.authtoken.InternalServerError}
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
|
-
* await client.authtoken.auth.getToken(
|
|
72
|
+
* await client.authtoken.auth.getToken({
|
|
73
|
+
* client_id: "your_client_id",
|
|
74
|
+
* client_secret: "your_client_secret"
|
|
75
|
+
* })
|
|
73
76
|
*/
|
|
74
77
|
getToken(request = {}, requestOptions) {
|
|
75
78
|
return core.HttpResponsePromise.fromPromise(this.__getToken(request, requestOptions));
|
|
@@ -83,7 +86,7 @@ class AuthClient {
|
|
|
83
86
|
method: "POST",
|
|
84
87
|
headers: _headers,
|
|
85
88
|
contentType: "application/json",
|
|
86
|
-
|
|
89
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
87
90
|
requestType: "json",
|
|
88
91
|
body: request,
|
|
89
92
|
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,
|
|
@@ -83,7 +83,7 @@ class CohortClient {
|
|
|
83
83
|
method: "POST",
|
|
84
84
|
headers: _headers,
|
|
85
85
|
contentType: "application/json",
|
|
86
|
-
|
|
86
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
87
87
|
requestType: "json",
|
|
88
88
|
body: request,
|
|
89
89
|
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,
|