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
@@ -0,0 +1,300 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ...core.client_wrapper import SyncClientWrapper
5
+ from ...core.request_options import RequestOptions
6
+ from ...core.http_response import HttpResponse
7
+ from ...types.workflow_deployment_read import WorkflowDeploymentRead
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 .types.list_workflow_sandbox_examples_request_tag import ListWorkflowSandboxExamplesRequestTag
13
+ from ...types.paginated_workflow_sandbox_example_list import PaginatedWorkflowSandboxExampleList
14
+ from ...core.client_wrapper import AsyncClientWrapper
15
+ from ...core.http_response import AsyncHttpResponse
16
+
17
+ # this is used as the default value for optional parameters
18
+ OMIT = typing.cast(typing.Any, ...)
19
+
20
+
21
+ class RawWorkflowSandboxesClient:
22
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
23
+ self._client_wrapper = client_wrapper
24
+
25
+ def deploy_workflow(
26
+ self,
27
+ id: str,
28
+ workflow_id: str,
29
+ *,
30
+ workflow_deployment_id: typing.Optional[str] = OMIT,
31
+ workflow_deployment_name: typing.Optional[str] = OMIT,
32
+ label: typing.Optional[str] = OMIT,
33
+ release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
34
+ release_description: typing.Optional[str] = OMIT,
35
+ request_options: typing.Optional[RequestOptions] = None,
36
+ ) -> HttpResponse[WorkflowDeploymentRead]:
37
+ """
38
+ Parameters
39
+ ----------
40
+ id : str
41
+ A UUID string identifying this workflow sandbox.
42
+
43
+ workflow_id : str
44
+ An ID identifying the Workflow you'd like to deploy.
45
+
46
+ workflow_deployment_id : typing.Optional[str]
47
+ The Vellum-generated ID of the Workflow Deployment you'd like to update. Cannot specify both this and workflow_deployment_name. Leave null to create a new Workflow Deployment.
48
+
49
+ workflow_deployment_name : typing.Optional[str]
50
+ The unique name of the Workflow Deployment you'd like to either create or update. Cannot specify both this and workflow_deployment_id. If provided and matches an existing Workflow Deployment, that Workflow Deployment will be updated. Otherwise, a new Prompt Deployment will be created.
51
+
52
+ label : typing.Optional[str]
53
+ In the event that a new Workflow Deployment is created, this will be the label it's given.
54
+
55
+ release_tags : typing.Optional[typing.Sequence[str]]
56
+ Optionally provide the release tags that you'd like to be associated with the latest release of the created/updated Prompt Deployment.
57
+
58
+ release_description : typing.Optional[str]
59
+ Optionally provide a description that details what's new in this Release.
60
+
61
+ request_options : typing.Optional[RequestOptions]
62
+ Request-specific configuration.
63
+
64
+ Returns
65
+ -------
66
+ HttpResponse[WorkflowDeploymentRead]
67
+
68
+ """
69
+ _response = self._client_wrapper.httpx_client.request(
70
+ f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
71
+ base_url=self._client_wrapper.get_environment().default,
72
+ method="POST",
73
+ json={
74
+ "workflow_deployment_id": workflow_deployment_id,
75
+ "workflow_deployment_name": workflow_deployment_name,
76
+ "label": label,
77
+ "release_tags": release_tags,
78
+ "release_description": release_description,
79
+ },
80
+ headers={
81
+ "content-type": "application/json",
82
+ },
83
+ request_options=request_options,
84
+ omit=OMIT,
85
+ )
86
+ try:
87
+ if 200 <= _response.status_code < 300:
88
+ _data = typing.cast(
89
+ WorkflowDeploymentRead,
90
+ parse_obj_as(
91
+ type_=WorkflowDeploymentRead, # type: ignore
92
+ object_=_response.json(),
93
+ ),
94
+ )
95
+ return HttpResponse(response=_response, data=_data)
96
+ _response_json = _response.json()
97
+ except JSONDecodeError:
98
+ raise ApiError(status_code=_response.status_code, body=_response.text)
99
+ raise ApiError(status_code=_response.status_code, body=_response_json)
100
+
101
+ def list_workflow_sandbox_examples(
102
+ self,
103
+ *,
104
+ limit: typing.Optional[int] = None,
105
+ offset: typing.Optional[int] = None,
106
+ ordering: typing.Optional[str] = None,
107
+ tag: typing.Optional[ListWorkflowSandboxExamplesRequestTag] = None,
108
+ request_options: typing.Optional[RequestOptions] = None,
109
+ ) -> HttpResponse[PaginatedWorkflowSandboxExampleList]:
110
+ """
111
+ List Workflow Sandbox examples that were previously cloned into the User's Workspace
112
+
113
+ Parameters
114
+ ----------
115
+ limit : typing.Optional[int]
116
+ Number of results to return per page.
117
+
118
+ offset : typing.Optional[int]
119
+ The initial index from which to return the results.
120
+
121
+ ordering : typing.Optional[str]
122
+ Which field to use when ordering the results.
123
+
124
+ tag : typing.Optional[ListWorkflowSandboxExamplesRequestTag]
125
+
126
+ request_options : typing.Optional[RequestOptions]
127
+ Request-specific configuration.
128
+
129
+ Returns
130
+ -------
131
+ HttpResponse[PaginatedWorkflowSandboxExampleList]
132
+
133
+ """
134
+ _response = self._client_wrapper.httpx_client.request(
135
+ "v1/workflow-sandboxes/examples",
136
+ base_url=self._client_wrapper.get_environment().default,
137
+ method="GET",
138
+ params={
139
+ "limit": limit,
140
+ "offset": offset,
141
+ "ordering": ordering,
142
+ "tag": tag,
143
+ },
144
+ request_options=request_options,
145
+ )
146
+ try:
147
+ if 200 <= _response.status_code < 300:
148
+ _data = typing.cast(
149
+ PaginatedWorkflowSandboxExampleList,
150
+ parse_obj_as(
151
+ type_=PaginatedWorkflowSandboxExampleList, # type: ignore
152
+ object_=_response.json(),
153
+ ),
154
+ )
155
+ return HttpResponse(response=_response, data=_data)
156
+ _response_json = _response.json()
157
+ except JSONDecodeError:
158
+ raise ApiError(status_code=_response.status_code, body=_response.text)
159
+ raise ApiError(status_code=_response.status_code, body=_response_json)
160
+
161
+
162
+ class AsyncRawWorkflowSandboxesClient:
163
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
164
+ self._client_wrapper = client_wrapper
165
+
166
+ async def deploy_workflow(
167
+ self,
168
+ id: str,
169
+ workflow_id: str,
170
+ *,
171
+ workflow_deployment_id: typing.Optional[str] = OMIT,
172
+ workflow_deployment_name: typing.Optional[str] = OMIT,
173
+ label: typing.Optional[str] = OMIT,
174
+ release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
175
+ release_description: typing.Optional[str] = OMIT,
176
+ request_options: typing.Optional[RequestOptions] = None,
177
+ ) -> AsyncHttpResponse[WorkflowDeploymentRead]:
178
+ """
179
+ Parameters
180
+ ----------
181
+ id : str
182
+ A UUID string identifying this workflow sandbox.
183
+
184
+ workflow_id : str
185
+ An ID identifying the Workflow you'd like to deploy.
186
+
187
+ workflow_deployment_id : typing.Optional[str]
188
+ The Vellum-generated ID of the Workflow Deployment you'd like to update. Cannot specify both this and workflow_deployment_name. Leave null to create a new Workflow Deployment.
189
+
190
+ workflow_deployment_name : typing.Optional[str]
191
+ The unique name of the Workflow Deployment you'd like to either create or update. Cannot specify both this and workflow_deployment_id. If provided and matches an existing Workflow Deployment, that Workflow Deployment will be updated. Otherwise, a new Prompt Deployment will be created.
192
+
193
+ label : typing.Optional[str]
194
+ In the event that a new Workflow Deployment is created, this will be the label it's given.
195
+
196
+ release_tags : typing.Optional[typing.Sequence[str]]
197
+ Optionally provide the release tags that you'd like to be associated with the latest release of the created/updated Prompt Deployment.
198
+
199
+ release_description : typing.Optional[str]
200
+ Optionally provide a description that details what's new in this Release.
201
+
202
+ request_options : typing.Optional[RequestOptions]
203
+ Request-specific configuration.
204
+
205
+ Returns
206
+ -------
207
+ AsyncHttpResponse[WorkflowDeploymentRead]
208
+
209
+ """
210
+ _response = await self._client_wrapper.httpx_client.request(
211
+ f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
212
+ base_url=self._client_wrapper.get_environment().default,
213
+ method="POST",
214
+ json={
215
+ "workflow_deployment_id": workflow_deployment_id,
216
+ "workflow_deployment_name": workflow_deployment_name,
217
+ "label": label,
218
+ "release_tags": release_tags,
219
+ "release_description": release_description,
220
+ },
221
+ headers={
222
+ "content-type": "application/json",
223
+ },
224
+ request_options=request_options,
225
+ omit=OMIT,
226
+ )
227
+ try:
228
+ if 200 <= _response.status_code < 300:
229
+ _data = typing.cast(
230
+ WorkflowDeploymentRead,
231
+ parse_obj_as(
232
+ type_=WorkflowDeploymentRead, # type: ignore
233
+ object_=_response.json(),
234
+ ),
235
+ )
236
+ return AsyncHttpResponse(response=_response, data=_data)
237
+ _response_json = _response.json()
238
+ except JSONDecodeError:
239
+ raise ApiError(status_code=_response.status_code, body=_response.text)
240
+ raise ApiError(status_code=_response.status_code, body=_response_json)
241
+
242
+ async def list_workflow_sandbox_examples(
243
+ self,
244
+ *,
245
+ limit: typing.Optional[int] = None,
246
+ offset: typing.Optional[int] = None,
247
+ ordering: typing.Optional[str] = None,
248
+ tag: typing.Optional[ListWorkflowSandboxExamplesRequestTag] = None,
249
+ request_options: typing.Optional[RequestOptions] = None,
250
+ ) -> AsyncHttpResponse[PaginatedWorkflowSandboxExampleList]:
251
+ """
252
+ List Workflow Sandbox examples that were previously cloned into the User's Workspace
253
+
254
+ Parameters
255
+ ----------
256
+ limit : typing.Optional[int]
257
+ Number of results to return per page.
258
+
259
+ offset : typing.Optional[int]
260
+ The initial index from which to return the results.
261
+
262
+ ordering : typing.Optional[str]
263
+ Which field to use when ordering the results.
264
+
265
+ tag : typing.Optional[ListWorkflowSandboxExamplesRequestTag]
266
+
267
+ request_options : typing.Optional[RequestOptions]
268
+ Request-specific configuration.
269
+
270
+ Returns
271
+ -------
272
+ AsyncHttpResponse[PaginatedWorkflowSandboxExampleList]
273
+
274
+ """
275
+ _response = await self._client_wrapper.httpx_client.request(
276
+ "v1/workflow-sandboxes/examples",
277
+ base_url=self._client_wrapper.get_environment().default,
278
+ method="GET",
279
+ params={
280
+ "limit": limit,
281
+ "offset": offset,
282
+ "ordering": ordering,
283
+ "tag": tag,
284
+ },
285
+ request_options=request_options,
286
+ )
287
+ try:
288
+ if 200 <= _response.status_code < 300:
289
+ _data = typing.cast(
290
+ PaginatedWorkflowSandboxExampleList,
291
+ parse_obj_as(
292
+ type_=PaginatedWorkflowSandboxExampleList, # type: ignore
293
+ object_=_response.json(),
294
+ ),
295
+ )
296
+ return AsyncHttpResponse(response=_response, data=_data)
297
+ _response_json = _response.json()
298
+ except JSONDecodeError:
299
+ raise ApiError(status_code=_response.status_code, body=_response.text)
300
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -2,17 +2,14 @@
2
2
 
