phenoml 0.0.2__py3-none-any.whl → 0.0.15__py3-none-any.whl

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 (137) hide show
  1. phenoml/agent/__init__.py +6 -8
  2. phenoml/agent/client.py +85 -67
  3. phenoml/agent/raw_client.py +61 -77
  4. phenoml/agent/types/__init__.py +6 -8
  5. phenoml/agent/types/agent_create_request.py +53 -0
  6. phenoml/agent/types/agent_create_request_provider.py +5 -0
  7. phenoml/agent/types/agent_template.py +3 -6
  8. phenoml/agent/types/agent_template_provider.py +5 -0
  9. phenoml/agent/types/json_patch_operation.py +5 -1
  10. phenoml/client.py +12 -0
  11. phenoml/construe/__init__.py +2 -16
  12. phenoml/construe/client.py +0 -90
  13. phenoml/construe/raw_client.py +0 -180
  14. phenoml/construe/types/__init__.py +2 -20
  15. phenoml/construe/types/extract_request_config.py +33 -4
  16. phenoml/construe/types/extract_request_config_chunking_method.py +3 -1
  17. phenoml/construe/types/extract_request_config_validation_method.py +5 -0
  18. phenoml/construe/types/extract_request_system.py +2 -0
  19. phenoml/core/client_wrapper.py +2 -2
  20. phenoml/fhir/__init__.py +36 -0
  21. phenoml/fhir/client.py +1072 -0
  22. phenoml/fhir/errors/__init__.py +10 -0
  23. phenoml/fhir/errors/bad_request_error.py +10 -0
  24. phenoml/fhir/errors/internal_server_error.py +10 -0
  25. phenoml/fhir/errors/not_found_error.py +10 -0
  26. phenoml/fhir/errors/unauthorized_error.py +10 -0
  27. phenoml/fhir/raw_client.py +1469 -0
  28. phenoml/fhir/types/__init__.py +29 -0
  29. phenoml/{agent/types/chat_fhir_client_config.py → fhir/types/error_response.py} +11 -6
  30. phenoml/fhir/types/fhir_bundle.py +43 -0
  31. phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
  32. phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
  33. phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
  34. phenoml/{construe/types/bad_request_error_body.py → fhir/types/fhir_bundle_entry_item_response.py} +4 -7
  35. phenoml/fhir/types/fhir_patch_request_body_item.py +40 -0
  36. phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
  37. phenoml/fhir/types/fhir_resource.py +40 -0
  38. phenoml/fhir/types/fhir_resource_meta.py +28 -0
  39. phenoml/fhir/types/fhir_search_response.py +8 -0
  40. phenoml/fhir_provider/__init__.py +45 -0
  41. phenoml/fhir_provider/client.py +748 -0
  42. phenoml/fhir_provider/errors/__init__.py +11 -0
  43. phenoml/fhir_provider/errors/bad_request_error.py +10 -0
  44. phenoml/fhir_provider/errors/forbidden_error.py +10 -0
  45. phenoml/fhir_provider/errors/internal_server_error.py +10 -0
  46. phenoml/fhir_provider/errors/not_found_error.py +10 -0
  47. phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
  48. phenoml/fhir_provider/raw_client.py +1462 -0
  49. phenoml/fhir_provider/types/__init__.py +37 -0
  50. phenoml/fhir_provider/types/auth_method.py +7 -0
  51. phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
  52. phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
  53. phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
  54. phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
  55. phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
  56. phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
  57. phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
  58. phenoml/fhir_provider/types/fhir_query_response.py +27 -0
  59. phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
  60. phenoml/fhir_provider/types/json_web_key.py +51 -0
  61. phenoml/fhir_provider/types/provider.py +8 -0
  62. phenoml/fhir_provider/types/role.py +27 -0
  63. phenoml/fhir_provider/types/service_account_key.py +35 -0
  64. phenoml/fhir_provider/types/smart_configuration.py +46 -0
  65. phenoml/summary/__init__.py +39 -0
  66. phenoml/summary/client.py +656 -0
  67. phenoml/summary/errors/__init__.py +11 -0
  68. phenoml/summary/errors/bad_request_error.py +10 -0
  69. phenoml/summary/errors/forbidden_error.py +10 -0
  70. phenoml/summary/errors/internal_server_error.py +10 -0
  71. phenoml/summary/errors/not_found_error.py +10 -0
  72. phenoml/summary/errors/unauthorized_error.py +10 -0
  73. phenoml/summary/raw_client.py +1190 -0
  74. phenoml/summary/types/__init__.py +31 -0
  75. phenoml/summary/types/create_summary_request_fhir_resources.py +8 -0
  76. phenoml/summary/types/create_summary_request_mode.py +5 -0
  77. phenoml/{agent/types/agent_fhir_config.py → summary/types/create_summary_response.py} +7 -9
  78. phenoml/summary/types/create_summary_template_response.py +23 -0
  79. phenoml/summary/types/fhir_bundle.py +23 -0
  80. phenoml/summary/types/fhir_bundle_entry_item.py +20 -0
  81. phenoml/summary/types/fhir_resource.py +24 -0
  82. phenoml/summary/types/summary_delete_template_response.py +20 -0
  83. phenoml/summary/types/summary_get_template_response.py +21 -0
  84. phenoml/summary/types/summary_list_templates_response.py +21 -0
  85. phenoml/summary/types/summary_template.py +41 -0
  86. phenoml/summary/types/summary_update_template_response.py +22 -0
  87. phenoml/tools/__init__.py +0 -8
  88. phenoml/tools/client.py +114 -44
  89. phenoml/tools/raw_client.py +86 -55
  90. phenoml/tools/types/__init__.py +0 -8
  91. phenoml/workflows/__init__.py +61 -0
  92. phenoml/workflows/client.py +694 -0
  93. phenoml/workflows/errors/__init__.py +11 -0
  94. phenoml/workflows/errors/bad_request_error.py +10 -0
  95. phenoml/workflows/errors/forbidden_error.py +10 -0
  96. phenoml/workflows/errors/internal_server_error.py +10 -0
  97. phenoml/workflows/errors/not_found_error.py +10 -0
  98. phenoml/workflows/errors/unauthorized_error.py +10 -0
  99. phenoml/workflows/raw_client.py +1266 -0
  100. phenoml/workflows/types/__init__.py +53 -0
  101. phenoml/workflows/types/create_workflow_request_fhir_provider_id.py +5 -0
  102. phenoml/workflows/types/create_workflow_response.py +44 -0
  103. phenoml/{tools/types/fhir_client_config.py → workflows/types/decision_node_definition.py} +7 -6
  104. phenoml/workflows/types/execute_workflow_response.py +30 -0
  105. phenoml/{construe/types/unauthorized_error_body.py → workflows/types/execute_workflow_response_results.py} +3 -8
  106. phenoml/workflows/types/lang2fhir_create_definition.py +37 -0
  107. phenoml/workflows/types/lang2fhir_search_definition.py +42 -0
  108. phenoml/workflows/types/list_workflows_response.py +39 -0
  109. phenoml/workflows/types/step_operation.py +26 -0
  110. phenoml/{construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py → workflows/types/sub_workflow_definition.py} +7 -7
  111. phenoml/workflows/types/update_workflow_request_fhir_provider_id.py +5 -0
  112. phenoml/workflows/types/workflow_config.py +27 -0
  113. phenoml/workflows/types/workflow_definition.py +57 -0
  114. phenoml/{construe/types/internal_server_error_body.py → workflows/types/workflow_graph.py} +4 -8
  115. phenoml/workflows/types/workflow_response.py +61 -0
  116. phenoml/workflows/types/workflow_response_graph.py +23 -0
  117. phenoml/workflows/types/workflow_step.py +55 -0
  118. phenoml/workflows/types/workflow_step_summary.py +47 -0
  119. phenoml/workflows/types/workflow_step_summary_type.py +5 -0
  120. phenoml/workflows/types/workflow_step_type.py +5 -0
  121. phenoml/workflows/types/workflows_delete_response.py +20 -0
  122. phenoml/workflows/types/workflows_get_response.py +26 -0
  123. phenoml/workflows/types/workflows_update_response.py +31 -0
  124. phenoml-0.0.15.dist-info/LICENSE +21 -0
  125. {phenoml-0.0.2.dist-info → phenoml-0.0.15.dist-info}/METADATA +1 -1
  126. phenoml-0.0.15.dist-info/RECORD +242 -0
  127. phenoml/agent/types/agent_provider.py +0 -7
  128. phenoml/agent/types/provider_type.py +0 -5
  129. phenoml/construe/types/construe_cohort_request_config.py +0 -37
  130. phenoml/construe/types/construe_cohort_response.py +0 -33
  131. phenoml/construe/types/construe_cohort_response_queries_item.py +0 -49
  132. phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item.py +0 -31
  133. phenoml/tools/types/cohort_request_provider.py +0 -5
  134. phenoml/tools/types/lang2fhir_and_create_request_provider.py +0 -7
  135. phenoml/tools/types/lang2fhir_and_search_request_provider.py +0 -7
  136. phenoml-0.0.2.dist-info/RECORD +0 -153
  137. {phenoml-0.0.2.dist-info → phenoml-0.0.15.dist-info}/WHEEL +0 -0
