vellum-ai 1.1.0__py3-none-any.whl → 1.1.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.
Files changed (76) hide show
  1. vellum/client/README.md +0 -55
  2. vellum/client/__init__.py +159 -873
  3. vellum/client/core/__init__.py +3 -0
  4. vellum/client/core/client_wrapper.py +2 -2
  5. vellum/client/core/http_response.py +47 -0
  6. vellum/client/core/pydantic_utilities.py +10 -3
  7. vellum/client/raw_client.py +1561 -0
  8. vellum/client/reference.md +20 -693
  9. vellum/client/resources/ad_hoc/client.py +55 -161
  10. vellum/client/resources/ad_hoc/raw_client.py +278 -0
  11. vellum/client/resources/container_images/client.py +62 -172
  12. vellum/client/resources/container_images/raw_client.py +400 -0
  13. vellum/client/resources/deployments/client.py +112 -437
  14. vellum/client/resources/deployments/raw_client.py +995 -0
  15. vellum/client/resources/document_indexes/client.py +108 -317
  16. vellum/client/resources/document_indexes/raw_client.py +847 -0
  17. vellum/client/resources/documents/client.py +88 -285
  18. vellum/client/resources/documents/raw_client.py +655 -0
  19. vellum/client/resources/folder_entities/client.py +54 -92
  20. vellum/client/resources/folder_entities/raw_client.py +277 -0
  21. vellum/client/resources/metric_definitions/client.py +48 -95
  22. vellum/client/resources/metric_definitions/raw_client.py +225 -0
  23. vellum/client/resources/ml_models/client.py +36 -40
  24. vellum/client/resources/ml_models/raw_client.py +103 -0
  25. vellum/client/resources/organizations/client.py +34 -39
  26. vellum/client/resources/organizations/raw_client.py +96 -0
  27. vellum/client/resources/prompts/client.py +50 -193
  28. vellum/client/resources/prompts/raw_client.py +346 -0
  29. vellum/client/resources/sandboxes/client.py +68 -141
  30. vellum/client/resources/sandboxes/raw_client.py +393 -0
  31. vellum/client/resources/test_suite_runs/client.py +58 -141
  32. vellum/client/resources/test_suite_runs/raw_client.py +355 -0
  33. vellum/client/resources/test_suites/client.py +73 -141
  34. vellum/client/resources/test_suites/raw_client.py +379 -0
  35. vellum/client/resources/workflow_deployments/client.py +118 -362
  36. vellum/client/resources/workflow_deployments/raw_client.py +931 -0
  37. vellum/client/resources/workflow_executions/client.py +36 -40
  38. vellum/client/resources/workflow_executions/raw_client.py +97 -0
  39. vellum/client/resources/workflow_sandboxes/client.py +60 -108
  40. vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
  41. vellum/client/resources/workflows/client.py +68 -133
  42. vellum/client/resources/workflows/raw_client.py +307 -0
  43. vellum/client/resources/workspace_secrets/client.py +46 -90
  44. vellum/client/resources/workspace_secrets/raw_client.py +220 -0
  45. vellum/client/resources/workspaces/client.py +34 -39
  46. vellum/client/resources/workspaces/raw_client.py +96 -0
  47. vellum/core/http_response.py +3 -0
  48. vellum/raw_client.py +3 -0
  49. vellum/resources/ad_hoc/raw_client.py +3 -0
  50. vellum/resources/container_images/raw_client.py +3 -0
  51. vellum/resources/deployments/raw_client.py +3 -0
  52. vellum/resources/document_indexes/raw_client.py +3 -0
  53. vellum/resources/documents/raw_client.py +3 -0
  54. vellum/resources/folder_entities/raw_client.py +3 -0
  55. vellum/resources/metric_definitions/raw_client.py +3 -0
  56. vellum/resources/ml_models/raw_client.py +3 -0
  57. vellum/resources/organizations/raw_client.py +3 -0
  58. vellum/resources/prompts/raw_client.py +3 -0
  59. vellum/resources/sandboxes/raw_client.py +3 -0
  60. vellum/resources/test_suite_runs/raw_client.py +3 -0
  61. vellum/resources/test_suites/raw_client.py +3 -0
  62. vellum/resources/workflow_deployments/raw_client.py +3 -0
  63. vellum/resources/workflow_executions/raw_client.py +3 -0
  64. vellum/resources/workflow_sandboxes/raw_client.py +3 -0
  65. vellum/resources/workflows/raw_client.py +3 -0
  66. vellum/resources/workspace_secrets/raw_client.py +3 -0
  67. vellum/resources/workspaces/raw_client.py +3 -0
  68. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/METADATA +1 -1
  69. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/RECORD +76 -33
  70. vellum_ee/workflows/display/exceptions.py +7 -0
  71. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
  72. vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
  73. vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
  74. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/LICENSE +0 -0
  75. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/WHEEL +0 -0
  76. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/entry_points.txt +0 -0
