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
@@ -2,12 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- from .agent_template_provider_item import AgentTemplateProviderItem
6
-
7
- AgentTemplateProvider = typing.Union[
8
- typing.Literal["medplum"],
9
- typing.Literal["google_healthcare"],
10
- typing.Literal["canvas"],
11
- typing.Literal["hapi"],
12
- typing.List[AgentTemplateProviderItem],
13
- ]
5
+ AgentTemplateProvider = typing.Union[str, typing.List[str]]
@@ -0,0 +1,72 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class ChatMessageTemplate(UniversalBaseModel):
10
+ id: typing.Optional[str] = pydantic.Field(default=None)
11
+ """
12
+ Chat message ID
13
+ """
14
+
15
+ session_id: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ Chat session ID
18
+ """
19
+
20
+ role: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ Message role
23
+ """
24
+
25
+ content: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Message content
28
+ """
29
+
30
+ created: typing.Optional[str] = pydantic.Field(default=None)
31
+ """
32
+ Message created time
33
+ """
34
+
35
+ updated: typing.Optional[str] = pydantic.Field(default=None)
36
+ """
37
+ Message updated time
38
+ """
39
+
40
+ user_id: typing.Optional[str] = pydantic.Field(default=None)
41
+ """
42
+ User ID
43
+ """
44
+
45
+ function_name: typing.Optional[str] = pydantic.Field(default=None)
46
+ """
47
+ Function name
48
+ """
49
+
50
+ function_args: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
51
+ """
52
+ Function arguments
53
+ """
54
+
55
+ function_result: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
56
+ """
57
+ Function result
58
+ """
59
+
60
+ message_order: typing.Optional[int] = pydantic.Field(default=None)
61
+ """
62
+ Message order
63
+ """
64
+
65
+ if IS_PYDANTIC_V2:
66
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
67
+ else:
68
+
69
+ class Config:
70
+ frozen = True
71
+ smart_union = True
72
+ extra = pydantic.Extra.allow
@@ -0,0 +1,67 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class ChatSessionTemplate(UniversalBaseModel):
10
+ id: typing.Optional[str] = pydantic.Field(default=None)
11
+ """
12
+ Chat session ID
13
+ """
14
+
15
+ user_id: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ User ID
18
+ """
19
+
20
+ session_id: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ Chat session ID
23
+ """
24
+
25
+ status: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Chat session status
28
+ """
29
+
30
+ system_prompt: typing.Optional[str] = pydantic.Field(default=None)
31
+ """
32
+ System prompt
33
+ """
34
+
35
+ title: typing.Optional[str] = pydantic.Field(default=None)
36
+ """
37
+ Chat session title
38
+ """
39
+
40
+ agent_id: typing.Optional[str] = pydantic.Field(default=None)
41
+ """
42
+ Agent ID
43
+ """
44
+
45
+ created: typing.Optional[str] = pydantic.Field(default=None)
46
+ """
47
+ Chat session created time
48
+ """
49
+
50
+ last_message_at: typing.Optional[str] = pydantic.Field(default=None)
51
+ """
52
+ Chat session last message time
53
+ """
54
+
55
+ updated: typing.Optional[str] = pydantic.Field(default=None)
56
+ """
57
+ Chat session updated time
58
+ """
59
+
60
+ if IS_PYDANTIC_V2:
61
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
62
+ else:
63
+
64
+ class Config:
65
+ frozen = True
66
+ smart_union = True
67
+ extra = pydantic.Extra.allow
phenoml/client.py CHANGED
@@ -9,6 +9,8 @@ from .cohort.client import AsyncCohortClient, CohortClient
9
9
  from .construe.client import AsyncConstrueClient, ConstrueClient
10
10
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
11
  from .environment import phenomlEnvironment
12
+ from .fhir.client import AsyncFhirClient, FhirClient
13
+ from .fhir_provider.client import AsyncFhirProviderClient, FhirProviderClient
12
14
  from .lang2fhir.client import AsyncLang2FhirClient, Lang2FhirClient
13
15
  from .tools.client import AsyncToolsClient, ToolsClient
14
16
 
@@ -82,6 +84,8 @@ class phenoml:
82
84
  self.authtoken = AuthtokenClient(client_wrapper=self._client_wrapper)
83
85
  self.cohort = CohortClient(client_wrapper=self._client_wrapper)
84
86
  self.construe = ConstrueClient(client_wrapper=self._client_wrapper)
87
+ self.fhir = FhirClient(client_wrapper=self._client_wrapper)
88
+ self.fhir_provider = FhirProviderClient(client_wrapper=self._client_wrapper)
85
89
  self.lang2fhir = Lang2FhirClient(client_wrapper=self._client_wrapper)
86
90
  self.tools = ToolsClient(client_wrapper=self._client_wrapper)
87
91
 
@@ -155,6 +159,8 @@ class Asyncphenoml:
155
159
  self.authtoken = AsyncAuthtokenClient(client_wrapper=self._client_wrapper)
156
160
  self.cohort = AsyncCohortClient(client_wrapper=self._client_wrapper)
157
161
  self.construe = AsyncConstrueClient(client_wrapper=self._client_wrapper)
162
+ self.fhir = AsyncFhirClient(client_wrapper=self._client_wrapper)
163
+ self.fhir_provider = AsyncFhirProviderClient(client_wrapper=self._client_wrapper)
158
164
  self.lang2fhir = AsyncLang2FhirClient(client_wrapper=self._client_wrapper)
159
165
  self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper)
160
166
 
@@ -22,10 +22,10 @@ class BaseClientWrapper:
22
22
 
23
23
  def get_headers(self) -> typing.Dict[str, str]:
24
24
  headers: typing.Dict[str, str] = {
25
- "User-Agent": "phenoml/0.0.1",
25
+ "User-Agent": "phenoml/0.0.5",
26
26
  "X-Fern-Language": "Python",
27
27
  "X-Fern-SDK-Name": "phenoml",
28
- "X-Fern-SDK-Version": "0.0.1",
28
+ "X-Fern-SDK-Version": "0.0.5",
29
29
  **(self.get_custom_headers() or {}),
30
30
  }
31
31
  headers["Authorization"] = f"Bearer {self._get_token()}"
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ ErrorResponse,
7
+ FhirBundle,
8
+ FhirBundleEntryItem,
9
+ FhirBundleEntryItemRequest,
10
+ FhirBundleEntryItemRequestMethod,
11
+ FhirBundleEntryItemResponse,
12
+ FhirPatchRequestBodyItem,
13
+ FhirPatchRequestBodyItemOp,
14
+ FhirResource,
15
+ FhirResourceMeta,
16
+ FhirSearchResponse,
17
+ )
18
+ from .errors import BadRequestError, InternalServerError, NotFoundError, UnauthorizedError
19
+
20
+ __all__ = [
21
+ "BadRequestError",
22
+ "ErrorResponse",
23
+ "FhirBundle",
24
+ "FhirBundleEntryItem",
25
+ "FhirBundleEntryItemRequest",
26
+ "FhirBundleEntryItemRequestMethod",
27
+ "FhirBundleEntryItemResponse",
28
+ "FhirPatchRequestBodyItem",
29
+ "FhirPatchRequestBodyItemOp",
30
+ "FhirResource",
31
+ "FhirResourceMeta",
32
+ "FhirSearchResponse",
33
+ "InternalServerError",
34
+ "NotFoundError",
35
+ "UnauthorizedError",
36
+ ]