phenoml/agent/__init__.py CHANGED
@@ -4,23 +4,22 @@
4
4
 
5
5
  from .types import (
6
6
  AgentChatResponse,
7
+ AgentCreateRequest,
8
+ AgentCreateRequestProvider,
7
9
  AgentDeleteResponse,
8
- AgentFhirConfig,
9
10
  AgentGetChatMessagesRequestOrder,
10
11
  AgentGetChatMessagesResponse,
11
12
  AgentListResponse,
12
13
  AgentPromptsResponse,
13
- AgentProvider,
14
14
  AgentResponse,
15
15
  AgentTemplate,
16
- ChatFhirClientConfig,
16
+ AgentTemplateProvider,
17
17
  ChatMessageTemplate,
18
18
  ChatSessionTemplate,
19
19
  JsonPatch,
20
20
  JsonPatchOperation,
21
21
  JsonPatchOperationOp,
22
22
  PromptTemplate,
23
- ProviderType,
24
23
  SuccessResponse,
25
24
  )
26
25
  from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError
@@ -29,17 +28,17 @@ from .prompts import PromptsDeleteResponse, PromptsListResponse
29
28
 
30
29
  __all__ = [
31
30
  "AgentChatResponse",
31
+ "AgentCreateRequest",
32
+ "AgentCreateRequestProvider",
32
33
  "AgentDeleteResponse",
33
- "AgentFhirConfig",
34
34
  "AgentGetChatMessagesRequestOrder",
35
35
  "AgentGetChatMessagesResponse",
36
36
  "AgentListResponse",
37
37
  "AgentPromptsResponse",
38
- "AgentProvider",
39
38
  "AgentResponse",
40
39
  "AgentTemplate",
40
+ "AgentTemplateProvider",
41
41
  "BadRequestError",
42
- "ChatFhirClientConfig",
43
42
  "ChatMessageTemplate",
44
43
  "ChatSessionTemplate",
45
44
  "ForbiddenError",
@@ -51,7 +50,6 @@ __all__ = [
51
50
  "PromptTemplate",
52
51
  "PromptsDeleteResponse",
53
52
  "PromptsListResponse",
54
- "ProviderType",
55
53
  "SuccessResponse",
56
54
  "UnauthorizedError",
57
55
  "prompts",
phenoml/agent/client.py CHANGED
@@ -7,14 +7,12 @@ from ..core.request_options import RequestOptions
7
7
  from .prompts.client import AsyncPromptsClient, PromptsClient
8
8
  from .raw_client import AsyncRawAgentClient, RawAgentClient
9
9
  from .types.agent_chat_response import AgentChatResponse
10
+ from .types.agent_create_request_provider import AgentCreateRequestProvider
10
11
  from .types.agent_delete_response import AgentDeleteResponse
11
- from .types.agent_fhir_config import AgentFhirConfig
12
12
  from .types.agent_get_chat_messages_request_order import AgentGetChatMessagesRequestOrder
13
13
  from .types.agent_get_chat_messages_response import AgentGetChatMessagesResponse
14
14
  from .types.agent_list_response import AgentListResponse
15
- from .types.agent_provider import AgentProvider
16
15
  from .types.agent_response import AgentResponse
17
- from .types.chat_fhir_client_config import ChatFhirClientConfig
18
16
  from .types.json_patch import JsonPatch
19
17
 
20
18
  # this is used as the default value for optional parameters
@@ -46,8 +44,7 @@ class AgentClient:
46
44
  description: typing.Optional[str] = OMIT,
47
45
  tools: typing.Optional[typing.Sequence[str]] = OMIT,
48
46
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
49
- provider: typing.Optional[AgentProvider] = OMIT,
50
- meta: typing.Optional[AgentFhirConfig] = OMIT,
47
+ provider: typing.Optional[AgentCreateRequestProvider] = OMIT,
51
48
  request_options: typing.Optional[RequestOptions] = None,
52
49
  ) -> AgentResponse:
53
50
  """
@@ -73,10 +70,8 @@ class AgentClient:
73
70
  tags : typing.Optional[typing.Sequence[str]]
74
71
  Tags for categorizing the agent
75
72
 
76
- provider : typing.Optional[AgentProvider]
77
- FHIR provider type - can be a single provider or array of providers
78
-
79
- meta : typing.Optional[AgentFhirConfig]
73
+ provider : typing.Optional[AgentCreateRequestProvider]
74
+ FHIR provider ID(s) - must be valid UUIDs from existing FHIR providers
80
75
 
81
76
  request_options : typing.Optional[RequestOptions]
82
77
  Request-specific configuration.
@@ -107,7 +102,6 @@ class AgentClient:
107
102
  tools=tools,
108
103
  tags=tags,
109
104
  provider=provider,
110
- meta=meta,
111
105
  request_options=request_options,
112
106
  )
113
107
  return _response.data
@@ -145,7 +139,10 @@ class AgentClient:
145
139
  client = phenoml(
146
140
  token="YOUR_TOKEN",
147
141
  )
148
- client.agent.list()
142
+ client.agent.list(
143
+ is_active=True,
144
+ tags="tags",
145
+ )
149
146
  """
150
147
  _response = self._raw_client.list(is_active=is_active, tags=tags, request_options=request_options)
151
148
  return _response.data
@@ -185,14 +182,13 @@ class AgentClient:
185
182
  self,
186
183
  id: str,
187
184
  *,
188
- name: typing.Optional[str] = OMIT,
185
+ name: str,
186
+ prompts: typing.Sequence[str],
187
+ is_active: bool,
189
188
  description: typing.Optional[str] = OMIT,
190
- prompts: typing.Optional[typing.Sequence[str]] = OMIT,
191
189
  tools: typing.Optional[typing.Sequence[str]] = OMIT,
192
- is_active: typing.Optional[bool] = OMIT,
193
190
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
194
- provider: typing.Optional[AgentProvider] = OMIT,
195
- meta: typing.Optional[AgentFhirConfig] = OMIT,
191
+ provider: typing.Optional[AgentCreateRequestProvider] = OMIT,
196
192
  request_options: typing.Optional[RequestOptions] = None,
197
193
  ) -> AgentResponse:
