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