@@ -1,19 +1,32 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from ...core.client_wrapper import SyncClientWrapper
4
+ from .raw_client import RawWorkflowExecutionsClient
4
5
  import typing
5
6
  from ...core.request_options import RequestOptions
6
7
  from ...types.workflow_execution_detail import WorkflowExecutionDetail
7
- from ...core.jsonable_encoder import jsonable_encoder
8
- from ...core.pydantic_utilities import parse_obj_as
9
- from json.decoder import JSONDecodeError
10
- from ...core.api_error import ApiError
11
8
  from ...core.client_wrapper import AsyncClientWrapper
9
+ from .raw_client import AsyncRawWorkflowExecutionsClient
12
10
 
13
11
 
14
12
  class WorkflowExecutionsClient:
15
13
  def __init__(self, *, client_wrapper: SyncClientWrapper):
16
- self._client_wrapper = client_wrapper
14
+ self._raw_client = RawWorkflowExecutionsClient(client_wrapper=client_wrapper)
15
+
16
+ @property
17
+ def _client_wrapper(self) -> SyncClientWrapper:
18
+ return self._raw_client._client_wrapper
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawWorkflowExecutionsClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawWorkflowExecutionsClient
28
+ """
29
+ return self._raw_client
17
30
 
18
31
  def retrieve_workflow_execution_detail(
19
32
  self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -43,30 +56,27 @@ class WorkflowExecutionsClient:
43
56
  execution_id="execution_id",
44
57
  )
45
58
  """