198
194
  """
@@ -203,28 +199,26 @@ class AgentClient:
203
199
  id : str
204
200
  Agent ID
205
201
 
206
- name : typing.Optional[str]
202
+ name : str
207
203
  Agent name
208
204
 
205
+ prompts : typing.Sequence[str]
206
+ Array of prompt IDs to use for this agent
207
+
208
+ is_active : bool
209
+ Whether the agent is active
210
+
209
211
  description : typing.Optional[str]
210
212
  Agent description
211
213
 
212
- prompts : typing.Optional[typing.Sequence[str]]
213
- Array of prompt IDs to use for this agent
214
-
215
214
  tools : typing.Optional[typing.Sequence[str]]
216
215
  Array of MCP server tool IDs to use for this agent
217
216
 
218
- is_active : typing.Optional[bool]
219
- Whether the agent is active
220
-
221
217
  tags : typing.Optional[typing.Sequence[str]]
222
218
  Tags for categorizing the agent
223
219
 
224
- provider : typing.Optional[AgentProvider]
225
- FHIR provider type - can be a single provider or array of providers
226
-
227
- meta : typing.Optional[AgentFhirConfig]
220
+ provider : typing.Optional[AgentCreateRequestProvider]
221
+ FHIR provider ID(s) - must be valid UUIDs from existing FHIR providers
228
222
 
229
223
  request_options : typing.Optional[RequestOptions]
230
224
  Request-specific configuration.
@@ -243,18 +237,20 @@ class AgentClient:
243
237
  )
244
238
  client.agent.update(
245
239
  id="id",
240
+ name="name",
241
+ prompts=["prompt_123", "prompt_456"],
242
+ is_active=True,
246
243
  )
247
244
  """
