phenoml 0.0.7__tar.gz
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.
- phenoml-0.0.7/LICENSE +21 -0
- phenoml-0.0.7/PKG-INFO +192 -0
- phenoml-0.0.7/README.md +165 -0
- phenoml-0.0.7/pyproject.toml +84 -0
- phenoml-0.0.7/src/phenoml/__init__.py +30 -0
- phenoml-0.0.7/src/phenoml/agent/__init__.py +56 -0
- phenoml-0.0.7/src/phenoml/agent/client.py +939 -0
- phenoml-0.0.7/src/phenoml/agent/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/agent/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/agent/errors/forbidden_error.py +10 -0
- phenoml-0.0.7/src/phenoml/agent/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/agent/errors/not_found_error.py +10 -0
- phenoml-0.0.7/src/phenoml/agent/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/__init__.py +7 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/client.py +707 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/raw_client.py +1345 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/types/__init__.py +8 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/types/prompts_delete_response.py +20 -0
- phenoml-0.0.7/src/phenoml/agent/prompts/types/prompts_list_response.py +22 -0
- phenoml-0.0.7/src/phenoml/agent/raw_client.py +1668 -0
- phenoml-0.0.7/src/phenoml/agent/types/__init__.py +43 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_chat_response.py +33 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_create_request.py +53 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_create_request_provider.py +5 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_delete_response.py +20 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_get_chat_messages_request_order.py +5 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_get_chat_messages_response.py +22 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_list_response.py +22 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_prompts_response.py +22 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_response.py +22 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_template.py +58 -0
- phenoml-0.0.7/src/phenoml/agent/types/agent_template_provider.py +5 -0
- phenoml-0.0.7/src/phenoml/agent/types/chat_message_template.py +72 -0
- phenoml-0.0.7/src/phenoml/agent/types/chat_session_template.py +67 -0
- phenoml-0.0.7/src/phenoml/agent/types/json_patch.py +7 -0
- phenoml-0.0.7/src/phenoml/agent/types/json_patch_operation.py +40 -0
- phenoml-0.0.7/src/phenoml/agent/types/json_patch_operation_op.py +5 -0
- phenoml-0.0.7/src/phenoml/agent/types/prompt_template.py +52 -0
- phenoml-0.0.7/src/phenoml/agent/types/success_response.py +20 -0
- phenoml-0.0.7/src/phenoml/authtoken/__init__.py +17 -0
- phenoml-0.0.7/src/phenoml/authtoken/auth/__init__.py +7 -0
- phenoml-0.0.7/src/phenoml/authtoken/auth/client.py +129 -0
- phenoml-0.0.7/src/phenoml/authtoken/auth/raw_client.py +173 -0
- phenoml-0.0.7/src/phenoml/authtoken/auth/types/__init__.py +7 -0
- phenoml-0.0.7/src/phenoml/authtoken/auth/types/auth_generate_token_response.py +22 -0
- phenoml-0.0.7/src/phenoml/authtoken/client.py +39 -0
- phenoml-0.0.7/src/phenoml/authtoken/errors/__init__.py +8 -0
- phenoml-0.0.7/src/phenoml/authtoken/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/authtoken/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/authtoken/raw_client.py +13 -0
- phenoml-0.0.7/src/phenoml/authtoken/types/__init__.py +8 -0
- phenoml-0.0.7/src/phenoml/authtoken/types/bad_request_error_body.py +21 -0
- phenoml-0.0.7/src/phenoml/authtoken/types/unauthorized_error_body.py +21 -0
- phenoml-0.0.7/src/phenoml/client.py +177 -0
- phenoml-0.0.7/src/phenoml/cohort/__init__.py +8 -0
- phenoml-0.0.7/src/phenoml/cohort/client.py +113 -0
- phenoml-0.0.7/src/phenoml/cohort/errors/__init__.py +9 -0
- phenoml-0.0.7/src/phenoml/cohort/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/cohort/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/cohort/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/cohort/raw_client.py +185 -0
- phenoml-0.0.7/src/phenoml/cohort/types/__init__.py +8 -0
- phenoml-0.0.7/src/phenoml/cohort/types/cohort_response.py +33 -0
- phenoml-0.0.7/src/phenoml/cohort/types/search_concept.py +37 -0
- phenoml-0.0.7/src/phenoml/construe/__init__.py +45 -0
- phenoml-0.0.7/src/phenoml/construe/client.py +399 -0
- phenoml-0.0.7/src/phenoml/construe/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/construe/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/construe/errors/conflict_error.py +10 -0
- phenoml-0.0.7/src/phenoml/construe/errors/failed_dependency_error.py +10 -0
- phenoml-0.0.7/src/phenoml/construe/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/construe/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/construe/raw_client.py +706 -0
- phenoml-0.0.7/src/phenoml/construe/types/__init__.py +41 -0
- phenoml-0.0.7/src/phenoml/construe/types/bad_request_error_body.py +27 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_cohort_request_config.py +37 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_cohort_response.py +33 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_cohort_response_queries_item.py +49 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item.py +31 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py +32 -0
- phenoml-0.0.7/src/phenoml/construe/types/construe_upload_code_system_response.py +19 -0
- phenoml-0.0.7/src/phenoml/construe/types/extract_codes_result.py +22 -0
- phenoml-0.0.7/src/phenoml/construe/types/extract_request_config.py +23 -0
- phenoml-0.0.7/src/phenoml/construe/types/extract_request_config_chunking_method.py +5 -0
- phenoml-0.0.7/src/phenoml/construe/types/extract_request_system.py +37 -0
- phenoml-0.0.7/src/phenoml/construe/types/extracted_code_result.py +41 -0
- phenoml-0.0.7/src/phenoml/construe/types/internal_server_error_body.py +27 -0
- phenoml-0.0.7/src/phenoml/construe/types/unauthorized_error_body.py +27 -0
- phenoml-0.0.7/src/phenoml/construe/types/upload_request_format.py +5 -0
- phenoml-0.0.7/src/phenoml/core/__init__.py +52 -0
- phenoml-0.0.7/src/phenoml/core/api_error.py +23 -0
- phenoml-0.0.7/src/phenoml/core/client_wrapper.py +87 -0
- phenoml-0.0.7/src/phenoml/core/datetime_utils.py +28 -0
- phenoml-0.0.7/src/phenoml/core/file.py +67 -0
- phenoml-0.0.7/src/phenoml/core/force_multipart.py +16 -0
- phenoml-0.0.7/src/phenoml/core/http_client.py +543 -0
- phenoml-0.0.7/src/phenoml/core/http_response.py +55 -0
- phenoml-0.0.7/src/phenoml/core/jsonable_encoder.py +100 -0
- phenoml-0.0.7/src/phenoml/core/pydantic_utilities.py +255 -0
- phenoml-0.0.7/src/phenoml/core/query_encoder.py +58 -0
- phenoml-0.0.7/src/phenoml/core/remove_none_from_dict.py +11 -0
- phenoml-0.0.7/src/phenoml/core/request_options.py +35 -0
- phenoml-0.0.7/src/phenoml/core/serialization.py +276 -0
- phenoml-0.0.7/src/phenoml/environment.py +7 -0
- phenoml-0.0.7/src/phenoml/fhir/__init__.py +36 -0
- phenoml-0.0.7/src/phenoml/fhir/client.py +970 -0
- phenoml-0.0.7/src/phenoml/fhir/errors/__init__.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir/errors/not_found_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir/raw_client.py +1385 -0
- phenoml-0.0.7/src/phenoml/fhir/types/__init__.py +29 -0
- phenoml-0.0.7/src/phenoml/fhir/types/error_response.py +36 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_bundle.py +43 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_bundle_entry_item_response.py +24 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_patch_request_body_item.py +40 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_resource.py +40 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_resource_meta.py +28 -0
- phenoml-0.0.7/src/phenoml/fhir/types/fhir_search_response.py +8 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/__init__.py +43 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/client.py +731 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/forbidden_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/not_found_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/raw_client.py +1445 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/__init__.py +35 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/auth_method.py +7 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_query_response.py +27 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/json_web_key.py +51 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/provider.py +8 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/service_account_key.py +35 -0
- phenoml-0.0.7/src/phenoml/fhir_provider/types/smart_configuration.py +46 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/__init__.py +27 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/client.py +430 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/failed_dependency_error.py +10 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/forbidden_error.py +10 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/raw_client.py +788 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/__init__.py +19 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/create_request_resource.py +25 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/document_request_file_type.py +7 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/document_request_resource.py +5 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/fhir_resource.py +5 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/lang2fhir_upload_profile_response.py +23 -0
- phenoml-0.0.7/src/phenoml/lang2fhir/types/search_response.py +33 -0
- phenoml-0.0.7/src/phenoml/py.typed +0 -0
- phenoml-0.0.7/src/phenoml/tools/__init__.py +37 -0
- phenoml-0.0.7/src/phenoml/tools/client.py +359 -0
- phenoml-0.0.7/src/phenoml/tools/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/tools/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/tools/errors/failed_dependency_error.py +10 -0
- phenoml-0.0.7/src/phenoml/tools/errors/forbidden_error.py +10 -0
- phenoml-0.0.7/src/phenoml/tools/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/tools/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/__init__.py +7 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/client.py +336 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/raw_client.py +641 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/tools/__init__.py +4 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/tools/client.py +358 -0
- phenoml-0.0.7/src/phenoml/tools/mcp_server/tools/raw_client.py +656 -0
- phenoml-0.0.7/src/phenoml/tools/raw_client.py +696 -0
- phenoml-0.0.7/src/phenoml/tools/types/__init__.py +27 -0
- phenoml-0.0.7/src/phenoml/tools/types/cohort_response.py +49 -0
- phenoml-0.0.7/src/phenoml/tools/types/lang2fhir_and_create_request_resource.py +25 -0
- phenoml-0.0.7/src/phenoml/tools/types/lang2fhir_and_create_response.py +33 -0
- phenoml-0.0.7/src/phenoml/tools/types/lang2fhir_and_search_response.py +40 -0
- phenoml-0.0.7/src/phenoml/tools/types/mcp_server_response.py +33 -0
- phenoml-0.0.7/src/phenoml/tools/types/mcp_server_response_data.py +51 -0
- phenoml-0.0.7/src/phenoml/tools/types/mcp_server_tool_call_response.py +37 -0
- phenoml-0.0.7/src/phenoml/tools/types/mcp_server_tool_response.py +33 -0
- phenoml-0.0.7/src/phenoml/tools/types/mcp_server_tool_response_data.py +61 -0
- phenoml-0.0.7/src/phenoml/tools/types/search_concept.py +41 -0
- phenoml-0.0.7/src/phenoml/version.py +3 -0
- phenoml-0.0.7/src/phenoml/workflows/__init__.py +61 -0
- phenoml-0.0.7/src/phenoml/workflows/client.py +694 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/__init__.py +11 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/bad_request_error.py +10 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/forbidden_error.py +10 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/internal_server_error.py +10 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/not_found_error.py +10 -0
- phenoml-0.0.7/src/phenoml/workflows/errors/unauthorized_error.py +10 -0
- phenoml-0.0.7/src/phenoml/workflows/raw_client.py +1266 -0
- phenoml-0.0.7/src/phenoml/workflows/types/__init__.py +53 -0
- phenoml-0.0.7/src/phenoml/workflows/types/create_workflow_request_fhir_provider_id.py +5 -0
- phenoml-0.0.7/src/phenoml/workflows/types/create_workflow_response.py +44 -0
- phenoml-0.0.7/src/phenoml/workflows/types/decision_node_definition.py +32 -0
- phenoml-0.0.7/src/phenoml/workflows/types/execute_workflow_response.py +30 -0
- phenoml-0.0.7/src/phenoml/workflows/types/execute_workflow_response_results.py +22 -0
- phenoml-0.0.7/src/phenoml/workflows/types/lang2fhir_create_definition.py +37 -0
- phenoml-0.0.7/src/phenoml/workflows/types/lang2fhir_search_definition.py +42 -0
- phenoml-0.0.7/src/phenoml/workflows/types/list_workflows_response.py +39 -0
- phenoml-0.0.7/src/phenoml/workflows/types/step_operation.py +26 -0
- phenoml-0.0.7/src/phenoml/workflows/types/sub_workflow_definition.py +32 -0
- phenoml-0.0.7/src/phenoml/workflows/types/update_workflow_request_fhir_provider_id.py +5 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_config.py +27 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_definition.py +57 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_graph.py +23 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_response.py +61 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_response_graph.py +23 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_step.py +55 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_step_summary.py +47 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_step_summary_type.py +5 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflow_step_type.py +5 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflows_delete_response.py +20 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflows_get_response.py +26 -0
- phenoml-0.0.7/src/phenoml/workflows/types/workflows_update_response.py +31 -0
- phenoml-0.0.7/src/phenoml/wrapper_client.py +123 -0
phenoml-0.0.7/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 PhenoML
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
phenoml-0.0.7/PKG-INFO
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: phenoml
|
|
3
|
+
Version: 0.0.7
|
|
4
|
+
Summary:
|
|
5
|
+
Requires-Python: >=3.8,<4.0
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: MacOS
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Operating System :: POSIX
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: httpx (>=0.21.2)
|
|
22
|
+
Requires-Dist: pydantic (>=1.9.2)
|
|
23
|
+
Requires-Dist: pydantic-core (>=2.18.2)
|
|
24
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Phenoml Python Library
|
|
28
|
+
|
|
29
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Ffern-demo%2Fphenoml-python-sdk)
|
|
30
|
+
[](https://pypi.python.org/pypi/phenoml)
|
|
31
|
+
|
|
32
|
+
The Phenoml Python library provides convenient access to the Phenoml API from Python.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pip install phenoml
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Reference
|
|
41
|
+
|
|
42
|
+
A full reference for this library is available [here](https://github.com/phenoml/phenoml-python-sdk/blob/HEAD/./reference.md).
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Instantiate and use the client with the following:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from phenoml import Client
|
|
50
|
+
|
|
51
|
+
client = Client(
|
|
52
|
+
username="your_username",
|
|
53
|
+
password="your_password",
|
|
54
|
+
base_url="https://your-phenoml-instance.com"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
client.agent.create(
|
|
58
|
+
name="name",
|
|
59
|
+
prompts=["prompt_123", "prompt_456"],
|
|
60
|
+
is_active=True,
|
|
61
|
+
)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Async Client
|
|
65
|
+
|
|
66
|
+
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import asyncio
|
|
70
|
+
|
|
71
|
+
from phenoml import AsyncClient
|
|
72
|
+
|
|
73
|
+
client = AsyncClient(
|
|
74
|
+
username="your_username",
|
|
75
|
+
password="your_password",
|
|
76
|
+
base_url="https://your-phenoml-instance.com"
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
async def main() -> None:
|
|
81
|
+
await client.initialize() # Generate token from username/password
|
|
82
|
+
await client.agent.create(
|
|
83
|
+
name="name",
|
|
84
|
+
prompts=["prompt_123", "prompt_456"],
|
|
85
|
+
is_active=True,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
asyncio.run(main())
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Exception Handling
|
|
93
|
+
|
|
94
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
95
|
+
will be thrown.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from phenoml.core.api_error import ApiError
|
|
99
|
+
|
|
100
|
+
try:
|
|
101
|
+
client.agent.create(...)
|
|
102
|
+
except ApiError as e:
|
|
103
|
+
print(e.status_code)
|
|
104
|
+
print(e.body)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Advanced
|
|
108
|
+
|
|
109
|
+
### Access Raw Response Data
|
|
110
|
+
|
|
111
|
+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
|
|
112
|
+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from phenoml import phenoml
|
|
116
|
+
|
|
117
|
+
client = phenoml(
|
|
118
|
+
...,
|
|
119
|
+
)
|
|
120
|
+
response = client.agent.with_raw_response.create(...)
|
|
121
|
+
print(response.headers) # access the response headers
|
|
122
|
+
print(response.data) # access the underlying object
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Retries
|
|
126
|
+
|
|
127
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
128
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
129
|
+
retry limit (default: 2).
|
|
130
|
+
|
|
131
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
132
|
+
|
|
133
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
134
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
135
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
136
|
+
|
|
137
|
+
Use the `max_retries` request option to configure this behavior.
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
client.agent.create(..., request_options={
|
|
141
|
+
"max_retries": 1
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Timeouts
|
|
146
|
+
|
|
147
|
+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
|
|
151
|
+
from phenoml import phenoml
|
|
152
|
+
|
|
153
|
+
client = phenoml(
|
|
154
|
+
...,
|
|
155
|
+
timeout=20.0,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
# Override timeout for a specific method
|
|
160
|
+
client.agent.create(..., request_options={
|
|
161
|
+
"timeout_in_seconds": 1
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Custom Client
|
|
166
|
+
|
|
167
|
+
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
|
|
168
|
+
and transports.
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
import httpx
|
|
172
|
+
from phenoml import phenoml
|
|
173
|
+
|
|
174
|
+
client = phenoml(
|
|
175
|
+
...,
|
|
176
|
+
httpx_client=httpx.Client(
|
|
177
|
+
proxies="http://my.test.proxy.example.com",
|
|
178
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
|
179
|
+
),
|
|
180
|
+
)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Contributing
|
|
184
|
+
|
|
185
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
186
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
187
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
188
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
189
|
+
an issue first to discuss with us!
|
|
190
|
+
|
|
191
|
+
On the other hand, contributions to the README are always very welcome!
|
|
192
|
+
|
phenoml-0.0.7/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Phenoml Python Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Ffern-demo%2Fphenoml-python-sdk)
|
|
4
|
+
[](https://pypi.python.org/pypi/phenoml)
|
|
5
|
+
|
|
6
|
+
The Phenoml Python library provides convenient access to the Phenoml API from Python.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pip install phenoml
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Reference
|
|
15
|
+
|
|
16
|
+
A full reference for this library is available [here](https://github.com/phenoml/phenoml-python-sdk/blob/HEAD/./reference.md).
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Instantiate and use the client with the following:
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from phenoml import Client
|
|
24
|
+
|
|
25
|
+
client = Client(
|
|
26
|
+
username="your_username",
|
|
27
|
+
password="your_password",
|
|
28
|
+
base_url="https://your-phenoml-instance.com"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
client.agent.create(
|
|
32
|
+
name="name",
|
|
33
|
+
prompts=["prompt_123", "prompt_456"],
|
|
34
|
+
is_active=True,
|
|
35
|
+
)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Async Client
|
|
39
|
+
|
|
40
|
+
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import asyncio
|
|
44
|
+
|
|
45
|
+
from phenoml import AsyncClient
|
|
46
|
+
|
|
47
|
+
client = AsyncClient(
|
|
48
|
+
username="your_username",
|
|
49
|
+
password="your_password",
|
|
50
|
+
base_url="https://your-phenoml-instance.com"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
async def main() -> None:
|
|
55
|
+
await client.initialize() # Generate token from username/password
|
|
56
|
+
await client.agent.create(
|
|
57
|
+
name="name",
|
|
58
|
+
prompts=["prompt_123", "prompt_456"],
|
|
59
|
+
is_active=True,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
asyncio.run(main())
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Exception Handling
|
|
67
|
+
|
|
68
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
69
|
+
will be thrown.
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from phenoml.core.api_error import ApiError
|
|
73
|
+
|
|
74
|
+
try:
|
|
75
|
+
client.agent.create(...)
|
|
76
|
+
except ApiError as e:
|
|
77
|
+
print(e.status_code)
|
|
78
|
+
print(e.body)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Advanced
|
|
82
|
+
|
|
83
|
+
### Access Raw Response Data
|
|
84
|
+
|
|
85
|
+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
|
|
86
|
+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from phenoml import phenoml
|
|
90
|
+
|
|
91
|
+
client = phenoml(
|
|
92
|
+
...,
|
|
93
|
+
)
|
|
94
|
+
response = client.agent.with_raw_response.create(...)
|
|
95
|
+
print(response.headers) # access the response headers
|
|
96
|
+
print(response.data) # access the underlying object
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Retries
|
|
100
|
+
|
|
101
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
102
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
103
|
+
retry limit (default: 2).
|
|
104
|
+
|
|
105
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
106
|
+
|
|
107
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
108
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
109
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
110
|
+
|
|
111
|
+
Use the `max_retries` request option to configure this behavior.
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
client.agent.create(..., request_options={
|
|
115
|
+
"max_retries": 1
|
|
116
|
+
})
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Timeouts
|
|
120
|
+
|
|
121
|
+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
|
|
125
|
+
from phenoml import phenoml
|
|
126
|
+
|
|
127
|
+
client = phenoml(
|
|
128
|
+
...,
|
|
129
|
+
timeout=20.0,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# Override timeout for a specific method
|
|
134
|
+
client.agent.create(..., request_options={
|
|
135
|
+
"timeout_in_seconds": 1
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Custom Client
|
|
140
|
+
|
|
141
|
+
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
|
|
142
|
+
and transports.
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
import httpx
|
|
146
|
+
from phenoml import phenoml
|
|
147
|
+
|
|
148
|
+
client = phenoml(
|
|
149
|
+
...,
|
|
150
|
+
httpx_client=httpx.Client(
|
|
151
|
+
proxies="http://my.test.proxy.example.com",
|
|
152
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
160
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
161
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
162
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
163
|
+
an issue first to discuss with us!
|
|
164
|
+
|
|
165
|
+
On the other hand, contributions to the README are always very welcome!
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "phenoml"
|
|
3
|
+
|
|
4
|
+
[tool.poetry]
|
|
5
|
+
name = "phenoml"
|
|
6
|
+
version = "0.0.7"
|
|
7
|
+
description = ""
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
authors = []
|
|
10
|
+
keywords = []
|
|
11
|
+
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Programming Language :: Python",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.8",
|
|
17
|
+
"Programming Language :: Python :: 3.9",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Operating System :: POSIX",
|
|
23
|
+
"Operating System :: MacOS",
|
|
24
|
+
"Operating System :: POSIX :: Linux",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
+
"Typing :: Typed"
|
|
28
|
+
]
|
|
29
|
+
packages = [
|
|
30
|
+
{ include = "phenoml", from = "src"}
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Repository = 'https://github.com/phenoml/phenoml-python-sdk'
|
|
35
|
+
|
|
36
|
+
[tool.poetry.dependencies]
|
|
37
|
+
python = "^3.8"
|
|
38
|
+
httpx = ">=0.21.2"
|
|
39
|
+
pydantic = ">= 1.9.2"
|
|
40
|
+
pydantic-core = ">=2.18.2"
|
|
41
|
+
typing_extensions = ">= 4.0.0"
|
|
42
|
+
|
|
43
|
+
[tool.poetry.group.dev.dependencies]
|
|
44
|
+
mypy = "==1.13.0"
|
|
45
|
+
pytest = "^7.4.0"
|
|
46
|
+
pytest-asyncio = "^0.23.5"
|
|
47
|
+
python-dateutil = "^2.9.0"
|
|
48
|
+
types-python-dateutil = "^2.9.0.20240316"
|
|
49
|
+
ruff = "==0.11.5"
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
testpaths = [ "tests" ]
|
|
53
|
+
asyncio_mode = "auto"
|
|
54
|
+
|
|
55
|
+
[tool.mypy]
|
|
56
|
+
plugins = ["pydantic.mypy"]
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
line-length = 120
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint]
|
|
62
|
+
select = [
|
|
63
|
+
"E", # pycodestyle errors
|
|
64
|
+
"F", # pyflakes
|
|
65
|
+
"I", # isort
|
|
66
|
+
]
|
|
67
|
+
ignore = [
|
|
68
|
+
"E402", # Module level import not at top of file
|
|
69
|
+
"E501", # Line too long
|
|
70
|
+
"E711", # Comparison to `None` should be `cond is not None`
|
|
71
|
+
"E712", # Avoid equality comparisons to `True`; use `if ...:` checks
|
|
72
|
+
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
|
|
73
|
+
"E722", # Do not use bare `except`
|
|
74
|
+
"E731", # Do not assign a `lambda` expression, use a `def`
|
|
75
|
+
"F821", # Undefined name
|
|
76
|
+
"F841" # Local variable ... is assigned to but never used
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[tool.ruff.lint.isort]
|
|
80
|
+
section-order = ["future", "standard-library", "third-party", "first-party"]
|
|
81
|
+
|
|
82
|
+
[build-system]
|
|
83
|
+
requires = ["poetry-core"]
|
|
84
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from . import agent, authtoken, cohort, construe, lang2fhir, tools
|
|
6
|
+
from .client import Asyncphenoml, phenoml
|
|
7
|
+
from .environment import phenomlEnvironment
|
|
8
|
+
from .version import __version__
|
|
9
|
+
from .wrapper_client import PhenoMLClient, AsyncPhenoMLClient
|
|
10
|
+
|
|
11
|
+
# Primary client classes (recommended)
|
|
12
|
+
Client = PhenoMLClient
|
|
13
|
+
AsyncClient = AsyncPhenoMLClient
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"Asyncphenoml",
|
|
17
|
+
"AsyncPhenoMLClient",
|
|
18
|
+
"AsyncClient", # Primary async client
|
|
19
|
+
"PhenoMLClient",
|
|
20
|
+
"Client", # Primary sync client
|
|
21
|
+
"__version__",
|
|
22
|
+
"agent",
|
|
23
|
+
"authtoken",
|
|
24
|
+
"cohort",
|
|
25
|
+
"construe",
|
|
26
|
+
"lang2fhir",
|
|
27
|
+
"phenoml", # Base client (for advanced users)
|
|
28
|
+
"phenomlEnvironment",
|
|
29
|
+
"tools",
|
|
30
|
+
]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .types import (
|
|
6
|
+
AgentChatResponse,
|
|
7
|
+
AgentCreateRequest,
|
|
8
|
+
AgentCreateRequestProvider,
|
|
9
|
+
AgentDeleteResponse,
|
|
10
|
+
AgentGetChatMessagesRequestOrder,
|
|
11
|
+
AgentGetChatMessagesResponse,
|
|
12
|
+
AgentListResponse,
|
|
13
|
+
AgentPromptsResponse,
|
|
14
|
+
AgentResponse,
|
|
15
|
+
AgentTemplate,
|
|
16
|
+
AgentTemplateProvider,
|
|
17
|
+
ChatMessageTemplate,
|
|
18
|
+
ChatSessionTemplate,
|
|
19
|
+
JsonPatch,
|
|
20
|
+
JsonPatchOperation,
|
|
21
|
+
JsonPatchOperationOp,
|
|
22
|
+
PromptTemplate,
|
|
23
|
+
SuccessResponse,
|
|
24
|
+
)
|
|
25
|
+
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError
|
|
26
|
+
from . import prompts
|
|
27
|
+
from .prompts import PromptsDeleteResponse, PromptsListResponse
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"AgentChatResponse",
|
|
31
|
+
"AgentCreateRequest",
|
|
32
|
+
"AgentCreateRequestProvider",
|
|
33
|
+
"AgentDeleteResponse",
|
|
34
|
+
"AgentGetChatMessagesRequestOrder",
|
|
35
|
+
"AgentGetChatMessagesResponse",
|
|
36
|
+
"AgentListResponse",
|
|
37
|
+
"AgentPromptsResponse",
|
|
38
|
+
"AgentResponse",
|
|
39
|
+
"AgentTemplate",
|
|
40
|
+
"AgentTemplateProvider",
|
|
41
|
+
"BadRequestError",
|
|
42
|
+
"ChatMessageTemplate",
|
|
43
|
+
"ChatSessionTemplate",
|
|
44
|
+
"ForbiddenError",
|
|
45
|
+
"InternalServerError",
|
|
46
|
+
"JsonPatch",
|
|
47
|
+
"JsonPatchOperation",
|
|
48
|
+
"JsonPatchOperationOp",
|
|
49
|
+
"NotFoundError",
|
|
50
|
+
"PromptTemplate",
|
|
51
|
+
"PromptsDeleteResponse",
|
|
52
|
+
"PromptsListResponse",
|
|
53
|
+
"SuccessResponse",
|
|
54
|
+
"UnauthorizedError",
|
|
55
|
+
"prompts",
|
|
56
|
+
]
|