phenoml 0.0.1__py3-none-any.whl → 0.0.5__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.

Potentially problematic release.


This version of phenoml might be problematic. Click here for more details.

Files changed (86) hide show
  1. phenoml/agent/__init__.py +10 -12
  2. phenoml/agent/client.py +172 -65
  3. phenoml/agent/prompts/client.py +60 -60
  4. phenoml/agent/prompts/raw_client.py +134 -134
  5. phenoml/agent/raw_client.py +236 -69
  6. phenoml/agent/types/__init__.py +10 -12
  7. phenoml/agent/types/agent_create_request.py +53 -0
  8. phenoml/agent/types/agent_create_request_provider.py +1 -9
  9. phenoml/agent/types/agent_get_chat_messages_request_order.py +5 -0
  10. phenoml/agent/types/agent_get_chat_messages_response.py +22 -0
  11. phenoml/agent/types/agent_template.py +6 -4
  12. phenoml/agent/types/agent_template_provider.py +1 -9
  13. phenoml/agent/types/chat_message_template.py +72 -0
  14. phenoml/agent/types/chat_session_template.py +67 -0
  15. phenoml/client.py +6 -0
  16. phenoml/core/client_wrapper.py +2 -2
  17. phenoml/fhir/__init__.py +36 -0
  18. phenoml/fhir/client.py +970 -0
  19. phenoml/fhir/errors/__init__.py +10 -0
  20. phenoml/fhir/errors/bad_request_error.py +10 -0
  21. phenoml/fhir/errors/internal_server_error.py +10 -0
  22. phenoml/fhir/errors/not_found_error.py +10 -0
  23. phenoml/fhir/errors/unauthorized_error.py +10 -0
  24. phenoml/fhir/raw_client.py +1385 -0
  25. phenoml/fhir/types/__init__.py +29 -0
  26. phenoml/{agent/types/chat_fhir_client_config.py → fhir/types/error_response.py} +11 -6
  27. phenoml/fhir/types/fhir_bundle.py +43 -0
  28. phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
  29. phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
  30. phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
  31. phenoml/fhir/types/fhir_bundle_entry_item_response.py +24 -0
  32. phenoml/fhir/types/fhir_patch_request_body_item.py +36 -0
  33. phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
  34. phenoml/fhir/types/fhir_resource.py +40 -0
  35. phenoml/fhir/types/fhir_resource_meta.py +28 -0
  36. phenoml/fhir/types/fhir_search_response.py +8 -0
  37. phenoml/fhir_provider/__init__.py +43 -0
  38. phenoml/fhir_provider/client.py +731 -0
  39. phenoml/fhir_provider/errors/__init__.py +11 -0
  40. phenoml/fhir_provider/errors/bad_request_error.py +10 -0
  41. phenoml/fhir_provider/errors/forbidden_error.py +10 -0
  42. phenoml/fhir_provider/errors/internal_server_error.py +10 -0
  43. phenoml/fhir_provider/errors/not_found_error.py +10 -0
  44. phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
  45. phenoml/fhir_provider/raw_client.py +1445 -0
  46. phenoml/fhir_provider/types/__init__.py +35 -0
  47. phenoml/fhir_provider/types/auth_method.py +7 -0
  48. phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
  49. phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
  50. phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
  51. phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
  52. phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
  53. phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
  54. phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
  55. phenoml/fhir_provider/types/fhir_query_response.py +27 -0
  56. phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
  57. phenoml/fhir_provider/types/json_web_key.py +51 -0
  58. phenoml/fhir_provider/types/provider.py +8 -0
  59. phenoml/fhir_provider/types/service_account_key.py +35 -0
  60. phenoml/fhir_provider/types/smart_configuration.py +46 -0
  61. phenoml/tools/__init__.py +12 -8
  62. phenoml/tools/client.py +27 -60
  63. phenoml/tools/mcp_server/__init__.py +7 -0
  64. phenoml/tools/mcp_server/client.py +336 -0
  65. phenoml/tools/mcp_server/raw_client.py +641 -0
  66. phenoml/tools/mcp_server/tools/__init__.py +4 -0
  67. phenoml/tools/mcp_server/tools/client.py +358 -0
  68. phenoml/tools/mcp_server/tools/raw_client.py +656 -0
  69. phenoml/tools/raw_client.py +18 -67
  70. phenoml/tools/types/__init__.py +10 -8
  71. phenoml/{agent/types/agent_fhir_config.py → tools/types/mcp_server_response.py} +8 -6
  72. phenoml/tools/types/mcp_server_response_data.py +51 -0
  73. phenoml/tools/types/mcp_server_tool_call_response.py +37 -0
  74. phenoml/tools/types/{fhir_client_config.py → mcp_server_tool_response.py} +8 -6
  75. phenoml/tools/types/mcp_server_tool_response_data.py +61 -0
  76. {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/METADATA +1 -1
  77. {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/RECORD +79 -29
  78. phenoml/agent/types/agent_create_request_provider_item.py +0 -7
  79. phenoml/agent/types/agent_template_provider_item.py +0 -5
  80. phenoml/agent/types/agent_update_request_provider.py +0 -13
  81. phenoml/agent/types/agent_update_request_provider_item.py +0 -7
  82. phenoml/tools/types/cohort_request_provider.py +0 -5
  83. phenoml/tools/types/lang2fhir_and_create_request_provider.py +0 -7
  84. phenoml/tools/types/lang2fhir_and_search_request_provider.py +0 -7
  85. {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/LICENSE +0 -0
  86. {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/WHEEL +0 -0
@@ -29,35 +29,86 @@ class RawPromptsClient:
29
29
  def __init__(self, *, client_wrapper: SyncClientWrapper):
30
30
  self._client_wrapper = client_wrapper
31
31
 
32
- def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[PromptsListResponse]:
32
+ def create(
33
+ self,
34
+ *,
35
+ name: str,
36
+ content: str,
37
+ is_active: bool,
38
+ description: typing.Optional[str] = OMIT,
39
+ is_default: typing.Optional[bool] = OMIT,
40
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
41
+ request_options: typing.Optional[RequestOptions] = None,
42
+ ) -> HttpResponse[AgentPromptsResponse]:
33
43
  """
34
- Retrieves a list of agent prompts belonging to the authenticated user
44
+ Creates a new agent prompt
35
45
 
36
46
  Parameters
37
47
  ----------
48
+ name : str
49
+ Prompt name
50
+
51
+ content : str
52
+ Prompt content
53
+
54
+ is_active : bool
55
+ Whether the prompt is active
56
+
57
+ description : typing.Optional[str]
58
+ Prompt description
59
+
60
+ is_default : typing.Optional[bool]
61
+ Whether this is a default prompt
62
+
63
+ tags : typing.Optional[typing.Sequence[str]]
64
+ Tags for categorizing the prompt
65
+
38
66
  request_options : typing.Optional[RequestOptions]
39
67
  Request-specific configuration.
40
68
 
41
69
  Returns
42
70
  -------
43
- HttpResponse[PromptsListResponse]
44
- Prompts retrieved successfully
71
+ HttpResponse[AgentPromptsResponse]
72
+ Prompt created successfully
45
73
  """
46
74
  _response = self._client_wrapper.httpx_client.request(
47
75
  "agent/prompts",
48
- method="GET",
76
+ method="POST",
77
+ json={
78
+ "name": name,
79
+ "description": description,
80
+ "content": content,
81
+ "is_default": is_default,
82
+ "is_active": is_active,
83
+ "tags": tags,
84
+ },
85
+ headers={
86
+ "content-type": "application/json",
87
+ },
49
88
  request_options=request_options,
89
+ omit=OMIT,
50
90
  )
51
91
  try:
52
92
  if 200 <= _response.status_code < 300:
53
93
  _data = typing.cast(
54
- PromptsListResponse,
94
+ AgentPromptsResponse,
55
95
  parse_obj_as(
56
- type_=PromptsListResponse, # type: ignore
96
+ type_=AgentPromptsResponse, # type: ignore
57
97
  object_=_response.json(),
58
98
  ),
59
99
  )
60
100
  return HttpResponse(response=_response, data=_data)
101
+ if _response.status_code == 400:
102
+ raise BadRequestError(
103
+ headers=dict(_response.headers),
104
+ body=typing.cast(
105
+ typing.Optional[typing.Any],
106
+ parse_obj_as(
107
+ type_=typing.Optional[typing.Any], # type: ignore
108
+ object_=_response.json(),
109
+ ),
110
+ ),
111
+ )
61
112
  if _response.status_code == 401:
62
113
  raise UnauthorizedError(
63
114
  headers=dict(_response.headers),
@@ -96,86 +147,35 @@ class RawPromptsClient:
96
147
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
97
148
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
98
149
 
99
- def create(
100
- self,
101
- *,
102
- name: str,
103
- content: str,
104
- is_active: bool,
105
- description: typing.Optional[str] = OMIT,
106
- is_default: typing.Optional[bool] = OMIT,
107
- tags: typing.Optional[typing.Sequence[str]] = OMIT,
108
- request_options: typing.Optional[RequestOptions] = None,
109
- ) -> HttpResponse[AgentPromptsResponse]:
150
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[PromptsListResponse]:
110
151
  """
111
- Creates a new agent prompt
152
+ Retrieves a list of agent prompts belonging to the authenticated user
112
153
 
113
154
  Parameters
114
155
  ----------
115
- name : str
116
- Prompt name
117
-
118
- content : str
119
- Prompt content
120
-
121
- is_active : bool
122
- Whether the prompt is active
123
-
124
- description : typing.Optional[str]
125
- Prompt description
126
-
127
- is_default : typing.Optional[bool]
128
- Whether this is a default prompt
129
-
130
- tags : typing.Optional[typing.Sequence[str]]
131
- Tags for categorizing the prompt
132
-
133
156
  request_options : typing.Optional[RequestOptions]
134
157
  Request-specific configuration.
135
158
 
136
159
  Returns
137
160
  -------
138
- HttpResponse[AgentPromptsResponse]
139
- Prompt created successfully
161
+ HttpResponse[PromptsListResponse]
162
+ Prompts retrieved successfully
140
163
  """
141
164
  _response = self._client_wrapper.httpx_client.request(
142
- "agent/prompts",
143
- method="POST",
144
- json={
145
- "name": name,
146
- "description": description,
147
- "content": content,
148
- "is_default": is_default,
149
- "is_active": is_active,
150
- "tags": tags,
151
- },
152
- headers={
153
- "content-type": "application/json",
154
- },
165
+ "agent/prompts/list",
166
+ method="GET",
155
167
  request_options=request_options,
156
- omit=OMIT,
157
168
  )
158
169
  try:
159
170
  if 200 <= _response.status_code < 300:
160
171
  _data = typing.cast(
161
- AgentPromptsResponse,
172
+ PromptsListResponse,
162
173
  parse_obj_as(
163
- type_=AgentPromptsResponse, # type: ignore
174
+ type_=PromptsListResponse, # type: ignore
164
175
  object_=_response.json(),
165
176
  ),
166
177
  )
167
178
  return HttpResponse(response=_response, data=_data)
168
- if _response.status_code == 400:
169
- raise BadRequestError(
170
- headers=dict(_response.headers),
171
- body=typing.cast(
172
- typing.Optional[typing.Any],
173
- parse_obj_as(
174
- type_=typing.Optional[typing.Any], # type: ignore
175
- object_=_response.json(),
176
- ),
177
- ),
178
- )
179
179
  if _response.status_code == 401:
180
180
  raise UnauthorizedError(
181
181
  headers=dict(_response.headers),
@@ -688,37 +688,86 @@ class AsyncRawPromptsClient:
688
688
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
689
689
  self._client_wrapper = client_wrapper
690
690
 
691
- async def list(
692
- self, *, request_options: typing.Optional[RequestOptions] = None
693
- ) -> AsyncHttpResponse[PromptsListResponse]:
691
+ async def create(
692
+ self,
693
+ *,
694
+ name: str,
695
+ content: str,
696
+ is_active: bool,
697
+ description: typing.Optional[str] = OMIT,
698
+ is_default: typing.Optional[bool] = OMIT,
699
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
700
+ request_options: typing.Optional[RequestOptions] = None,
701
+ ) -> AsyncHttpResponse[AgentPromptsResponse]:
694
702
  """
695
- Retrieves a list of agent prompts belonging to the authenticated user
703
+ Creates a new agent prompt
696
704
 
697
705
  Parameters
698
706
  ----------
707
+ name : str
708
+ Prompt name
709
+
710
+ content : str
711
+ Prompt content
712
+
713
+ is_active : bool
714
+ Whether the prompt is active
715
+
716
+ description : typing.Optional[str]
717
+ Prompt description
718
+
719
+ is_default : typing.Optional[bool]
720
+ Whether this is a default prompt
721
+
722
+ tags : typing.Optional[typing.Sequence[str]]
723
+ Tags for categorizing the prompt
724
+
699
725
  request_options : typing.Optional[RequestOptions]
700
726
  Request-specific configuration.
701
727
 
702
728
  Returns
703
729
  -------
704
- AsyncHttpResponse[PromptsListResponse]
705
- Prompts retrieved successfully
730
+ AsyncHttpResponse[AgentPromptsResponse]
731
+ Prompt created successfully
706
732
  """
707
733
  _response = await self._client_wrapper.httpx_client.request(
708
734
  "agent/prompts",
709
- method="GET",
735
+ method="POST",
736
+ json={
737
+ "name": name,
738
+ "description": description,
739
+ "content": content,
740
+ "is_default": is_default,
741
+ "is_active": is_active,
742
+ "tags": tags,
743
+ },
744
+ headers={
745
+ "content-type": "application/json",
746
+ },
710
747
  request_options=request_options,
748
+ omit=OMIT,
711
749
  )
712
750
  try:
713
751
  if 200 <= _response.status_code < 300:
714
752
  _data = typing.cast(
715
- PromptsListResponse,
753
+ AgentPromptsResponse,
716
754
  parse_obj_as(
717
- type_=PromptsListResponse, # type: ignore
755
+ type_=AgentPromptsResponse, # type: ignore
718
756
  object_=_response.json(),
719
757
  ),
720
758
  )
721
759
  return AsyncHttpResponse(response=_response, data=_data)
760
+ if _response.status_code == 400:
761
+ raise BadRequestError(
762
+ headers=dict(_response.headers),
763
+ body=typing.cast(
764
+ typing.Optional[typing.Any],
765
+ parse_obj_as(
766
+ type_=typing.Optional[typing.Any], # type: ignore
767
+ object_=_response.json(),
768
+ ),
769
+ ),
770
+ )
722
771
  if _response.status_code == 401:
723
772
  raise UnauthorizedError(
724
773
  headers=dict(_response.headers),
@@ -757,86 +806,37 @@ class AsyncRawPromptsClient:
757
806
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
758
807
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
759
808
 
760
- async def create(
761
- self,
762
- *,
763
- name: str,
764
- content: str,
765
- is_active: bool,
766
- description: typing.Optional[str] = OMIT,
767
- is_default: typing.Optional[bool] = OMIT,
768
- tags: typing.Optional[typing.Sequence[str]] = OMIT,
769
- request_options: typing.Optional[RequestOptions] = None,
770
- ) -> AsyncHttpResponse[AgentPromptsResponse]:
809
+ async def list(
810
+ self, *, request_options: typing.Optional[RequestOptions] = None
811
+ ) -> AsyncHttpResponse[PromptsListResponse]:
771
812
  """
772
- Creates a new agent prompt
813
+ Retrieves a list of agent prompts belonging to the authenticated user
773
814
 
774
815
  Parameters
775
816
  ----------
776
- name : str
777
- Prompt name
778
-
779
- content : str
780
- Prompt content
781
-
782
- is_active : bool
783
- Whether the prompt is active
784
-
785
- description : typing.Optional[str]
786
- Prompt description
787
-
788
- is_default : typing.Optional[bool]
789
- Whether this is a default prompt
790
-
791
- tags : typing.Optional[typing.Sequence[str]]
792
- Tags for categorizing the prompt
793
-
794
817
  request_options : typing.Optional[RequestOptions]
795
818
  Request-specific configuration.
796
819
 
797
820
  Returns
798
821
  -------
799
- AsyncHttpResponse[AgentPromptsResponse]
800
- Prompt created successfully
822
+ AsyncHttpResponse[PromptsListResponse]
823
+ Prompts retrieved successfully
801
824
  """
802
825
  _response = await self._client_wrapper.httpx_client.request(
803
- "agent/prompts",
804
- method="POST",
805
- json={
806
- "name": name,
807
- "description": description,
808
- "content": content,
809
- "is_default": is_default,
810
- "is_active": is_active,
811
- "tags": tags,
812
- },
813
- headers={
814
- "content-type": "application/json",
815
- },
826
+ "agent/prompts/list",
827
+ method="GET",
816
828
  request_options=request_options,
817
- omit=OMIT,
818
829
  )
819
830
  try:
820
831
  if 200 <= _response.status_code < 300:
821
832
  _data = typing.cast(
822
- AgentPromptsResponse,
833
+ PromptsListResponse,
823
834
  parse_obj_as(
824
- type_=AgentPromptsResponse, # type: ignore
835
+ type_=PromptsListResponse, # type: ignore
825
836
  object_=_response.json(),
826
837
  ),
827
838
  )
828
839
  return AsyncHttpResponse(response=_response, data=_data)
829
- if _response.status_code == 400:
830
- raise BadRequestError(
831
- headers=dict(_response.headers),
832
- body=typing.cast(
833
- typing.Optional[typing.Any],
834
- parse_obj_as(
835
- type_=typing.Optional[typing.Any], # type: ignore
836
- object_=_response.json(),
837
- ),
838
- ),
839
- )
840
840
  if _response.status_code == 401:
841
841
  raise UnauthorizedError(
842
842
  headers=dict(_response.headers),