248
245
  _response = self._raw_client.update(
249
246
  id,
250
247
  name=name,
251
- description=description,
252
248
  prompts=prompts,
253
- tools=tools,
254
249
  is_active=is_active,
250
+ description=description,
251
+ tools=tools,
255
252
  tags=tags,
256
253
  provider=provider,
257
- meta=meta,
258
254
  request_options=request_options,
259
255
  )
260
256
  return _response.data
@@ -347,9 +343,10 @@ class AgentClient:
347
343
  *,
348
344
  message: str,
349
345
  agent_id: str,
346
+ phenoml_on_behalf_of: typing.Optional[str] = None,
347
+ phenoml_fhir_provider: typing.Optional[str] = None,
350
348
  context: typing.Optional[str] = OMIT,
351
349
  session_id: typing.Optional[str] = OMIT,
352
- meta: typing.Optional[ChatFhirClientConfig] = OMIT,
353
350
  request_options: typing.Optional[RequestOptions] = None,
354
351
  ) -> AgentChatResponse:
355
352
  """
@@ -363,15 +360,20 @@ class AgentClient:
363
360
  agent_id : str
364
361
  The ID of the agent to chat with
365
362
 
363
+ phenoml_on_behalf_of : typing.Optional[str]
364
+ Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
365
+ Must be in the format: Patient/{uuid} or Practitioner/{uuid}
366
+
367
+ phenoml_fhir_provider : typing.Optional[str]
368
+ Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
369
+ Multiple FHIR provider integrations can be provided as comma-separated values.
370
+
366
371
  context : typing.Optional[str]
367
372
  Optional context for the conversation
368
373
 
369
374
  session_id : typing.Optional[str]
370
375
  Optional session ID for conversation continuity
371
376
 
372
- meta : typing.Optional[ChatFhirClientConfig]
373
- Optional user-specific FHIR configuration overrides
374
-
375
377
  request_options : typing.Optional[RequestOptions]
376
378
  Request-specific configuration.
377
379
 
@@ -388,6 +390,8 @@ class AgentClient:
388
390
  token="YOUR_TOKEN",
389
391
  )
390
392
  client.agent.chat(
393
+ phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
394
+ phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
391
395
  message="What is the patient's current condition?",
392
396
  agent_id="agent-123",
393
397
  )
@@ -395,9 +399,10 @@ class AgentClient:
395
399
  _response = self._raw_client.chat(
396
400
  message=message,
397
401
  agent_id=agent_id,
402
+ phenoml_on_behalf_of=phenoml_on_behalf_of,
403
+ phenoml_fhir_provider=phenoml_fhir_provider,
398
404
  context=context,
399
405
  session_id=session_id,
400
- meta=meta,
401
406
  request_options=request_options,
402
407
  )
403
408
  return _response.data
@@ -445,6 +450,9 @@ class AgentClient:
445
450
  )
446
451
  client.agent.get_chat_messages(
447
452
  chat_session_id="chat_session_id",
453
+ num_messages=1,
454
+ role="role",
455
+ order="asc",
448
456
  )
449
457
  """