46
- _response = self._client_wrapper.httpx_client.request(
47
- f"v1/workflow-executions/{jsonable_encoder(execution_id)}/detail",
48
- base_url=self._client_wrapper.get_environment().default,
49
- method="GET",
59
+ response = self._raw_client.retrieve_workflow_execution_detail(
60
+ execution_id,
50
61
  request_options=request_options,
51
62
  )
52
- try:
53
- if 200 <= _response.status_code < 300:
54
- return typing.cast(
55
- WorkflowExecutionDetail,
56
- parse_obj_as(
57
- type_=WorkflowExecutionDetail, # type: ignore
58
- object_=_response.json(),
59
- ),
60
- )
61
- _response_json = _response.json()
62
- except JSONDecodeError:
63
- raise ApiError(status_code=_response.status_code, body=_response.text)
64
- raise ApiError(status_code=_response.status_code, body=_response_json)
63
+ return response.data
65
64
 
66
65
 
67
66
  class AsyncWorkflowExecutionsClient:
68
67
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
69
- self._client_wrapper = client_wrapper
68
+ self._raw_client = AsyncRawWorkflowExecutionsClient(client_wrapper=client_wrapper)
69
+
70
+ @property
71
+ def with_raw_response(self) -> AsyncRawWorkflowExecutionsClient:
72
+ """
73
+ Retrieves a raw implementation of this client that returns raw responses.
74
+
75
+ Returns
76
+ -------
77
+ AsyncRawWorkflowExecutionsClient
78
+ """
79
+ return self._raw_client
70
80
 
71
81
  async def retrieve_workflow_execution_detail(
72
82
  self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -104,22 +114,8 @@ class AsyncWorkflowExecutionsClient:
104
114
 
105
115
  asyncio.run(main())
106
116
  """
107
- _response = await self._client_wrapper.httpx_client.request(
108
- f"v1/workflow-executions/{jsonable_encoder(execution_id)}/detail",
109
- base_url=self._client_wrapper.get_environment().default,
110
- method="GET",
117
+ response = await self._raw_client.retrieve_workflow_execution_detail(
118
+ execution_id,
111
119
  request_options=request_options,
112
120
  )
113
- try:
114
- if 200 <= _response.status_code < 300:
115
- return typing.cast(
116
- WorkflowExecutionDetail,
117
- parse_obj_as(
118
- type_=WorkflowExecutionDetail, # type: ignore
119
- object_=_response.json(),
120
- ),
121
- )
122
- _response_json = _response.json()
123
- except JSONDecodeError:
124
- raise ApiError(status_code=_response.status_code, body=_response.text)
125
- raise ApiError(status_code=_response.status_code, body=_response_json)
121
+ return response.data
@@ -0,0 +1,97 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.client_wrapper import SyncClientWrapper
4
+ import typing
5
+ from ...core.request_options import RequestOptions
6
+ from ...core.http_response import HttpResponse
7
+ from ...types.workflow_execution_detail import WorkflowExecutionDetail
8
+ from ...core.jsonable_encoder import jsonable_encoder
9
+ from ...core.pydantic_utilities import parse_obj_as
10
+ from json.decoder import JSONDecodeError
11
+ from ...core.api_error import ApiError
12
+ from ...core.client_wrapper import AsyncClientWrapper
13
+ from ...core.http_response import AsyncHttpResponse
14
+
15
+
16
+ class RawWorkflowExecutionsClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._client_wrapper = client_wrapper
19
+
20
+ def retrieve_workflow_execution_detail(
21
+ self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
22
+ ) -> HttpResponse[WorkflowExecutionDetail]:
23
+ """
24
+ Parameters
25
+ ----------
26
+ execution_id : str
27
+
28
+ request_options : typing.Optional[RequestOptions]
29
+ Request-specific configuration.
30
+
31
+ Returns
32
+ -------
33
+ HttpResponse[WorkflowExecutionDetail]
34
+
35
+ """
36
+ _response = self._client_wrapper.httpx_client.request(
37
+ f"v1/workflow-executions/{jsonable_encoder(execution_id)}/detail",
38
+ base_url=self._client_wrapper.get_environment().default,
39
+ method="GET",
40
+ request_options=request_options,
41
+ )
42
+ try:
43
+ if 200 <= _response.status_code < 300:
44
+ _data = typing.cast(
45
+ WorkflowExecutionDetail,
46
+ parse_obj_as(
47
+ type_=WorkflowExecutionDetail, # type: ignore
48
+ object_=_response.json(),
49
+ ),
50
+ )
51
+ return HttpResponse(response=_response, data=_data)
52
+ _response_json = _response.json()
53
+ except JSONDecodeError:
54
+ raise ApiError(status_code=_response.status_code, body=_response.text)
55
+ raise ApiError(status_code=_response.status_code, body=_response_json)
56
+
57
+
58
+ class AsyncRawWorkflowExecutionsClient:
59
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
60
+ self._client_wrapper = client_wrapper
61
+
62
+ async def retrieve_workflow_execution_detail(
63
+ self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
64
+ ) -> AsyncHttpResponse[WorkflowExecutionDetail]:
65
+ """
66
+ Parameters
67
+ ----------
68
+ execution_id : str
69
+
70
+ request_options : typing.Optional[RequestOptions]
71
+ Request-specific configuration.
72
+
73
+ Returns
74
+ -------
75
+ AsyncHttpResponse[WorkflowExecutionDetail]
76
+
77
+ """
78
+ _response = await self._client_wrapper.httpx_client.request(
79
+ f"v1/workflow-executions/{jsonable_encoder(execution_id)}/detail",
80
+ base_url=self._client_wrapper.get_environment().default,
81
+ method="GET",
82
+ request_options=request_options,
83
+ )
84
+ try:
85
+ if 200 <= _response.status_code < 300:
86
+ _data = typing.cast(
87
+ WorkflowExecutionDetail,
88
+ parse_obj_as(
89
+ type_=WorkflowExecutionDetail, # type: ignore
90
+ object_=_response.json(),
91
+ ),
92
+ )
93
+ return AsyncHttpResponse(response=_response, data=_data)
94
+ _response_json = _response.json()
95
+ except JSONDecodeError:
96
+ raise ApiError(status_code=_response.status_code, body=_response.text)
97
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -2,15 +2,13 @@
2
2
 
3
3
  import typing
4
4
  from ...core.client_wrapper import SyncClientWrapper
5
+ from .raw_client import RawWorkflowSandboxesClient
5
6
  from ...core.request_options import RequestOptions
6
7
  from ...types.workflow_deployment_read import WorkflowDeploymentRead
7
- from ...core.jsonable_encoder import jsonable_encoder
8
- from ...core.pydantic_utilities import parse_obj_as
9
- from json.decoder import JSONDecodeError
10
- from ...core.api_error import ApiError
11
8
  from .types.list_workflow_sandbox_examples_request_tag import ListWorkflowSandboxExamplesRequestTag
12
9
  from ...types.paginated_workflow_sandbox_example_list import PaginatedWorkflowSandboxExampleList
13
10
  from ...core.client_wrapper import AsyncClientWrapper
11
+ from .raw_client import AsyncRawWorkflowSandboxesClient
14
12
 
15
13
  # this is used as the default value for optional parameters
16
14
  OMIT = typing.cast(typing.Any, ...)
@@ -18,7 +16,22 @@ OMIT = typing.cast(typing.Any, ...)
18
16
 
19
17
  class WorkflowSandboxesClient:
20
18
  def __init__(self, *, client_wrapper: SyncClientWrapper):
21
- self._client_wrapper = client_wrapper
19
+ self._raw_client = RawWorkflowSandboxesClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def _client_wrapper(self) -> SyncClientWrapper:
23
+ return self._raw_client._client_wrapper
24
+
25
+ @property
26
+ def with_raw_response(self) -> RawWorkflowSandboxesClient:
27
+ """
28
+ Retrieves a raw implementation of this client that returns raw responses.
29
+
30
+ Returns
31
+ -------
32
+ RawWorkflowSandboxesClient
33
+ """
34
+ return self._raw_client
22
35
 
23
36
  def deploy_workflow(
24
37
  self,
@@ -77,36 +90,17 @@ class WorkflowSandboxesClient:
77
90
  workflow_id="workflow_id",
78
91
  )
79
92
  """
80
- _response = self._client_wrapper.httpx_client.request(
81
- f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
82
- base_url=self._client_wrapper.get_environment().default,
83
- method="POST",
84
- json={
85
- "workflow_deployment_id": workflow_deployment_id,
86
- "workflow_deployment_name": workflow_deployment_name,
87
- "label": label,
88
- "release_tags": release_tags,
89
- "release_description": release_description,
90
- },
91
- headers={
92
- "content-type": "application/json",
93
- },
93
+ response = self._raw_client.deploy_workflow(
94
+ id,
95
+ workflow_id,
96
+ workflow_deployment_id=workflow_deployment_id,
97
+ workflow_deployment_name=workflow_deployment_name,
98
+ label=label,
99
+ release_tags=release_tags,
100
+ release_description=release_description,
94
101
  request_options=request_options,
95
- omit=OMIT,
96
102
  )
97
- try:
98
- if 200 <= _response.status_code < 300:
99
- return typing.cast(
100
- WorkflowDeploymentRead,
101
- parse_obj_as(
102
- type_=WorkflowDeploymentRead, # type: ignore
103
- object_=_response.json(),
104
- ),
105
- )
106
- _response_json = _response.json()
107
- except JSONDecodeError:
108
- raise ApiError(status_code=_response.status_code, body=_response.text)
109
- raise ApiError(status_code=_response.status_code, body=_response_json)
103
+ return response.data
110
104
 
111
105
  def list_workflow_sandbox_examples(
112
106
  self,
@@ -151,36 +145,30 @@ class WorkflowSandboxesClient:
151
145
  )
152
146
  client.workflow_sandboxes.list_workflow_sandbox_examples()
153
147
  """
154
- _response = self._client_wrapper.httpx_client.request(
155
- "v1/workflow-sandboxes/examples",
156
- base_url=self._client_wrapper.get_environment().default,
157
- method="GET",
158
- params={
159
- "limit": limit,
160
- "offset": offset,
161
- "ordering": ordering,
162
- "tag": tag,
163
- },
148
+ response = self._raw_client.list_workflow_sandbox_examples(
149
+ limit=limit,
150
+ offset=offset,
151
+ ordering=ordering,
152
+ tag=tag,
164
153
  request_options=request_options,
165
154
  )
166
- try:
167
- if 200 <= _response.status_code < 300:
168
- return typing.cast(
169
- PaginatedWorkflowSandboxExampleList,
170
- parse_obj_as(
171
- type_=PaginatedWorkflowSandboxExampleList, # type: ignore
172
- object_=_response.json(),
173
- ),
174
- )
175
- _response_json = _response.json()
176
- except JSONDecodeError:
177
- raise ApiError(status_code=_response.status_code, body=_response.text)
178
- raise ApiError(status_code=_response.status_code, body=_response_json)
155
+ return response.data
179
156
 
180
157
 
181
158
  class AsyncWorkflowSandboxesClient:
182
159
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
183
- self._client_wrapper = client_wrapper
160
+ self._raw_client = AsyncRawWorkflowSandboxesClient(client_wrapper=client_wrapper)
161
+
162
+ @property
163
+ def with_raw_response(self) -> AsyncRawWorkflowSandboxesClient:
164
+ """
165
+ Retrieves a raw implementation of this client that returns raw responses.
166
+
167
+ Returns
168
+ -------
169
+ AsyncRawWorkflowSandboxesClient
170
+ """
171
+ return self._raw_client
184
172
 
185
173
  async def deploy_workflow(
186
174
  self,
@@ -247,36 +235,17 @@ class AsyncWorkflowSandboxesClient:
247
235
 
248
236
  asyncio.run(main())
249
237
  """
250
- _response = await self._client_wrapper.httpx_client.request(
251
- f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
252
- base_url=self._client_wrapper.get_environment().default,
253
- method="POST",
254
- json={
255
- "workflow_deployment_id": workflow_deployment_id,
256
- "workflow_deployment_name": workflow_deployment_name,
257
- "label": label,
258
- "release_tags": release_tags,
259
- "release_description": release_description,
260
- },
261
- headers={
262
- "content-type": "application/json",
263
- },
238
+ response = await self._raw_client.deploy_workflow(
239
+ id,
240
+ workflow_id,
241
+ workflow_deployment_id=workflow_deployment_id,
242
+ workflow_deployment_name=workflow_deployment_name,
243
+ label=label,
244
+ release_tags=release_tags,
245
+ release_description=release_description,
264
246
  request_options=request_options,
265
- omit=OMIT,
266
247
  )
267
- try:
268
- if 200 <= _response.status_code < 300:
269
- return typing.cast(
270
- WorkflowDeploymentRead,
271
- parse_obj_as(
272
- type_=WorkflowDeploymentRead, # type: ignore
273
- object_=_response.json(),
274
- ),
275
- )
276
- _response_json = _response.json()
277
- except JSONDecodeError:
278
- raise ApiError(status_code=_response.status_code, body=_response.text)
279
- raise ApiError(status_code=_response.status_code, body=_response_json)
248
+ return response.data
280
249
 
281
250
  async def list_workflow_sandbox_examples(
282
251
  self,
@@ -329,28 +298,11 @@ class AsyncWorkflowSandboxesClient:
329
298
 
330
299
  asyncio.run(main())
331
300
  """
332
- _response = await self._client_wrapper.httpx_client.request(
333
- "v1/workflow-sandboxes/examples",
334
- base_url=self._client_wrapper.get_environment().default,
335
- method="GET",
336
- params={
337
- "limit": limit,
338
- "offset": offset,
339
- "ordering": ordering,
340
- "tag": tag,
341
- },
301
+ response = await self._raw_client.list_workflow_sandbox_examples(
302
+ limit=limit,
303
+ offset=offset,
304
+ ordering=ordering,
305
+ tag=tag,
342
306
  request_options=request_options,
343
307
  )
344
- try:
345
- if 200 <= _response.status_code < 300:
346
- return typing.cast(
347
- PaginatedWorkflowSandboxExampleList,
348
- parse_obj_as(
349
- type_=PaginatedWorkflowSandboxExampleList, # type: ignore
350
- object_=_response.json(),
351
- ),
352
- )
353
- _response_json = _response.json()
354
- except JSONDecodeError:
355
- raise ApiError(status_code=_response.status_code, body=_response.text)
356
- raise ApiError(status_code=_response.status_code, body=_response_json)
308
+ return response.data