3
3
  import typing
4
4
  from ...core.client_wrapper import SyncClientWrapper
5
+ from .raw_client import RawWorkflowsClient
5
6
  from ...core.request_options import RequestOptions
6
- from ...core.jsonable_encoder import jsonable_encoder
7
- from ...errors.bad_request_error import BadRequestError
8
- from ...core.pydantic_utilities import parse_obj_as
9
- from json.decoder import JSONDecodeError
10
- from ...core.api_error import ApiError
11
7
  from ...types.workflow_push_exec_config import WorkflowPushExecConfig
12
8
  from ...types.workflow_push_deployment_config_request import WorkflowPushDeploymentConfigRequest
13
9
  from ... import core
14
10
  from ...types.workflow_push_response import WorkflowPushResponse
15
11
  from ...core.client_wrapper import AsyncClientWrapper
12
+ from .raw_client import AsyncRawWorkflowsClient
16
13
 
17
14
  # this is used as the default value for optional parameters
18
15
  OMIT = typing.cast(typing.Any, ...)
@@ -20,7 +17,22 @@ OMIT = typing.cast(typing.Any, ...)
20
17
 
21
18
  class WorkflowsClient:
22
19
  def __init__(self, *, client_wrapper: SyncClientWrapper):
23
- self._client_wrapper = client_wrapper
20
+ self._raw_client = RawWorkflowsClient(client_wrapper=client_wrapper)
21
+
22
+ @property
23
+ def _client_wrapper(self) -> SyncClientWrapper:
24
+ return self._raw_client._client_wrapper
25
+
26
+ @property
27
+ def with_raw_response(self) -> RawWorkflowsClient:
28
+ """
29
+ Retrieves a raw implementation of this client that returns raw responses.
30
+
31
+ Returns
32
+ -------
33
+ RawWorkflowsClient
34
+ """
35
+ return self._raw_client
24
36
 