450
458
  _response = self._raw_client.get_chat_messages(
@@ -482,8 +490,7 @@ class AsyncAgentClient:
482
490
  description: typing.Optional[str] = OMIT,
483
491
  tools: typing.Optional[typing.Sequence[str]] = OMIT,
484
492
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
485
- provider: typing.Optional[AgentProvider] = OMIT,
486
- meta: typing.Optional[AgentFhirConfig] = OMIT,
493
+ provider: typing.Optional[AgentCreateRequestProvider] = OMIT,
487
494
  request_options: typing.Optional[RequestOptions] = None,
488
495
  ) -> AgentResponse:
489
496
  """
@@ -509,10 +516,8 @@ class AsyncAgentClient:
509
516
  tags : typing.Optional[typing.Sequence[str]]
510
517
  Tags for categorizing the agent
511
518
 
512
- provider : typing.Optional[AgentProvider]
513
- FHIR provider type - can be a single provider or array of providers
514
-
515
- meta : typing.Optional[AgentFhirConfig]
519
+ provider : typing.Optional[AgentCreateRequestProvider]
520
+ FHIR provider ID(s) - must be valid UUIDs from existing FHIR providers
516
521
 
517
522
  request_options : typing.Optional[RequestOptions]
518
523
  Request-specific configuration.
@@ -551,7 +556,6 @@ class AsyncAgentClient:
551
556
  tools=tools,
552
557
  tags=tags,
553
558
  provider=provider,
554
- meta=meta,
555
559
  request_options=request_options,
556
560
  )
557
561
  return _response.data
@@ -594,7 +598,10 @@ class AsyncAgentClient:
594
598
 
595
599
 
596
600
  async def main() -> None:
597
- await client.agent.list()
601
+ await client.agent.list(
602
+ is_active=True,
603
+ tags="tags",
604
+ )
598
605
 
599
606
 
600
607
  asyncio.run(main())
@@ -645,14 +652,13 @@ class AsyncAgentClient:
645
652
  self,
646
653
  id: str,
647
654
  *,
648
- name: typing.Optional[str] = OMIT,
655
+ name: str,
656
+ prompts: typing.Sequence[str],
657
+ is_active: bool,
649
658
  description: typing.Optional[str] = OMIT,
650
- prompts: typing.Optional[typing.Sequence[str]] = OMIT,
651
659
  tools: typing.Optional[typing.Sequence[str]] = OMIT,
652
- is_active: typing.Optional[bool] = OMIT,
653
660
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
654
- provider: typing.Optional[AgentProvider] = OMIT,
655
- meta: typing.Optional[AgentFhirConfig] = OMIT,
661
+ provider: typing.Optional[AgentCreateRequestProvider] = OMIT,
656
662
  request_options: typing.Optional[RequestOptions] = None,
657
663
  ) -> AgentResponse:
658
664
  """
