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
phenoml/tools/client.py
CHANGED
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
|
+
from .mcp_server.client import AsyncMcpServerClient, McpServerClient
|
|
7
8
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
8
9
|
from .types.cohort_request_provider import CohortRequestProvider
|
|
9
10
|
from .types.cohort_response import CohortResponse
|
|
@@ -21,6 +22,7 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
21
22
|
class ToolsClient:
|
|
22
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
23
24
|
self._raw_client = RawToolsClient(client_wrapper=client_wrapper)
|
|
25
|
+
self.mcp_server = McpServerClient(client_wrapper=client_wrapper)
|
|
24
26
|
|
|
25
27
|
@property
|
|
26
28
|
def with_raw_response(self) -> RawToolsClient:
|
|
@@ -196,6 +198,7 @@ class ToolsClient:
|
|
|
196
198
|
class AsyncToolsClient:
|
|
197
199
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
198
200
|
self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper)
|
|
201
|
+
self.mcp_server = AsyncMcpServerClient(client_wrapper=client_wrapper)
|
|
199
202
|
|
|
200
203
|
@property
|
|
201
204
|
def with_raw_response(self) -> AsyncRawToolsClient:
|
|
@@ -0,0 +1,336 @@
|
|
|
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.mcp_server_response import McpServerResponse
|
|
8
|
+
from .raw_client import AsyncRawMcpServerClient, RawMcpServerClient
|
|
9
|
+
from .tools.client import AsyncToolsClient, ToolsClient
|
|
10
|
+
|
|
11
|
+
# this is used as the default value for optional parameters
|
|
12
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class McpServerClient:
|
|
16
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
17
|
+
self._raw_client = RawMcpServerClient(client_wrapper=client_wrapper)
|
|
18
|
+
self.tools = ToolsClient(client_wrapper=client_wrapper)
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def with_raw_response(self) -> RawMcpServerClient:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
RawMcpServerClient
|
|
28
|
+
"""
|
|
29
|
+
return self._raw_client
|
|
30
|
+
|
|
31
|
+
def create(
|
|
32
|
+
self, *, name: str, mcp_server_url: str, request_options: typing.Optional[RequestOptions] = None
|
|
33
|
+
) -> McpServerResponse:
|
|
34
|
+
"""
|
|
35
|
+
Creates a new MCP server
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
name : str
|
|
40
|
+
Name of the MCP server
|
|
41
|
+
|
|
42
|
+
mcp_server_url : str
|
|
43
|
+
URL of the MCP server
|
|
44
|
+
|
|
45
|
+
request_options : typing.Optional[RequestOptions]
|
|
46
|
+
Request-specific configuration.
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
-------
|
|
50
|
+
McpServerResponse
|
|
51
|
+
Successfully created MCP server
|
|
52
|
+
|
|
53
|
+
Examples
|
|
54
|
+
--------
|
|
55
|
+
from phenoml import phenoml
|
|
56
|
+
|
|
57
|
+
client = phenoml(
|
|
58
|
+
token="YOUR_TOKEN",
|
|
59
|
+
)
|
|
60
|
+
client.tools.mcp_server.create(
|
|
61
|
+
name="My MCP Server",
|
|
62
|
+
mcp_server_url="https://mcp.example.com",
|
|
63
|
+
)
|
|
64
|
+
"""
|
|
65
|
+
_response = self._raw_client.create(name=name, mcp_server_url=mcp_server_url, request_options=request_options)
|
|
66
|
+
return _response.data
|
|
67
|
+
|
|
68
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> McpServerResponse:
|
|
69
|
+
"""
|
|
70
|
+
Lists all MCP servers for a specific user
|
|
71
|
+
|
|
72
|
+
Parameters
|
|
73
|
+
----------
|
|
74
|
+
request_options : typing.Optional[RequestOptions]
|
|
75
|
+
Request-specific configuration.
|
|
76
|
+
|
|
77
|
+
Returns
|
|
78
|
+
-------
|
|
79
|
+
McpServerResponse
|
|
80
|
+
Successfully listed MCP servers
|
|
81
|
+
|
|
82
|
+
Examples
|
|
83
|
+
--------
|
|
84
|
+
from phenoml import phenoml
|
|
85
|
+
|
|
86
|
+
client = phenoml(
|
|
87
|
+
token="YOUR_TOKEN",
|
|
88
|
+
)
|
|
89
|
+
client.tools.mcp_server.list()
|
|
90
|
+
"""
|
|
91
|
+
_response = self._raw_client.list(request_options=request_options)
|
|
92
|
+
return _response.data
|
|
93
|
+
|
|
94
|
+
def get(self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> McpServerResponse:
|
|
95
|
+
"""
|
|
96
|
+
Gets a MCP server by ID
|
|
97
|
+
|
|
98
|
+
Parameters
|
|
99
|
+
----------
|
|
100
|
+
mcp_server_id : str
|
|
101
|
+
ID of the MCP server to retrieve
|
|
102
|
+
|
|
103
|
+
request_options : typing.Optional[RequestOptions]
|
|
104
|
+
Request-specific configuration.
|
|
105
|
+
|
|
106
|
+
Returns
|
|
107
|
+
-------
|
|
108
|
+
McpServerResponse
|
|
109
|
+
Successfully retrieved MCP server
|
|
110
|
+
|
|
111
|
+
Examples
|
|
112
|
+
--------
|
|
113
|
+
from phenoml import phenoml
|
|
114
|
+
|
|
115
|
+
client = phenoml(
|
|
116
|
+
token="YOUR_TOKEN",
|
|
117
|
+
)
|
|
118
|
+
client.tools.mcp_server.get(
|
|
119
|
+
mcp_server_id="mcp_server_id",
|
|
120
|
+
)
|
|
121
|
+
"""
|
|
122
|
+
_response = self._raw_client.get(mcp_server_id, request_options=request_options)
|
|
123
|
+
return _response.data
|
|
124
|
+
|
|
125
|
+
def delete(
|
|
126
|
+
self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
127
|
+
) -> McpServerResponse:
|
|
128
|
+
"""
|
|
129
|
+
Deletes a MCP server by ID
|
|
130
|
+
|
|
131
|
+
Parameters
|
|
132
|
+
----------
|
|
133
|
+
mcp_server_id : str
|
|
134
|
+
ID of the MCP server to delete
|
|
135
|
+
|
|
136
|
+
request_options : typing.Optional[RequestOptions]
|
|
137
|
+
Request-specific configuration.
|
|
138
|
+
|
|
139
|
+
Returns
|
|
140
|
+
-------
|
|
141
|
+
McpServerResponse
|
|
142
|
+
Successfully deleted MCP server
|
|
143
|
+
|
|
144
|
+
Examples
|
|
145
|
+
--------
|
|
146
|
+
from phenoml import phenoml
|
|
147
|
+
|
|
148
|
+
client = phenoml(
|
|
149
|
+
token="YOUR_TOKEN",
|
|
150
|
+
)
|
|
151
|
+
client.tools.mcp_server.delete(
|
|
152
|
+
mcp_server_id="mcp_server_id",
|
|
153
|
+
)
|
|
154
|
+
"""
|
|
155
|
+
_response = self._raw_client.delete(mcp_server_id, request_options=request_options)
|
|
156
|
+
return _response.data
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class AsyncMcpServerClient:
|
|
160
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
161
|
+
self._raw_client = AsyncRawMcpServerClient(client_wrapper=client_wrapper)
|
|
162
|
+
self.tools = AsyncToolsClient(client_wrapper=client_wrapper)
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def with_raw_response(self) -> AsyncRawMcpServerClient:
|
|
166
|
+
"""
|
|
167
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
168
|
+
|
|
169
|
+
Returns
|
|
170
|
+
-------
|
|
171
|
+
AsyncRawMcpServerClient
|
|
172
|
+
"""
|
|
173
|
+
return self._raw_client
|
|
174
|
+
|
|
175
|
+
async def create(
|
|
176
|
+
self, *, name: str, mcp_server_url: str, request_options: typing.Optional[RequestOptions] = None
|
|
177
|
+
) -> McpServerResponse:
|
|
178
|
+
"""
|
|
179
|
+
Creates a new MCP server
|
|
180
|
+
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
name : str
|
|
184
|
+
Name of the MCP server
|
|
185
|
+
|
|
186
|
+
mcp_server_url : str
|
|
187
|
+
URL of the MCP server
|
|
188
|
+
|
|
189
|
+
request_options : typing.Optional[RequestOptions]
|
|
190
|
+
Request-specific configuration.
|
|
191
|
+
|
|
192
|
+
Returns
|
|
193
|
+
-------
|
|
194
|
+
McpServerResponse
|
|
195
|
+
Successfully created MCP server
|
|
196
|
+
|
|
197
|
+
Examples
|
|
198
|
+
--------
|
|
199
|
+
import asyncio
|
|
200
|
+
|
|
201
|
+
from phenoml import Asyncphenoml
|
|
202
|
+
|
|
203
|
+
client = Asyncphenoml(
|
|
204
|
+
token="YOUR_TOKEN",
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
async def main() -> None:
|
|
209
|
+
await client.tools.mcp_server.create(
|
|
210
|
+
name="My MCP Server",
|
|
211
|
+
mcp_server_url="https://mcp.example.com",
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
asyncio.run(main())
|
|
216
|
+
"""
|
|
217
|
+
_response = await self._raw_client.create(
|
|
218
|
+
name=name, mcp_server_url=mcp_server_url, request_options=request_options
|
|
219
|
+
)
|
|
220
|
+
return _response.data
|
|
221
|
+
|
|
222
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> McpServerResponse:
|
|
223
|
+
"""
|
|
224
|
+
Lists all MCP servers for a specific user
|
|
225
|
+
|
|
226
|
+
Parameters
|
|
227
|
+
----------
|
|
228
|
+
request_options : typing.Optional[RequestOptions]
|
|
229
|
+
Request-specific configuration.
|
|
230
|
+
|
|
231
|
+
Returns
|
|
232
|
+
-------
|
|
233
|
+
McpServerResponse
|
|
234
|
+
Successfully listed MCP servers
|
|
235
|
+
|
|
236
|
+
Examples
|
|
237
|
+
--------
|
|
238
|
+
import asyncio
|
|
239
|
+
|
|
240
|
+
from phenoml import Asyncphenoml
|
|
241
|
+
|
|
242
|
+
client = Asyncphenoml(
|
|
243
|
+
token="YOUR_TOKEN",
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
async def main() -> None:
|
|
248
|
+
await client.tools.mcp_server.list()
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
asyncio.run(main())
|
|
252
|
+
"""
|
|
253
|
+
_response = await self._raw_client.list(request_options=request_options)
|
|
254
|
+
return _response.data
|
|
255
|
+
|
|
256
|
+
async def get(
|
|
257
|
+
self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
258
|
+
) -> McpServerResponse:
|
|
259
|
+
"""
|
|
260
|
+
Gets a MCP server by ID
|
|
261
|
+
|
|
262
|
+
Parameters
|
|
263
|
+
----------
|
|
264
|
+
mcp_server_id : str
|
|
265
|
+
ID of the MCP server to retrieve
|
|
266
|
+
|
|
267
|
+
request_options : typing.Optional[RequestOptions]
|
|
268
|
+
Request-specific configuration.
|
|
269
|
+
|
|
270
|
+
Returns
|
|
271
|
+
-------
|
|
272
|
+
McpServerResponse
|
|
273
|
+
Successfully retrieved MCP server
|
|
274
|
+
|
|
275
|
+
Examples
|
|
276
|
+
--------
|
|
277
|
+
import asyncio
|
|
278
|
+
|
|
279
|
+
from phenoml import Asyncphenoml
|
|
280
|
+
|
|
281
|
+
client = Asyncphenoml(
|
|
282
|
+
token="YOUR_TOKEN",
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
async def main() -> None:
|
|
287
|
+
await client.tools.mcp_server.get(
|
|
288
|
+
mcp_server_id="mcp_server_id",
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
asyncio.run(main())
|
|
293
|
+
"""
|
|
294
|
+
_response = await self._raw_client.get(mcp_server_id, request_options=request_options)
|
|
295
|
+
return _response.data
|
|
296
|
+
|
|
297
|
+
async def delete(
|
|
298
|
+
self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
299
|
+
) -> McpServerResponse:
|
|
300
|
+
"""
|
|
301
|
+
Deletes a MCP server by ID
|
|
302
|
+
|
|
303
|
+
Parameters
|
|
304
|
+
----------
|
|
305
|
+
mcp_server_id : str
|
|
306
|
+
ID of the MCP server to delete
|
|
307
|
+
|
|
308
|
+
request_options : typing.Optional[RequestOptions]
|
|
309
|
+
Request-specific configuration.
|
|
310
|
+
|
|
311
|
+
Returns
|
|
312
|
+
-------
|
|
313
|
+
McpServerResponse
|
|
314
|
+
Successfully deleted MCP server
|
|
315
|
+
|
|
316
|
+
Examples
|
|
317
|
+
--------
|
|
318
|
+
import asyncio
|
|
319
|
+
|
|
320
|
+
from phenoml import Asyncphenoml
|
|
321
|
+
|
|
322
|
+
client = Asyncphenoml(
|
|
323
|
+
token="YOUR_TOKEN",
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
async def main() -> None:
|
|
328
|
+
await client.tools.mcp_server.delete(
|
|
329
|
+
mcp_server_id="mcp_server_id",
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
asyncio.run(main())
|
|
334
|
+
"""
|
|
335
|
+
_response = await self._raw_client.delete(mcp_server_id, request_options=request_options)
|
|
336
|
+
return _response.data
|