25
37
  def pull(
26
38
  self,
@@ -52,45 +64,21 @@ class WorkflowsClient:
52
64
  request_options : typing.Optional[RequestOptions]
53
65
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
54
66
 
55
- Yields
56
- ------
67
+ Returns
68
+ -------
57
69
  typing.Iterator[bytes]
58
70
 
59
71
  """
60
- with self._client_wrapper.httpx_client.stream(
61
- f"v1/workflows/{jsonable_encoder(id)}/pull",
62
- base_url=self._client_wrapper.get_environment().default,
63
- method="GET",
64
- params={
65
- "exclude_code": exclude_code,
66
- "exclude_display": exclude_display,
67
- "include_json": include_json,
68
- "include_sandbox": include_sandbox,
69
- "strict": strict,
70
- },
72
+ response = self._raw_client.pull(
73
+ id,
74
+ exclude_code=exclude_code,
75
+ exclude_display=exclude_display,
76
+ include_json=include_json,
77
+ include_sandbox=include_sandbox,
78
+ strict=strict,
71
79
  request_options=request_options,
72
- ) as _response:
73
- try:
74
- if 200 <= _response.status_code < 300:
75
- _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
76
- for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
77
- yield _chunk
78
- return
79
- _response.read()
80
- if _response.status_code == 400:
81
- raise BadRequestError(
82
- typing.cast(
83
- typing.Optional[typing.Any],
84
- parse_obj_as(
85
- type_=typing.Optional[typing.Any], # type: ignore
86
- object_=_response.json(),
87
- ),
88
- )
89
- )
90
- _response_json = _response.json()
91
- except JSONDecodeError:
92
- raise ApiError(status_code=_response.status_code, body=_response.text)
93
- raise ApiError(status_code=_response.status_code, body=_response_json)
80
+ )
81
+ return response.data
94
82
 
95
83
  def push(
96
84
  self,
@@ -128,41 +116,32 @@ class WorkflowsClient:
128
116
  WorkflowPushResponse
129
117
 
130
118
  """
131
- _response = self._client_wrapper.httpx_client.request(
132
- "v1/workflows/push",
133
- base_url=self._client_wrapper.get_environment().default,
134
- method="POST",
135
- data={
136
- "exec_config": exec_config,
137
- "workflow_sandbox_id": workflow_sandbox_id,
138
- "deployment_config": deployment_config,
139
- "dry_run": dry_run,
140
- "strict": strict,
141
- },
142
- files={
143
- "artifact": artifact,
144
- },
119
+ response = self._raw_client.push(
120
+ exec_config=exec_config,
121
+ workflow_sandbox_id=workflow_sandbox_id,
122
+ deployment_config=deployment_config,
123
+ artifact=artifact,
124
+ dry_run=dry_run,
125
+ strict=strict,
145
126
  request_options=request_options,
146
- omit=OMIT,
147
127
  )
148
- try:
149
- if 200 <= _response.status_code < 300:
150
- return typing.cast(
151
- WorkflowPushResponse,
152
- parse_obj_as(
153
- type_=WorkflowPushResponse, # type: ignore
154
- object_=_response.json(),
155
- ),
156
- )
157
- _response_json = _response.json()
158
- except JSONDecodeError:
159
- raise ApiError(status_code=_response.status_code, body=_response.text)
160
- raise ApiError(status_code=_response.status_code, body=_response_json)
128
+ return response.data
161
129
 
162
130
 
163
131
  class AsyncWorkflowsClient:
164
132
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
165
- self._client_wrapper = client_wrapper
133
+ self._raw_client = AsyncRawWorkflowsClient(client_wrapper=client_wrapper)
134
+
135
+ @property
136
+ def with_raw_response(self) -> AsyncRawWorkflowsClient:
137
+ """
138
+ Retrieves a raw implementation of this client that returns raw responses.
139
+
140
+ Returns
141
+ -------
142
+ AsyncRawWorkflowsClient
143
+ """
144
+ return self._raw_client
166
145
 
167
146
  async def pull(
168
147
  self,
@@ -194,45 +173,21 @@ class AsyncWorkflowsClient:
194
173
  request_options : typing.Optional[RequestOptions]
195
174
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
196
175
 
197
- Yields
198
- ------
176
+ Returns
177
+ -------
199
178
  typing.AsyncIterator[bytes]
200
179
 
201
180
  """
202
- async with self._client_wrapper.httpx_client.stream(
203
- f"v1/workflows/{jsonable_encoder(id)}/pull",
204
- base_url=self._client_wrapper.get_environment().default,
205
- method="GET",
206
- params={
207
- "exclude_code": exclude_code,
208
- "exclude_display": exclude_display,
209
- "include_json": include_json,
210
- "include_sandbox": include_sandbox,
211
- "strict": strict,
212
- },
181
+ response = await self._raw_client.pull(
182
+ id,
183
+ exclude_code=exclude_code,
184
+ exclude_display=exclude_display,
185
+ include_json=include_json,
186
+ include_sandbox=include_sandbox,
187
+ strict=strict,
213
188
  request_options=request_options,
214
- ) as _response:
215
- try:
216
- if 200 <= _response.status_code < 300:
217
- _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
218
- async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
219
- yield _chunk
220
- return
221
- await _response.aread()
222
- if _response.status_code == 400:
223
- raise BadRequestError(
224
- typing.cast(
225
- typing.Optional[typing.Any],
226
- parse_obj_as(
227
- type_=typing.Optional[typing.Any], # type: ignore
228
- object_=_response.json(),
229
- ),
230
- )
231
- )
232
- _response_json = _response.json()
233
- except JSONDecodeError:
234
- raise ApiError(status_code=_response.status_code, body=_response.text)
235
- raise ApiError(status_code=_response.status_code, body=_response_json)
189
+ )
190
+ return response.data
236
191
 
237
192
  async def push(
238
193
  self,
@@ -270,33 +225,13 @@ class AsyncWorkflowsClient:
270
225
  WorkflowPushResponse
271
226
 
272
227
  """
273
- _response = await self._client_wrapper.httpx_client.request(
274
- "v1/workflows/push",
275
- base_url=self._client_wrapper.get_environment().default,
276
- method="POST",
277
- data={
278
- "exec_config": exec_config,
279
- "workflow_sandbox_id": workflow_sandbox_id,
280
- "deployment_config": deployment_config,
281
- "dry_run": dry_run,
282
- "strict": strict,
283
- },
284
- files={
285
- "artifact": artifact,
286
- },
228
+ response = await self._raw_client.push(
229
+ exec_config=exec_config,
230
+ workflow_sandbox_id=workflow_sandbox_id,
231
+ deployment_config=deployment_config,
232
+ artifact=artifact,
233
+ dry_run=dry_run,
234
+ strict=strict,
287
235
  request_options=request_options,
288
- omit=OMIT,
289
236
  )
290
- try:
291
- if 200 <= _response.status_code < 300:
292
- return typing.cast(
293
- WorkflowPushResponse,
294
- parse_obj_as(
295
- type_=WorkflowPushResponse, # type: ignore
296
- object_=_response.json(),
297
- ),
298
- )
299
- _response_json = _response.json()
300
- except JSONDecodeError:
301
- raise ApiError(status_code=_response.status_code, body=_response.text)
302
- raise ApiError(status_code=_response.status_code, body=_response_json)
237
+ return response.data