@@ -663,28 +669,26 @@ class AsyncAgentClient:
663
669
  id : str
664
670
  Agent ID
665
671
 
666
- name : typing.Optional[str]
672
+ name : str
667
673
  Agent name
668
674
 
675
+ prompts : typing.Sequence[str]
676
+ Array of prompt IDs to use for this agent
677
+
678
+ is_active : bool
679
+ Whether the agent is active
680
+
669
681
  description : typing.Optional[str]
670
682
  Agent description
671
683
 
672
- prompts : typing.Optional[typing.Sequence[str]]
673
- Array of prompt IDs to use for this agent
674
-
675
684
  tools : typing.Optional[typing.Sequence[str]]
676
685
  Array of MCP server tool IDs to use for this agent
677
686
 
678
- is_active : typing.Optional[bool]
679
- Whether the agent is active
680
-
681
687
  tags : typing.Optional[typing.Sequence[str]]
682
688
  Tags for categorizing the agent
683
689
 
684
- provider : typing.Optional[AgentProvider]
685
- FHIR provider type - can be a single provider or array of providers
686
-
687
- meta : typing.Optional[AgentFhirConfig]
690
+ provider : typing.Optional[AgentCreateRequestProvider]
691
+ FHIR provider ID(s) - must be valid UUIDs from existing FHIR providers
688
692
 
