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.
- phenoml/agent/__init__.py +10 -12
- phenoml/agent/client.py +172 -65
- phenoml/agent/prompts/client.py +60 -60
- phenoml/agent/prompts/raw_client.py +134 -134
- phenoml/agent/raw_client.py +236 -69
- phenoml/agent/types/__init__.py +10 -12
- phenoml/agent/types/agent_create_request.py +53 -0
- phenoml/agent/types/agent_create_request_provider.py +1 -9
- phenoml/agent/types/agent_get_chat_messages_request_order.py +5 -0
- phenoml/agent/types/agent_get_chat_messages_response.py +22 -0
- phenoml/agent/types/agent_template.py +6 -4
- phenoml/agent/types/agent_template_provider.py +1 -9
- phenoml/agent/types/chat_message_template.py +72 -0
- phenoml/agent/types/chat_session_template.py +67 -0
- phenoml/client.py +6 -0
- phenoml/core/client_wrapper.py +2 -2
- phenoml/fhir/__init__.py +36 -0
- phenoml/fhir/client.py +970 -0
- phenoml/fhir/errors/__init__.py +10 -0
- phenoml/fhir/errors/bad_request_error.py +10 -0
- phenoml/fhir/errors/internal_server_error.py +10 -0
- phenoml/fhir/errors/not_found_error.py +10 -0
- phenoml/fhir/errors/unauthorized_error.py +10 -0
- phenoml/fhir/raw_client.py +1385 -0
- phenoml/fhir/types/__init__.py +29 -0
- phenoml/{agent/types/chat_fhir_client_config.py → fhir/types/error_response.py} +11 -6
- phenoml/fhir/types/fhir_bundle.py +43 -0
- phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
- phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
- phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
- phenoml/fhir/types/fhir_bundle_entry_item_response.py +24 -0
- phenoml/fhir/types/fhir_patch_request_body_item.py +36 -0
- phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
- phenoml/fhir/types/fhir_resource.py +40 -0
- phenoml/fhir/types/fhir_resource_meta.py +28 -0
- phenoml/fhir/types/fhir_search_response.py +8 -0
- phenoml/fhir_provider/__init__.py +43 -0
- phenoml/fhir_provider/client.py +731 -0
- phenoml/fhir_provider/errors/__init__.py +11 -0
- phenoml/fhir_provider/errors/bad_request_error.py +10 -0
- phenoml/fhir_provider/errors/forbidden_error.py +10 -0
- phenoml/fhir_provider/errors/internal_server_error.py +10 -0
- phenoml/fhir_provider/errors/not_found_error.py +10 -0
- phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
- phenoml/fhir_provider/raw_client.py +1445 -0
- phenoml/fhir_provider/types/__init__.py +35 -0
- phenoml/fhir_provider/types/auth_method.py +7 -0
- phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
- phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
- phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
- phenoml/fhir_provider/types/fhir_query_response.py +27 -0
- phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
- phenoml/fhir_provider/types/json_web_key.py +51 -0
- phenoml/fhir_provider/types/provider.py +8 -0
- phenoml/fhir_provider/types/service_account_key.py +35 -0
- phenoml/fhir_provider/types/smart_configuration.py +46 -0
- phenoml/tools/__init__.py +12 -8
- phenoml/tools/client.py +27 -60
- phenoml/tools/mcp_server/__init__.py +7 -0
- phenoml/tools/mcp_server/client.py +336 -0
- phenoml/tools/mcp_server/raw_client.py +641 -0
- phenoml/tools/mcp_server/tools/__init__.py +4 -0
- phenoml/tools/mcp_server/tools/client.py +358 -0
- phenoml/tools/mcp_server/tools/raw_client.py +656 -0
- phenoml/tools/raw_client.py +18 -67
- phenoml/tools/types/__init__.py +10 -8
- phenoml/{agent/types/agent_fhir_config.py → tools/types/mcp_server_response.py} +8 -6
- phenoml/tools/types/mcp_server_response_data.py +51 -0
- phenoml/tools/types/mcp_server_tool_call_response.py +37 -0
- phenoml/tools/types/{fhir_client_config.py → mcp_server_tool_response.py} +8 -6
- phenoml/tools/types/mcp_server_tool_response_data.py +61 -0
- {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/METADATA +1 -1
- {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/RECORD +79 -29
- phenoml/agent/types/agent_create_request_provider_item.py +0 -7
- phenoml/agent/types/agent_template_provider_item.py +0 -5
- phenoml/agent/types/agent_update_request_provider.py +0 -13
- phenoml/agent/types/agent_update_request_provider_item.py +0 -7
- phenoml/tools/types/cohort_request_provider.py +0 -5
- phenoml/tools/types/lang2fhir_and_create_request_provider.py +0 -7
- phenoml/tools/types/lang2fhir_and_search_request_provider.py +0 -7
- {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/LICENSE +0 -0
- {phenoml-0.0.1.dist-info → phenoml-0.0.5.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .error_response import ErrorResponse
|
|
6
|
+
from .fhir_bundle import FhirBundle
|
|
7
|
+
from .fhir_bundle_entry_item import FhirBundleEntryItem
|
|
8
|
+
from .fhir_bundle_entry_item_request import FhirBundleEntryItemRequest
|
|
9
|
+
from .fhir_bundle_entry_item_request_method import FhirBundleEntryItemRequestMethod
|
|
10
|
+
from .fhir_bundle_entry_item_response import FhirBundleEntryItemResponse
|
|
11
|
+
from .fhir_patch_request_body_item import FhirPatchRequestBodyItem
|
|
12
|
+
from .fhir_patch_request_body_item_op import FhirPatchRequestBodyItemOp
|
|
13
|
+
from .fhir_resource import FhirResource
|
|
14
|
+
from .fhir_resource_meta import FhirResourceMeta
|
|
15
|
+
from .fhir_search_response import FhirSearchResponse
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"ErrorResponse",
|
|
19
|
+
"FhirBundle",
|
|
20
|
+
"FhirBundleEntryItem",
|
|
21
|
+
"FhirBundleEntryItemRequest",
|
|
22
|
+
"FhirBundleEntryItemRequestMethod",
|
|
23
|
+
"FhirBundleEntryItemResponse",
|
|
24
|
+
"FhirPatchRequestBodyItem",
|
|
25
|
+
"FhirPatchRequestBodyItemOp",
|
|
26
|
+
"FhirResource",
|
|
27
|
+
"FhirResourceMeta",
|
|
28
|
+
"FhirSearchResponse",
|
|
29
|
+
]
|
|
@@ -6,19 +6,24 @@ import pydantic
|
|
|
6
6
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class ErrorResponse(UniversalBaseModel):
|
|
10
10
|
"""
|
|
11
|
-
|
|
11
|
+
Standard error response structure
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
message: str = pydantic.Field()
|
|
15
15
|
"""
|
|
16
|
-
|
|
16
|
+
Human-readable error message
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
code: typing.Optional[int] = pydantic.Field(default=None)
|
|
20
20
|
"""
|
|
21
|
-
|
|
21
|
+
HTTP status code
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Additional error details
|
|
22
27
|
"""
|
|
23
28
|
|
|
24
29
|
if IS_PYDANTIC_V2:
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
from .fhir_bundle_entry_item import FhirBundleEntryItem
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FhirBundle(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Represents a FHIR Bundle response containing multiple resources or operation results.
|
|
15
|
+
Based on the FHIRBundle struct from io/fhir.go.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
resource_type: typing_extensions.Annotated[typing.Literal["Bundle"], FieldMetadata(alias="resourceType")] = (
|
|
19
|
+
pydantic.Field(default="Bundle")
|
|
20
|
+
)
|
|
21
|
+
"""
|
|
22
|
+
Always "Bundle" for bundle resources
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
total: typing.Optional[int] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Total number of resources that match the search criteria.
|
|
28
|
+
Optional field as not all FHIR servers include it (e.g., Medplum).
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
entry: typing.List[FhirBundleEntryItem] = pydantic.Field()
|
|
32
|
+
"""
|
|
33
|
+
Array of bundle entries containing resources or operation results
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
if IS_PYDANTIC_V2:
|
|
37
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
38
|
+
else:
|
|
39
|
+
|
|
40
|
+
class Config:
|
|
41
|
+
frozen = True
|
|
42
|
+
smart_union = True
|
|
43
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
from .fhir_bundle_entry_item_request import FhirBundleEntryItemRequest
|
|
8
|
+
from .fhir_bundle_entry_item_response import FhirBundleEntryItemResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FhirBundleEntryItem(UniversalBaseModel):
|
|
12
|
+
resource: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
13
|
+
"""
|
|
14
|
+
The FHIR resource contained in this entry
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
request: typing.Optional[FhirBundleEntryItemRequest] = pydantic.Field(default=None)
|
|
18
|
+
"""
|
|
19
|
+
Request information for transaction/batch bundles
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
response: typing.Optional[FhirBundleEntryItemResponse] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
Response information for transaction/batch bundle responses
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
if IS_PYDANTIC_V2:
|
|
28
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
29
|
+
else:
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
from .fhir_bundle_entry_item_request_method import FhirBundleEntryItemRequestMethod
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FhirBundleEntryItemRequest(UniversalBaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Request information for transaction/batch bundles
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
method: typing.Optional[FhirBundleEntryItemRequestMethod] = None
|
|
16
|
+
url: typing.Optional[str] = None
|
|
17
|
+
|
|
18
|
+
if IS_PYDANTIC_V2:
|
|
19
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
20
|
+
else:
|
|
21
|
+
|
|
22
|
+
class Config:
|
|
23
|
+
frozen = True
|
|
24
|
+
smart_union = True
|
|
25
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,24 @@
|
|
|
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 FhirBundleEntryItemResponse(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Response information for transaction/batch bundle responses
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
status: typing.Optional[str] = None
|
|
15
|
+
location: typing.Optional[str] = None
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
from .fhir_patch_request_body_item_op import FhirPatchRequestBodyItemOp
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FhirPatchRequestBodyItem(UniversalBaseModel):
|
|
13
|
+
op: FhirPatchRequestBodyItemOp = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
The operation to perform
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
path: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
JSON Pointer to the target location
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
value: typing.Optional[typing.Optional[typing.Any]] = None
|
|
24
|
+
from_: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="from")] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Source location for move and copy operations (JSON Pointer)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
31
|
+
else:
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
from .fhir_resource_meta import FhirResourceMeta
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FhirResource(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
A generic FHIR resource. All FHIR resources share common elements like resourceType and id,
|
|
15
|
+
but the specific structure depends on the resource type.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
resource_type: typing_extensions.Annotated[str, FieldMetadata(alias="resourceType")] = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
The type of FHIR resource (e.g., Patient, Observation, etc.)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
24
|
+
"""
|
|
25
|
+
Logical ID of the resource
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
meta: typing.Optional[FhirResourceMeta] = pydantic.Field(default=None)
|
|
29
|
+
"""
|
|
30
|
+
Metadata about the resource
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
if IS_PYDANTIC_V2:
|
|
34
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
35
|
+
else:
|
|
36
|
+
|
|
37
|
+
class Config:
|
|
38
|
+
frozen = True
|
|
39
|
+
smart_union = True
|
|
40
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FhirResourceMeta(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Metadata about the resource
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
version_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="versionId")] = None
|
|
18
|
+
last_updated: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="lastUpdated")] = None
|
|
19
|
+
profile: typing.Optional[typing.List[str]] = None
|
|
20
|
+
|
|
21
|
+
if IS_PYDANTIC_V2:
|
|
22
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
23
|
+
else:
|
|
24
|
+
|
|
25
|
+
class Config:
|
|
26
|
+
frozen = True
|
|
27
|
+
smart_union = True
|
|
28
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .types import (
|
|
6
|
+
AuthMethod,
|
|
7
|
+
FhirProviderAuthConfig,
|
|
8
|
+
FhirProviderDeleteResponse,
|
|
9
|
+
FhirProviderListResponse,
|
|
10
|
+
FhirProviderRemoveAuthConfigResponse,
|
|
11
|
+
FhirProviderResponse,
|
|
12
|
+
FhirProviderSetActiveAuthConfigResponse,
|
|
13
|
+
FhirProviderTemplate,
|
|
14
|
+
FhirQueryResponse,
|
|
15
|
+
FhirQueryResponseData,
|
|
16
|
+
JsonWebKey,
|
|
17
|
+
Provider,
|
|
18
|
+
ServiceAccountKey,
|
|
19
|
+
SmartConfiguration,
|
|
20
|
+
)
|
|
21
|
+
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"AuthMethod",
|
|
25
|
+
"BadRequestError",
|
|
26
|
+
"FhirProviderAuthConfig",
|
|
27
|
+
"FhirProviderDeleteResponse",
|
|
28
|
+
"FhirProviderListResponse",
|
|
29
|
+
"FhirProviderRemoveAuthConfigResponse",
|
|
30
|
+
"FhirProviderResponse",
|
|
31
|
+
"FhirProviderSetActiveAuthConfigResponse",
|
|
32
|
+
"FhirProviderTemplate",
|
|
33
|
+
"FhirQueryResponse",
|
|
34
|
+
"FhirQueryResponseData",
|
|
35
|
+
"ForbiddenError",
|
|
36
|
+
"InternalServerError",
|
|
37
|
+
"JsonWebKey",
|
|
38
|
+
"NotFoundError",
|
|
39
|
+
"Provider",
|
|
40
|
+
"ServiceAccountKey",
|
|
41
|
+
"SmartConfiguration",
|
|
42
|
+
"UnauthorizedError",
|
|
43
|
+
]
|