phenoml 0.0.6__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.
- phenoml/__init__.py +30 -0
- phenoml/agent/__init__.py +56 -0
- phenoml/agent/client.py +939 -0
- phenoml/agent/errors/__init__.py +11 -0
- phenoml/agent/errors/bad_request_error.py +10 -0
- phenoml/agent/errors/forbidden_error.py +10 -0
- phenoml/agent/errors/internal_server_error.py +10 -0
- phenoml/agent/errors/not_found_error.py +10 -0
- phenoml/agent/errors/unauthorized_error.py +10 -0
- phenoml/agent/prompts/__init__.py +7 -0
- phenoml/agent/prompts/client.py +707 -0
- phenoml/agent/prompts/raw_client.py +1345 -0
- phenoml/agent/prompts/types/__init__.py +8 -0
- phenoml/agent/prompts/types/prompts_delete_response.py +20 -0
- phenoml/agent/prompts/types/prompts_list_response.py +22 -0
- phenoml/agent/raw_client.py +1668 -0
- phenoml/agent/types/__init__.py +43 -0
- phenoml/agent/types/agent_chat_response.py +33 -0
- phenoml/agent/types/agent_create_request.py +53 -0
- phenoml/agent/types/agent_create_request_provider.py +5 -0
- phenoml/agent/types/agent_delete_response.py +20 -0
- 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_list_response.py +22 -0
- phenoml/agent/types/agent_prompts_response.py +22 -0
- phenoml/agent/types/agent_response.py +22 -0
- phenoml/agent/types/agent_template.py +58 -0
- phenoml/agent/types/agent_template_provider.py +5 -0
- phenoml/agent/types/chat_message_template.py +72 -0
- phenoml/agent/types/chat_session_template.py +67 -0
- phenoml/agent/types/json_patch.py +7 -0
- phenoml/agent/types/json_patch_operation.py +40 -0
- phenoml/agent/types/json_patch_operation_op.py +5 -0
- phenoml/agent/types/prompt_template.py +52 -0
- phenoml/agent/types/success_response.py +20 -0
- phenoml/authtoken/__init__.py +17 -0
- phenoml/authtoken/auth/__init__.py +7 -0
- phenoml/authtoken/auth/client.py +129 -0
- phenoml/authtoken/auth/raw_client.py +173 -0
- phenoml/authtoken/auth/types/__init__.py +7 -0
- phenoml/authtoken/auth/types/auth_generate_token_response.py +22 -0
- phenoml/authtoken/client.py +39 -0
- phenoml/authtoken/errors/__init__.py +8 -0
- phenoml/authtoken/errors/bad_request_error.py +10 -0
- phenoml/authtoken/errors/unauthorized_error.py +10 -0
- phenoml/authtoken/raw_client.py +13 -0
- phenoml/authtoken/types/__init__.py +8 -0
- phenoml/authtoken/types/bad_request_error_body.py +21 -0
- phenoml/authtoken/types/unauthorized_error_body.py +21 -0
- phenoml/client.py +177 -0
- phenoml/cohort/__init__.py +8 -0
- phenoml/cohort/client.py +113 -0
- phenoml/cohort/errors/__init__.py +9 -0
- phenoml/cohort/errors/bad_request_error.py +10 -0
- phenoml/cohort/errors/internal_server_error.py +10 -0
- phenoml/cohort/errors/unauthorized_error.py +10 -0
- phenoml/cohort/raw_client.py +185 -0
- phenoml/cohort/types/__init__.py +8 -0
- phenoml/cohort/types/cohort_response.py +33 -0
- phenoml/cohort/types/search_concept.py +37 -0
- phenoml/construe/__init__.py +45 -0
- phenoml/construe/client.py +399 -0
- phenoml/construe/errors/__init__.py +11 -0
- phenoml/construe/errors/bad_request_error.py +10 -0
- phenoml/construe/errors/conflict_error.py +10 -0
- phenoml/construe/errors/failed_dependency_error.py +10 -0
- phenoml/construe/errors/internal_server_error.py +10 -0
- phenoml/construe/errors/unauthorized_error.py +10 -0
- phenoml/construe/raw_client.py +706 -0
- phenoml/construe/types/__init__.py +41 -0
- phenoml/construe/types/bad_request_error_body.py +27 -0
- phenoml/construe/types/construe_cohort_request_config.py +37 -0
- phenoml/construe/types/construe_cohort_response.py +33 -0
- phenoml/construe/types/construe_cohort_response_queries_item.py +49 -0
- phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item.py +31 -0
- phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py +32 -0
- phenoml/construe/types/construe_upload_code_system_response.py +19 -0
- phenoml/construe/types/extract_codes_result.py +22 -0
- phenoml/construe/types/extract_request_config.py +23 -0
- phenoml/construe/types/extract_request_config_chunking_method.py +5 -0
- phenoml/construe/types/extract_request_system.py +37 -0
- phenoml/construe/types/extracted_code_result.py +41 -0
- phenoml/construe/types/internal_server_error_body.py +27 -0
- phenoml/construe/types/unauthorized_error_body.py +27 -0
- phenoml/construe/types/upload_request_format.py +5 -0
- phenoml/core/__init__.py +52 -0
- phenoml/core/api_error.py +23 -0
- phenoml/core/client_wrapper.py +87 -0
- phenoml/core/datetime_utils.py +28 -0
- phenoml/core/file.py +67 -0
- phenoml/core/force_multipart.py +16 -0
- phenoml/core/http_client.py +543 -0
- phenoml/core/http_response.py +55 -0
- phenoml/core/jsonable_encoder.py +100 -0
- phenoml/core/pydantic_utilities.py +255 -0
- phenoml/core/query_encoder.py +58 -0
- phenoml/core/remove_none_from_dict.py +11 -0
- phenoml/core/request_options.py +35 -0
- phenoml/core/serialization.py +276 -0
- phenoml/environment.py +7 -0
- 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/fhir/types/error_response.py +36 -0
- 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 +40 -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/lang2fhir/__init__.py +27 -0
- phenoml/lang2fhir/client.py +430 -0
- phenoml/lang2fhir/errors/__init__.py +11 -0
- phenoml/lang2fhir/errors/bad_request_error.py +10 -0
- phenoml/lang2fhir/errors/failed_dependency_error.py +10 -0
- phenoml/lang2fhir/errors/forbidden_error.py +10 -0
- phenoml/lang2fhir/errors/internal_server_error.py +10 -0
- phenoml/lang2fhir/errors/unauthorized_error.py +10 -0
- phenoml/lang2fhir/raw_client.py +788 -0
- phenoml/lang2fhir/types/__init__.py +19 -0
- phenoml/lang2fhir/types/create_request_resource.py +25 -0
- phenoml/lang2fhir/types/document_request_file_type.py +7 -0
- phenoml/lang2fhir/types/document_request_resource.py +5 -0
- phenoml/lang2fhir/types/fhir_resource.py +5 -0
- phenoml/lang2fhir/types/lang2fhir_upload_profile_response.py +23 -0
- phenoml/lang2fhir/types/search_response.py +33 -0
- phenoml/py.typed +0 -0
- phenoml/tools/__init__.py +37 -0
- phenoml/tools/client.py +359 -0
- phenoml/tools/errors/__init__.py +11 -0
- phenoml/tools/errors/bad_request_error.py +10 -0
- phenoml/tools/errors/failed_dependency_error.py +10 -0
- phenoml/tools/errors/forbidden_error.py +10 -0
- phenoml/tools/errors/internal_server_error.py +10 -0
- phenoml/tools/errors/unauthorized_error.py +10 -0
- 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 +696 -0
- phenoml/tools/types/__init__.py +27 -0
- phenoml/tools/types/cohort_response.py +49 -0
- phenoml/tools/types/lang2fhir_and_create_request_resource.py +25 -0
- phenoml/tools/types/lang2fhir_and_create_response.py +33 -0
- phenoml/tools/types/lang2fhir_and_search_response.py +40 -0
- phenoml/tools/types/mcp_server_response.py +33 -0
- phenoml/tools/types/mcp_server_response_data.py +51 -0
- phenoml/tools/types/mcp_server_tool_call_response.py +37 -0
- phenoml/tools/types/mcp_server_tool_response.py +33 -0
- phenoml/tools/types/mcp_server_tool_response_data.py +61 -0
- phenoml/tools/types/search_concept.py +41 -0
- phenoml/types/__init__.py +21 -0
- phenoml/types/cohort_response.py +5 -0
- phenoml/types/lang2fhir_and_create_response.py +5 -0
- phenoml/types/lang2fhir_and_search_response.py +5 -0
- phenoml/types/mcp_server_response.py +5 -0
- phenoml/types/mcp_server_tool_call_response.py +5 -0
- phenoml/types/mcp_server_tool_response.py +5 -0
- phenoml/types/search_concept.py +5 -0
- phenoml/version.py +3 -0
- phenoml/workflows/__init__.py +66 -0
- phenoml/workflows/client.py +210 -0
- phenoml/workflows/errors/__init__.py +11 -0
- phenoml/workflows/errors/bad_request_error.py +10 -0
- phenoml/workflows/errors/forbidden_error.py +10 -0
- phenoml/workflows/errors/internal_server_error.py +10 -0
- phenoml/workflows/errors/not_found_error.py +10 -0
- phenoml/workflows/errors/unauthorized_error.py +10 -0
- phenoml/workflows/mcp_server/__init__.py +7 -0
- phenoml/workflows/mcp_server/client.py +274 -0
- phenoml/workflows/mcp_server/raw_client.py +226 -0
- phenoml/workflows/mcp_server/tools/__init__.py +4 -0
- phenoml/workflows/mcp_server/tools/client.py +287 -0
- phenoml/workflows/mcp_server/tools/raw_client.py +244 -0
- phenoml/workflows/raw_client.py +169 -0
- phenoml/workflows/types/__init__.py +43 -0
- phenoml/workflows/types/create_workflow_response.py +44 -0
- phenoml/workflows/types/decision_node_definition.py +32 -0
- phenoml/workflows/types/execute_workflow_response.py +30 -0
- phenoml/workflows/types/execute_workflow_response_results.py +22 -0
- phenoml/workflows/types/lang2fhir_create_definition.py +37 -0
- phenoml/workflows/types/lang2fhir_search_definition.py +42 -0
- phenoml/workflows/types/list_workflows_response.py +39 -0
- phenoml/workflows/types/step_operation.py +26 -0
- phenoml/workflows/types/sub_workflow_definition.py +32 -0
- phenoml/workflows/types/workflow_config.py +27 -0
- phenoml/workflows/types/workflow_definition.py +57 -0
- phenoml/workflows/types/workflow_graph.py +23 -0
- phenoml/workflows/types/workflow_response.py +61 -0
- phenoml/workflows/types/workflow_response_graph.py +23 -0
- phenoml/workflows/types/workflow_step.py +55 -0
- phenoml/workflows/types/workflow_step_summary.py +47 -0
- phenoml/workflows/types/workflow_step_summary_type.py +5 -0
- phenoml/workflows/types/workflow_step_type.py +5 -0
- phenoml/workflows/workflows/__init__.py +19 -0
- phenoml/workflows/workflows/client.py +694 -0
- phenoml/workflows/workflows/raw_client.py +1266 -0
- phenoml/workflows/workflows/types/__init__.py +17 -0
- phenoml/workflows/workflows/types/create_workflow_request_fhir_provider_id.py +5 -0
- phenoml/workflows/workflows/types/update_workflow_request_fhir_provider_id.py +5 -0
- phenoml/workflows/workflows/types/workflows_delete_response.py +20 -0
- phenoml/workflows/workflows/types/workflows_get_response.py +26 -0
- phenoml/workflows/workflows/types/workflows_update_response.py +31 -0
- phenoml/wrapper_client.py +123 -0
- phenoml-0.0.6.dist-info/LICENSE +21 -0
- phenoml-0.0.6.dist-info/METADATA +192 -0
- phenoml-0.0.6.dist-info/RECORD +244 -0
- phenoml-0.0.6.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ...core.request_options import RequestOptions
|
|
7
|
+
from ..types.agent_prompts_response import AgentPromptsResponse
|
|
8
|
+
from ..types.json_patch import JsonPatch
|
|
9
|
+
from ..types.success_response import SuccessResponse
|
|
10
|
+
from .raw_client import AsyncRawPromptsClient, RawPromptsClient
|
|
11
|
+
from .types.prompts_delete_response import PromptsDeleteResponse
|
|
12
|
+
from .types.prompts_list_response import PromptsListResponse
|
|
13
|
+
|
|
14
|
+
# this is used as the default value for optional parameters
|
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PromptsClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._raw_client = RawPromptsClient(client_wrapper=client_wrapper)
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def with_raw_response(self) -> RawPromptsClient:
|
|
24
|
+
"""
|
|
25
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
RawPromptsClient
|
|
30
|
+
"""
|
|
31
|
+
return self._raw_client
|
|
32
|
+
|
|
33
|
+
def create(
|
|
34
|
+
self,
|
|
35
|
+
*,
|
|
36
|
+
name: str,
|
|
37
|
+
content: str,
|
|
38
|
+
is_active: bool,
|
|
39
|
+
description: typing.Optional[str] = OMIT,
|
|
40
|
+
is_default: typing.Optional[bool] = OMIT,
|
|
41
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
42
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
43
|
+
) -> AgentPromptsResponse:
|
|
44
|
+
"""
|
|
45
|
+
Creates a new agent prompt
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
name : str
|
|
50
|
+
Prompt name
|
|
51
|
+
|
|
52
|
+
content : str
|
|
53
|
+
Prompt content
|
|
54
|
+
|
|
55
|
+
is_active : bool
|
|
56
|
+
Whether the prompt is active
|
|
57
|
+
|
|
58
|
+
description : typing.Optional[str]
|
|
59
|
+
Prompt description
|
|
60
|
+
|
|
61
|
+
is_default : typing.Optional[bool]
|
|
62
|
+
Whether this is a default prompt
|
|
63
|
+
|
|
64
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
65
|
+
Tags for categorizing the prompt
|
|
66
|
+
|
|
67
|
+
request_options : typing.Optional[RequestOptions]
|
|
68
|
+
Request-specific configuration.
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
-------
|
|
72
|
+
AgentPromptsResponse
|
|
73
|
+
Prompt created successfully
|
|
74
|
+
|
|
75
|
+
Examples
|
|
76
|
+
--------
|
|
77
|
+
from phenoml import phenoml
|
|
78
|
+
|
|
79
|
+
client = phenoml(
|
|
80
|
+
token="YOUR_TOKEN",
|
|
81
|
+
)
|
|
82
|
+
client.agent.prompts.create(
|
|
83
|
+
name="Medical Assistant System Prompt",
|
|
84
|
+
content="You are a helpful medical assistant specialized in FHIR data processing...",
|
|
85
|
+
is_active=True,
|
|
86
|
+
)
|
|
87
|
+
"""
|
|
88
|
+
_response = self._raw_client.create(
|
|
89
|
+
name=name,
|
|
90
|
+
content=content,
|
|
91
|
+
is_active=is_active,
|
|
92
|
+
description=description,
|
|
93
|
+
is_default=is_default,
|
|
94
|
+
tags=tags,
|
|
95
|
+
request_options=request_options,
|
|
96
|
+
)
|
|
97
|
+
return _response.data
|
|
98
|
+
|
|
99
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> PromptsListResponse:
|
|
100
|
+
"""
|
|
101
|
+
Retrieves a list of agent prompts belonging to the authenticated user
|
|
102
|
+
|
|
103
|
+
Parameters
|
|
104
|
+
----------
|
|
105
|
+
request_options : typing.Optional[RequestOptions]
|
|
106
|
+
Request-specific configuration.
|
|
107
|
+
|
|
108
|
+
Returns
|
|
109
|
+
-------
|
|
110
|
+
PromptsListResponse
|
|
111
|
+
Prompts retrieved successfully
|
|
112
|
+
|
|
113
|
+
Examples
|
|
114
|
+
--------
|
|
115
|
+
from phenoml import phenoml
|
|
116
|
+
|
|
117
|
+
client = phenoml(
|
|
118
|
+
token="YOUR_TOKEN",
|
|
119
|
+
)
|
|
120
|
+
client.agent.prompts.list()
|
|
121
|
+
"""
|
|
122
|
+
_response = self._raw_client.list(request_options=request_options)
|
|
123
|
+
return _response.data
|
|
124
|
+
|
|
125
|
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentPromptsResponse:
|
|
126
|
+
"""
|
|
127
|
+
Retrieves a specific prompt by its ID
|
|
128
|
+
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
id : str
|
|
132
|
+
Prompt ID
|
|
133
|
+
|
|
134
|
+
request_options : typing.Optional[RequestOptions]
|
|
135
|
+
Request-specific configuration.
|
|
136
|
+
|
|
137
|
+
Returns
|
|
138
|
+
-------
|
|
139
|
+
AgentPromptsResponse
|
|
140
|
+
Prompt retrieved successfully
|
|
141
|
+
|
|
142
|
+
Examples
|
|
143
|
+
--------
|
|
144
|
+
from phenoml import phenoml
|
|
145
|
+
|
|
146
|
+
client = phenoml(
|
|
147
|
+
token="YOUR_TOKEN",
|
|
148
|
+
)
|
|
149
|
+
client.agent.prompts.get(
|
|
150
|
+
id="id",
|
|
151
|
+
)
|
|
152
|
+
"""
|
|
153
|
+
_response = self._raw_client.get(id, request_options=request_options)
|
|
154
|
+
return _response.data
|
|
155
|
+
|
|
156
|
+
def update(
|
|
157
|
+
self,
|
|
158
|
+
id: str,
|
|
159
|
+
*,
|
|
160
|
+
name: typing.Optional[str] = OMIT,
|
|
161
|
+
description: typing.Optional[str] = OMIT,
|
|
162
|
+
content: typing.Optional[str] = OMIT,
|
|
163
|
+
is_default: typing.Optional[bool] = OMIT,
|
|
164
|
+
is_active: typing.Optional[bool] = OMIT,
|
|
165
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
166
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
167
|
+
) -> AgentPromptsResponse:
|
|
168
|
+
"""
|
|
169
|
+
Updates an existing prompt
|
|
170
|
+
|
|
171
|
+
Parameters
|
|
172
|
+
----------
|
|
173
|
+
id : str
|
|
174
|
+
Prompt ID
|
|
175
|
+
|
|
176
|
+
name : typing.Optional[str]
|
|
177
|
+
Prompt name
|
|
178
|
+
|
|
179
|
+
description : typing.Optional[str]
|
|
180
|
+
Prompt description
|
|
181
|
+
|
|
182
|
+
content : typing.Optional[str]
|
|
183
|
+
Prompt content
|
|
184
|
+
|
|
185
|
+
is_default : typing.Optional[bool]
|
|
186
|
+
Whether this is a default prompt
|
|
187
|
+
|
|
188
|
+
is_active : typing.Optional[bool]
|
|
189
|
+
Whether the prompt is active
|
|
190
|
+
|
|
191
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
192
|
+
Tags for categorizing the prompt
|
|
193
|
+
|
|
194
|
+
request_options : typing.Optional[RequestOptions]
|
|
195
|
+
Request-specific configuration.
|
|
196
|
+
|
|
197
|
+
Returns
|
|
198
|
+
-------
|
|
199
|
+
AgentPromptsResponse
|
|
200
|
+
Prompt updated successfully
|
|
201
|
+
|
|
202
|
+
Examples
|
|
203
|
+
--------
|
|
204
|
+
from phenoml import phenoml
|
|
205
|
+
|
|
206
|
+
client = phenoml(
|
|
207
|
+
token="YOUR_TOKEN",
|
|
208
|
+
)
|
|
209
|
+
client.agent.prompts.update(
|
|
210
|
+
id="id",
|
|
211
|
+
)
|
|
212
|
+
"""
|
|
213
|
+
_response = self._raw_client.update(
|
|
214
|
+
id,
|
|
215
|
+
name=name,
|
|
216
|
+
description=description,
|
|
217
|
+
content=content,
|
|
218
|
+
is_default=is_default,
|
|
219
|
+
is_active=is_active,
|
|
220
|
+
tags=tags,
|
|
221
|
+
request_options=request_options,
|
|
222
|
+
)
|
|
223
|
+
return _response.data
|
|
224
|
+
|
|
225
|
+
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PromptsDeleteResponse:
|
|
226
|
+
"""
|
|
227
|
+
Soft deletes a prompt by setting is_active to false
|
|
228
|
+
|
|
229
|
+
Parameters
|
|
230
|
+
----------
|
|
231
|
+
id : str
|
|
232
|
+
Prompt ID
|
|
233
|
+
|
|
234
|
+
request_options : typing.Optional[RequestOptions]
|
|
235
|
+
Request-specific configuration.
|
|
236
|
+
|
|
237
|
+
Returns
|
|
238
|
+
-------
|
|
239
|
+
PromptsDeleteResponse
|
|
240
|
+
Prompt deleted successfully
|
|
241
|
+
|
|
242
|
+
Examples
|
|
243
|
+
--------
|
|
244
|
+
from phenoml import phenoml
|
|
245
|
+
|
|
246
|
+
client = phenoml(
|
|
247
|
+
token="YOUR_TOKEN",
|
|
248
|
+
)
|
|
249
|
+
client.agent.prompts.delete(
|
|
250
|
+
id="id",
|
|
251
|
+
)
|
|
252
|
+
"""
|
|
253
|
+
_response = self._raw_client.delete(id, request_options=request_options)
|
|
254
|
+
return _response.data
|
|
255
|
+
|
|
256
|
+
def patch(
|
|
257
|
+
self, id: str, *, request: JsonPatch, request_options: typing.Optional[RequestOptions] = None
|
|
258
|
+
) -> AgentPromptsResponse:
|
|
259
|
+
"""
|
|
260
|
+
Patches an existing prompt
|
|
261
|
+
|
|
262
|
+
Parameters
|
|
263
|
+
----------
|
|
264
|
+
id : str
|
|
265
|
+
Agent Prompt ID
|
|
266
|
+
|
|
267
|
+
request : JsonPatch
|
|
268
|
+
|
|
269
|
+
request_options : typing.Optional[RequestOptions]
|
|
270
|
+
Request-specific configuration.
|
|
271
|
+
|
|
272
|
+
Returns
|
|
273
|
+
-------
|
|
274
|
+
AgentPromptsResponse
|
|
275
|
+
Prompt patched successfully
|
|
276
|
+
|
|
277
|
+
Examples
|
|
278
|
+
--------
|
|
279
|
+
from phenoml import phenoml
|
|
280
|
+
from phenoml.agent import JsonPatchOperation
|
|
281
|
+
|
|
282
|
+
client = phenoml(
|
|
283
|
+
token="YOUR_TOKEN",
|
|
284
|
+
)
|
|
285
|
+
client.agent.prompts.patch(
|
|
286
|
+
id="id",
|
|
287
|
+
request=[
|
|
288
|
+
JsonPatchOperation(
|
|
289
|
+
op="replace",
|
|
290
|
+
path="/name",
|
|
291
|
+
value="Updated Agent Name",
|
|
292
|
+
),
|
|
293
|
+
JsonPatchOperation(
|
|
294
|
+
op="add",
|
|
295
|
+
path="/tags/-",
|
|
296
|
+
value="new-tag",
|
|
297
|
+
),
|
|
298
|
+
JsonPatchOperation(
|
|
299
|
+
op="remove",
|
|
300
|
+
path="/description",
|
|
301
|
+
),
|
|
302
|
+
],
|
|
303
|
+
)
|
|
304
|
+
"""
|
|
305
|
+
_response = self._raw_client.patch(id, request=request, request_options=request_options)
|
|
306
|
+
return _response.data
|
|
307
|
+
|
|
308
|
+
def load_defaults(self, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
309
|
+
"""
|
|
310
|
+
Loads default agent prompts for the authenticated user
|
|
311
|
+
|
|
312
|
+
Parameters
|
|
313
|
+
----------
|
|
314
|
+
request_options : typing.Optional[RequestOptions]
|
|
315
|
+
Request-specific configuration.
|
|
316
|
+
|
|
317
|
+
Returns
|
|
318
|
+
-------
|
|
319
|
+
SuccessResponse
|
|
320
|
+
Default prompts loaded successfully
|
|
321
|
+
|
|
322
|
+
Examples
|
|
323
|
+
--------
|
|
324
|
+
from phenoml import phenoml
|
|
325
|
+
|
|
326
|
+
client = phenoml(
|
|
327
|
+
token="YOUR_TOKEN",
|
|
328
|
+
)
|
|
329
|
+
client.agent.prompts.load_defaults()
|
|
330
|
+
"""
|
|
331
|
+
_response = self._raw_client.load_defaults(request_options=request_options)
|
|
332
|
+
return _response.data
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class AsyncPromptsClient:
|
|
336
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
337
|
+
self._raw_client = AsyncRawPromptsClient(client_wrapper=client_wrapper)
|
|
338
|
+
|
|
339
|
+
@property
|
|
340
|
+
def with_raw_response(self) -> AsyncRawPromptsClient:
|
|
341
|
+
"""
|
|
342
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
343
|
+
|
|
344
|
+
Returns
|
|
345
|
+
-------
|
|
346
|
+
AsyncRawPromptsClient
|
|
347
|
+
"""
|
|
348
|
+
return self._raw_client
|
|
349
|
+
|
|
350
|
+
async def create(
|
|
351
|
+
self,
|
|
352
|
+
*,
|
|
353
|
+
name: str,
|
|
354
|
+
content: str,
|
|
355
|
+
is_active: bool,
|
|
356
|
+
description: typing.Optional[str] = OMIT,
|
|
357
|
+
is_default: typing.Optional[bool] = OMIT,
|
|
358
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
359
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
360
|
+
) -> AgentPromptsResponse:
|
|
361
|
+
"""
|
|
362
|
+
Creates a new agent prompt
|
|
363
|
+
|
|
364
|
+
Parameters
|
|
365
|
+
----------
|
|
366
|
+
name : str
|
|
367
|
+
Prompt name
|
|
368
|
+
|
|
369
|
+
content : str
|
|
370
|
+
Prompt content
|
|
371
|
+
|
|
372
|
+
is_active : bool
|
|
373
|
+
Whether the prompt is active
|
|
374
|
+
|
|
375
|
+
description : typing.Optional[str]
|
|
376
|
+
Prompt description
|
|
377
|
+
|
|
378
|
+
is_default : typing.Optional[bool]
|
|
379
|
+
Whether this is a default prompt
|
|
380
|
+
|
|
381
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
382
|
+
Tags for categorizing the prompt
|
|
383
|
+
|
|
384
|
+
request_options : typing.Optional[RequestOptions]
|
|
385
|
+
Request-specific configuration.
|
|
386
|
+
|
|
387
|
+
Returns
|
|
388
|
+
-------
|
|
389
|
+
AgentPromptsResponse
|
|
390
|
+
Prompt created successfully
|
|
391
|
+
|
|
392
|
+
Examples
|
|
393
|
+
--------
|
|
394
|
+
import asyncio
|
|
395
|
+
|
|
396
|
+
from phenoml import Asyncphenoml
|
|
397
|
+
|
|
398
|
+
client = Asyncphenoml(
|
|
399
|
+
token="YOUR_TOKEN",
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
async def main() -> None:
|
|
404
|
+
await client.agent.prompts.create(
|
|
405
|
+
name="Medical Assistant System Prompt",
|
|
406
|
+
content="You are a helpful medical assistant specialized in FHIR data processing...",
|
|
407
|
+
is_active=True,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
asyncio.run(main())
|
|
412
|
+
"""
|
|
413
|
+
_response = await self._raw_client.create(
|
|
414
|
+
name=name,
|
|
415
|
+
content=content,
|
|
416
|
+
is_active=is_active,
|
|
417
|
+
description=description,
|
|
418
|
+
is_default=is_default,
|
|
419
|
+
tags=tags,
|
|
420
|
+
request_options=request_options,
|
|
421
|
+
)
|
|
422
|
+
return _response.data
|
|
423
|
+
|
|
424
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> PromptsListResponse:
|
|
425
|
+
"""
|
|
426
|
+
Retrieves a list of agent prompts belonging to the authenticated user
|
|
427
|
+
|
|
428
|
+
Parameters
|
|
429
|
+
----------
|
|
430
|
+
request_options : typing.Optional[RequestOptions]
|
|
431
|
+
Request-specific configuration.
|
|
432
|
+
|
|
433
|
+
Returns
|
|
434
|
+
-------
|
|
435
|
+
PromptsListResponse
|
|
436
|
+
Prompts retrieved successfully
|
|
437
|
+
|
|
438
|
+
Examples
|
|
439
|
+
--------
|
|
440
|
+
import asyncio
|
|
441
|
+
|
|
442
|
+
from phenoml import Asyncphenoml
|
|
443
|
+
|
|
444
|
+
client = Asyncphenoml(
|
|
445
|
+
token="YOUR_TOKEN",
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
async def main() -> None:
|
|
450
|
+
await client.agent.prompts.list()
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
asyncio.run(main())
|
|
454
|
+
"""
|
|
455
|
+
_response = await self._raw_client.list(request_options=request_options)
|
|
456
|
+
return _response.data
|
|
457
|
+
|
|
458
|
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentPromptsResponse:
|
|
459
|
+
"""
|
|
460
|
+
Retrieves a specific prompt by its ID
|
|
461
|
+
|
|
462
|
+
Parameters
|
|
463
|
+
----------
|
|
464
|
+
id : str
|
|
465
|
+
Prompt ID
|
|
466
|
+
|
|
467
|
+
request_options : typing.Optional[RequestOptions]
|
|
468
|
+
Request-specific configuration.
|
|
469
|
+
|
|
470
|
+
Returns
|
|
471
|
+
-------
|
|
472
|
+
AgentPromptsResponse
|
|
473
|
+
Prompt retrieved successfully
|
|
474
|
+
|
|
475
|
+
Examples
|
|
476
|
+
--------
|
|
477
|
+
import asyncio
|
|
478
|
+
|
|
479
|
+
from phenoml import Asyncphenoml
|
|
480
|
+
|
|
481
|
+
client = Asyncphenoml(
|
|
482
|
+
token="YOUR_TOKEN",
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
async def main() -> None:
|
|
487
|
+
await client.agent.prompts.get(
|
|
488
|
+
id="id",
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
asyncio.run(main())
|
|
493
|
+
"""
|
|
494
|
+
_response = await self._raw_client.get(id, request_options=request_options)
|
|
495
|
+
return _response.data
|
|
496
|
+
|
|
497
|
+
async def update(
|
|
498
|
+
self,
|
|
499
|
+
id: str,
|
|
500
|
+
*,
|
|
501
|
+
name: typing.Optional[str] = OMIT,
|
|
502
|
+
description: typing.Optional[str] = OMIT,
|
|
503
|
+
content: typing.Optional[str] = OMIT,
|
|
504
|
+
is_default: typing.Optional[bool] = OMIT,
|
|
505
|
+
is_active: typing.Optional[bool] = OMIT,
|
|
506
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
507
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
508
|
+
) -> AgentPromptsResponse:
|
|
509
|
+
"""
|
|
510
|
+
Updates an existing prompt
|
|
511
|
+
|
|
512
|
+
Parameters
|
|
513
|
+
----------
|
|
514
|
+
id : str
|
|
515
|
+
Prompt ID
|
|
516
|
+
|
|
517
|
+
name : typing.Optional[str]
|
|
518
|
+
Prompt name
|
|
519
|
+
|
|
520
|
+
description : typing.Optional[str]
|
|
521
|
+
Prompt description
|
|
522
|
+
|
|
523
|
+
content : typing.Optional[str]
|
|
524
|
+
Prompt content
|
|
525
|
+
|
|
526
|
+
is_default : typing.Optional[bool]
|
|
527
|
+
Whether this is a default prompt
|
|
528
|
+
|
|
529
|
+
is_active : typing.Optional[bool]
|
|
530
|
+
Whether the prompt is active
|
|
531
|
+
|
|
532
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
533
|
+
Tags for categorizing the prompt
|
|
534
|
+
|
|
535
|
+
request_options : typing.Optional[RequestOptions]
|
|
536
|
+
Request-specific configuration.
|
|
537
|
+
|
|
538
|
+
Returns
|
|
539
|
+
-------
|
|
540
|
+
AgentPromptsResponse
|
|
541
|
+
Prompt updated successfully
|
|
542
|
+
|
|
543
|
+
Examples
|
|
544
|
+
--------
|
|
545
|
+
import asyncio
|
|
546
|
+
|
|
547
|
+
from phenoml import Asyncphenoml
|
|
548
|
+
|
|
549
|
+
client = Asyncphenoml(
|
|
550
|
+
token="YOUR_TOKEN",
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
async def main() -> None:
|
|
555
|
+
await client.agent.prompts.update(
|
|
556
|
+
id="id",
|
|
557
|
+
)
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
asyncio.run(main())
|
|
561
|
+
"""
|
|
562
|
+
_response = await self._raw_client.update(
|
|
563
|
+
id,
|
|
564
|
+
name=name,
|
|
565
|
+
description=description,
|
|
566
|
+
content=content,
|
|
567
|
+
is_default=is_default,
|
|
568
|
+
is_active=is_active,
|
|
569
|
+
tags=tags,
|
|
570
|
+
request_options=request_options,
|
|
571
|
+
)
|
|
572
|
+
return _response.data
|
|
573
|
+
|
|
574
|
+
async def delete(
|
|
575
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
576
|
+
) -> PromptsDeleteResponse:
|
|
577
|
+
"""
|
|
578
|
+
Soft deletes a prompt by setting is_active to false
|
|
579
|
+
|
|
580
|
+
Parameters
|
|
581
|
+
----------
|
|
582
|
+
id : str
|
|
583
|
+
Prompt ID
|
|
584
|
+
|
|
585
|
+
request_options : typing.Optional[RequestOptions]
|
|
586
|
+
Request-specific configuration.
|
|
587
|
+
|
|
588
|
+
Returns
|
|
589
|
+
-------
|
|
590
|
+
PromptsDeleteResponse
|
|
591
|
+
Prompt deleted successfully
|
|
592
|
+
|
|
593
|
+
Examples
|
|
594
|
+
--------
|
|
595
|
+
import asyncio
|
|
596
|
+
|
|
597
|
+
from phenoml import Asyncphenoml
|
|
598
|
+
|
|
599
|
+
client = Asyncphenoml(
|
|
600
|
+
token="YOUR_TOKEN",
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
async def main() -> None:
|
|
605
|
+
await client.agent.prompts.delete(
|
|
606
|
+
id="id",
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
asyncio.run(main())
|
|
611
|
+
"""
|
|
612
|
+
_response = await self._raw_client.delete(id, request_options=request_options)
|
|
613
|
+
return _response.data
|
|
614
|
+
|
|
615
|
+
async def patch(
|
|
616
|
+
self, id: str, *, request: JsonPatch, request_options: typing.Optional[RequestOptions] = None
|
|
617
|
+
) -> AgentPromptsResponse:
|
|
618
|
+
"""
|
|
619
|
+
Patches an existing prompt
|
|
620
|
+
|
|
621
|
+
Parameters
|
|
622
|
+
----------
|
|
623
|
+
id : str
|
|
624
|
+
Agent Prompt ID
|
|
625
|
+
|
|
626
|
+
request : JsonPatch
|
|
627
|
+
|
|
628
|
+
request_options : typing.Optional[RequestOptions]
|
|
629
|
+
Request-specific configuration.
|
|
630
|
+
|
|
631
|
+
Returns
|
|
632
|
+
-------
|
|
633
|
+
AgentPromptsResponse
|
|
634
|
+
Prompt patched successfully
|
|
635
|
+
|
|
636
|
+
Examples
|
|
637
|
+
--------
|
|
638
|
+
import asyncio
|
|
639
|
+
|
|
640
|
+
from phenoml import Asyncphenoml
|
|
641
|
+
from phenoml.agent import JsonPatchOperation
|
|
642
|
+
|
|
643
|
+
client = Asyncphenoml(
|
|
644
|
+
token="YOUR_TOKEN",
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
async def main() -> None:
|
|
649
|
+
await client.agent.prompts.patch(
|
|
650
|
+
id="id",
|
|
651
|
+
request=[
|
|
652
|
+
JsonPatchOperation(
|
|
653
|
+
op="replace",
|
|
654
|
+
path="/name",
|
|
655
|
+
value="Updated Agent Name",
|
|
656
|
+
),
|
|
657
|
+
JsonPatchOperation(
|
|
658
|
+
op="add",
|
|
659
|
+
path="/tags/-",
|
|
660
|
+
value="new-tag",
|
|
661
|
+
),
|
|
662
|
+
JsonPatchOperation(
|
|
663
|
+
op="remove",
|
|
664
|
+
path="/description",
|
|
665
|
+
),
|
|
666
|
+
],
|
|
667
|
+
)
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
asyncio.run(main())
|
|
671
|
+
"""
|
|
672
|
+
_response = await self._raw_client.patch(id, request=request, request_options=request_options)
|
|
673
|
+
return _response.data
|
|
674
|
+
|
|
675
|
+
async def load_defaults(self, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
676
|
+
"""
|
|
677
|
+
Loads default agent prompts for the authenticated user
|
|
678
|
+
|
|
679
|
+
Parameters
|
|
680
|
+
----------
|
|
681
|
+
request_options : typing.Optional[RequestOptions]
|
|
682
|
+
Request-specific configuration.
|
|
683
|
+
|
|
684
|
+
Returns
|
|
685
|
+
-------
|
|
686
|
+
SuccessResponse
|
|
687
|
+
Default prompts loaded successfully
|
|
688
|
+
|
|
689
|
+
Examples
|
|
690
|
+
--------
|
|
691
|
+
import asyncio
|
|
692
|
+
|
|
693
|
+
from phenoml import Asyncphenoml
|
|
694
|
+
|
|
695
|
+
client = Asyncphenoml(
|
|
696
|
+
token="YOUR_TOKEN",
|
|
697
|
+
)
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
async def main() -> None:
|
|
701
|
+
await client.agent.prompts.load_defaults()
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
asyncio.run(main())
|
|
705
|
+
"""
|
|
706
|
+
_response = await self._raw_client.load_defaults(request_options=request_options)
|
|
707
|
+
return _response.data
|