689
693
  request_options : typing.Optional[RequestOptions]
690
694
  Request-specific configuration.
@@ -708,6 +712,9 @@ class AsyncAgentClient:
708
712
  async def main() -> None:
709
713
  await client.agent.update(
710
714
  id="id",
715
+ name="name",
716
+ prompts=["prompt_123", "prompt_456"],
717
+ is_active=True,
711
718
  )
712
719
 
713
720
 
@@ -716,13 +723,12 @@ class AsyncAgentClient:
716
723
  _response = await self._raw_client.update(
717
724
  id,
718
725
  name=name,
719
- description=description,
720
726
  prompts=prompts,
721
- tools=tools,
722
727
  is_active=is_active,
728
+ description=description,
729
+ tools=tools,
723
730
  tags=tags,
724
731
  provider=provider,
725
- meta=meta,
726
732
  request_options=request_options,
727
733
  )
728
734
  return _response.data
@@ -831,9 +837,10 @@ class AsyncAgentClient:
831
837
  *,
832
838
  message: str,
833
839
  agent_id: str,
840
+ phenoml_on_behalf_of: typing.Optional[str] = None,
841
+ phenoml_fhir_provider: typing.Optional[str] = None,
834
842
  context: typing.Optional[str] = OMIT,
835
843
  session_id: typing.Optional[str] = OMIT,
836
- meta: typing.Optional[ChatFhirClientConfig] = OMIT,
837
844
  request_options: typing.Optional[RequestOptions] = None,
838
845
  ) -> AgentChatResponse:
839
846
  """
@@ -847,15 +854,20 @@ class AsyncAgentClient:
847
854
  agent_id : str
848
855
  The ID of the agent to chat with
849
856
 
857
+ phenoml_on_behalf_of : typing.Optional[str]
858
+ Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
859
+ Must be in the format: Patient/{uuid} or Practitioner/{uuid}
860
+
861
+ phenoml_fhir_provider : typing.Optional[str]
862
+ Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
863
+ Multiple FHIR provider integrations can be provided as comma-separated values.
864
+
850
865
  context : typing.Optional[str]
851
866
  Optional context for the conversation
852
867
 
853
868
  session_id : typing.Optional[str]
854
869
  Optional session ID for conversation continuity
855
870
 
856
- meta : typing.Optional[ChatFhirClientConfig]
857
- Optional user-specific FHIR configuration overrides
858
-
859
871
  request_options : typing.Optional[RequestOptions]
860
872
  Request-specific configuration.
861
873
 
@@ -877,6 +889,8 @@ class AsyncAgentClient:
877
889
 
878
890
  async def main() -> None:
879
891
  await client.agent.chat(
892
+ phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
893
+ phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
880
894
  message="What is the patient's current condition?",
881
895
  agent_id="agent-123",
882
896
  )
@@ -887,9 +901,10 @@ class AsyncAgentClient:
887
901
  _response = await self._raw_client.chat(
888
902
  message=message,
889
903
  agent_id=agent_id,
904
+ phenoml_on_behalf_of=phenoml_on_behalf_of,
905
+ phenoml_fhir_provider=phenoml_fhir_provider,
890
906
  context=context,
891
907
  session_id=session_id,
892
- meta=meta,
893
908
  request_options=request_options,
894
909
  )
895
910
  return _response.data
@@ -942,6 +957,9 @@ class AsyncAgentClient:
942
957
  async def main() -> None:
943
958
  await client.agent.get_chat_messages(
944
959
  chat_session_id="chat_session_id",
960
+ num_messages=1,
961
+ role="role",
962
+ order="asc",
945
963
  )
946
964
 
947
965