phenoml 13.1.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.js +2 -2
- package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
- package/dist/cjs/api/resources/agent/client/Client.js +24 -12
- 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 +13 -64
- 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 +4 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
- package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
- package/dist/cjs/api/resources/construe/client/Client.js +95 -11
- 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/fhirProvider/client/Client.d.ts +10 -7
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +10 -7
- 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 +17 -6
- 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 +74 -9
- 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 +7 -3
- 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/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 +21 -9
- 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/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
- package/dist/esm/api/resources/agent/client/Client.mjs +24 -12
- 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 +13 -64
- 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 +4 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
- package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
- package/dist/esm/api/resources/construe/client/Client.mjs +95 -11
- 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/fhirProvider/client/Client.d.mts +10 -7
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +10 -7
- 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 +17 -6
- 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 +74 -9
- 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 +7 -3
- 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/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 +21 -9
- 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/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- 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
|
@@ -148,11 +148,12 @@ class WorkflowsClient {
|
|
|
148
148
|
* await client.workflows.create({
|
|
149
149
|
* verbose: true,
|
|
150
150
|
* name: "Patient Data Mapping Workflow",
|
|
151
|
-
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
151
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
|
|
152
152
|
* sample_data: {
|
|
153
153
|
* "patient_last_name": "Rippin",
|
|
154
154
|
* "patient_first_name": "Clay",
|
|
155
|
-
* "diagnosis_code": "I10"
|
|
155
|
+
* "diagnosis_code": "I10",
|
|
156
|
+
* "encounter_date": "2024-01-15"
|
|
156
157
|
* },
|
|
157
158
|
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
158
159
|
* })
|
|
@@ -301,12 +302,13 @@ class WorkflowsClient {
|
|
|
301
302
|
* @example
|
|
302
303
|
* await client.workflows.update("id", {
|
|
303
304
|
* verbose: true,
|
|
304
|
-
* name: "
|
|
305
|
-
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
305
|
+
* name: "Patient Data Mapping Workflow (v2)",
|
|
306
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
|
|
306
307
|
* sample_data: {
|
|
307
|
-
* "patient_last_name": "
|
|
308
|
-
* "patient_first_name": "
|
|
309
|
-
* "diagnosis_code": "
|
|
308
|
+
* "patient_last_name": "Rippin",
|
|
309
|
+
* "patient_first_name": "Clay",
|
|
310
|
+
* "diagnosis_code": "I10",
|
|
311
|
+
* "encounter_date": "2024-01-15"
|
|
310
312
|
* },
|
|
311
313
|
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
312
314
|
* })
|
|
@@ -444,14 +446,24 @@ class WorkflowsClient {
|
|
|
444
446
|
* @throws {@link phenoml.workflows.InternalServerError}
|
|
445
447
|
*
|
|
446
448
|
* @example
|
|
447
|
-
* await client.workflows.execute("
|
|
449
|
+
* await client.workflows.execute("7a8b9c0d-1234-5678-abcd-ef9876543210", {
|
|
448
450
|
* input_data: {
|
|
449
451
|
* "patient_last_name": "Johnson",
|
|
450
452
|
* "patient_first_name": "Mary",
|
|
451
453
|
* "diagnosis_code": "M79.3",
|
|
452
|
-
* "encounter_date": "2024-
|
|
454
|
+
* "encounter_date": "2024-03-20"
|
|
453
455
|
* }
|
|
454
456
|
* })
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* await client.workflows.execute("7a8b9c0d-1234-5678-abcd-ef9876543210", {
|
|
460
|
+
* input_data: {
|
|
461
|
+
* "patient_last_name": "Johnson",
|
|
462
|
+
* "patient_first_name": "Mary",
|
|
463
|
+
* "diagnosis_code": "M79.3"
|
|
464
|
+
* },
|
|
465
|
+
* preview: true
|
|
466
|
+
* })
|
|
455
467
|
*/
|
|
456
468
|
execute(id, request, requestOptions) {
|
|
457
469
|
return core.HttpResponsePromise.fromPromise(this.__execute(id, request, requestOptions));
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* {
|
|
4
4
|
* verbose: true,
|
|
5
5
|
* name: "Patient Data Mapping Workflow",
|
|
6
|
-
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
6
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
|
|
7
7
|
* sample_data: {
|
|
8
8
|
* "patient_last_name": "Rippin",
|
|
9
9
|
* "patient_first_name": "Clay",
|
|
10
|
-
* "diagnosis_code": "I10"
|
|
10
|
+
* "diagnosis_code": "I10",
|
|
11
|
+
* "encounter_date": "2024-01-15"
|
|
11
12
|
* },
|
|
12
13
|
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
13
14
|
* }
|
|
@@ -5,9 +5,19 @@
|
|
|
5
5
|
* "patient_last_name": "Johnson",
|
|
6
6
|
* "patient_first_name": "Mary",
|
|
7
7
|
* "diagnosis_code": "M79.3",
|
|
8
|
-
* "encounter_date": "2024-
|
|
8
|
+
* "encounter_date": "2024-03-20"
|
|
9
9
|
* }
|
|
10
10
|
* }
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* {
|
|
14
|
+
* input_data: {
|
|
15
|
+
* "patient_last_name": "Johnson",
|
|
16
|
+
* "patient_first_name": "Mary",
|
|
17
|
+
* "diagnosis_code": "M79.3"
|
|
18
|
+
* },
|
|
19
|
+
* preview: true
|
|
20
|
+
* }
|
|
11
21
|
*/
|
|
12
22
|
export interface ExecuteWorkflowRequest {
|
|
13
23
|
/** Input data for workflow execution */
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* verbose: true,
|
|
5
|
-
* name: "
|
|
6
|
-
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
5
|
+
* name: "Patient Data Mapping Workflow (v2)",
|
|
6
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
|
|
7
7
|
* sample_data: {
|
|
8
|
-
* "patient_last_name": "
|
|
9
|
-
* "patient_first_name": "
|
|
10
|
-
* "diagnosis_code": "
|
|
8
|
+
* "patient_last_name": "Rippin",
|
|
9
|
+
* "patient_first_name": "Clay",
|
|
10
|
+
* "diagnosis_code": "I10",
|
|
11
|
+
* "encounter_date": "2024-01-15"
|
|
11
12
|
* },
|
|
12
13
|
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
13
14
|
* }
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "14.0.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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": "
|
|
10
|
-
"User-Agent": "phenoml/
|
|
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);
|
|
@@ -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;
|
|
@@ -48,9 +48,11 @@ export class AgentClient {
|
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* await client.agent.create({
|
|
51
|
-
* name: "
|
|
52
|
-
*
|
|
53
|
-
*
|
|
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) {
|
|
@@ -235,9 +237,11 @@ export class AgentClient {
|
|
|
235
237
|
*
|
|
236
238
|
* @example
|
|
237
239
|
* await client.agent.update("id", {
|
|
238
|
-
* name: "
|
|
239
|
-
*
|
|
240
|
-
*
|
|
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"
|
|
241
245
|
* })
|
|
242
246
|
*/
|
|
243
247
|
update(id, request, requestOptions) {
|
|
@@ -361,15 +365,12 @@ export class AgentClient {
|
|
|
361
365
|
* @example
|
|
362
366
|
* await client.agent.patch("id", [{
|
|
363
367
|
* op: "replace",
|
|
364
|
-
* path: "/
|
|
365
|
-
* value: "
|
|
368
|
+
* path: "/description",
|
|
369
|
+
* value: "patched description"
|
|
366
370
|
* }, {
|
|
367
371
|
* op: "add",
|
|
368
372
|
* path: "/tags/-",
|
|
369
|
-
* value: "
|
|
370
|
-
* }, {
|
|
371
|
-
* op: "remove",
|
|
372
|
-
* path: "/description"
|
|
373
|
+
* value: "updated"
|
|
373
374
|
* }])
|
|
374
375
|
*/
|
|
375
376
|
patch(id, request, requestOptions) {
|
|
@@ -436,8 +437,19 @@ export class AgentClient {
|
|
|
436
437
|
* "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
437
438
|
* "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
438
439
|
* message: "What is the patient's current condition?",
|
|
440
|
+
* session_id: "session-abc123",
|
|
439
441
|
* agent_id: "agent-123"
|
|
440
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
|
+
* })
|
|
441
453
|
*/
|
|
442
454
|
chat(request, requestOptions) {
|
|
443
455
|
return core.HttpResponsePromise.fromPromise(this.__chat(request, requestOptions));
|
|
@@ -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
|
}
|
|
@@ -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
|
-
*
|
|
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) {
|
|
@@ -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));
|
|
@@ -329,15 +338,8 @@ export class PromptsClient {
|
|
|
329
338
|
* @example
|
|
330
339
|
* await client.agent.prompts.patch("id", [{
|
|
331
340
|
* op: "replace",
|
|
332
|
-
* path: "/
|
|
333
|
-
* value: "Updated
|
|
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) {
|
|
@@ -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
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
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
|
-
*
|
|
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;
|
|
@@ -33,7 +33,10 @@ export class AuthClient {
|
|
|
33
33
|
* @throws {@link phenoml.authtoken.InternalServerError}
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
|
-
* await client.authtoken.auth.getToken(
|
|
36
|
+
* await client.authtoken.auth.getToken({
|
|
37
|
+
* client_id: "your_client_id",
|
|
38
|
+
* client_secret: "your_client_secret"
|
|
39
|
+
* })
|
|
37
40
|
*/
|
|
38
41
|
getToken(request = {}, requestOptions) {
|
|
39
42
|
return core.HttpResponsePromise.fromPromise(this.__getToken(request, requestOptions));
|