vellum-ai 1.0.11__py3-none-any.whl → 1.1.1__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.
- vellum/__init__.py +2 -2
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -877
- vellum/client/core/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/http_response.py +47 -0
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +22 -696
- vellum/client/resources/__init__.py +0 -2
- vellum/client/resources/ad_hoc/client.py +55 -161
- vellum/client/resources/ad_hoc/raw_client.py +278 -0
- vellum/client/resources/container_images/client.py +62 -172
- vellum/client/resources/container_images/raw_client.py +400 -0
- vellum/client/resources/deployments/client.py +112 -437
- vellum/client/resources/deployments/raw_client.py +995 -0
- vellum/client/resources/document_indexes/client.py +108 -317
- vellum/client/resources/document_indexes/raw_client.py +847 -0
- vellum/client/resources/documents/client.py +88 -285
- vellum/client/resources/documents/raw_client.py +655 -0
- vellum/client/resources/folder_entities/client.py +54 -92
- vellum/client/resources/folder_entities/raw_client.py +277 -0
- vellum/client/resources/metric_definitions/client.py +48 -95
- vellum/client/resources/metric_definitions/raw_client.py +225 -0
- vellum/client/resources/ml_models/client.py +36 -40
- vellum/client/resources/ml_models/raw_client.py +103 -0
- vellum/client/resources/organizations/client.py +34 -39
- vellum/client/resources/organizations/raw_client.py +96 -0
- vellum/client/resources/prompts/client.py +50 -193
- vellum/client/resources/prompts/raw_client.py +346 -0
- vellum/client/resources/sandboxes/client.py +68 -141
- vellum/client/resources/sandboxes/raw_client.py +393 -0
- vellum/client/resources/test_suite_runs/client.py +58 -141
- vellum/client/resources/test_suite_runs/raw_client.py +355 -0
- vellum/client/resources/test_suites/client.py +73 -141
- vellum/client/resources/test_suites/raw_client.py +379 -0
- vellum/client/resources/workflow_deployments/client.py +203 -328
- vellum/client/resources/workflow_deployments/raw_client.py +931 -0
- vellum/client/resources/workflow_executions/client.py +36 -40
- vellum/client/resources/workflow_executions/raw_client.py +97 -0
- vellum/client/resources/workflow_sandboxes/client.py +60 -108
- vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
- vellum/client/resources/workflows/client.py +68 -133
- vellum/client/resources/workflows/raw_client.py +307 -0
- vellum/client/resources/workspace_secrets/client.py +46 -90
- vellum/client/resources/workspace_secrets/raw_client.py +220 -0
- vellum/client/resources/workspaces/client.py +34 -39
- vellum/client/resources/workspaces/raw_client.py +96 -0
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/api_request_parent_context.py +1 -0
- vellum/client/types/external_parent_context.py +36 -0
- vellum/client/types/node_execution_fulfilled_event.py +1 -0
- vellum/client/types/node_execution_initiated_event.py +1 -0
- vellum/client/types/node_execution_paused_event.py +1 -0
- vellum/client/types/node_execution_rejected_event.py +1 -0
- vellum/client/types/node_execution_resumed_event.py +1 -0
- vellum/client/types/node_execution_span.py +1 -0
- vellum/client/types/node_execution_span_attributes.py +1 -0
- vellum/client/types/node_execution_streaming_event.py +1 -0
- vellum/client/types/node_parent_context.py +1 -0
- vellum/client/types/parent_context.py +2 -0
- vellum/client/types/prompt_deployment_parent_context.py +1 -0
- vellum/client/types/slim_workflow_execution_read.py +1 -0
- vellum/client/types/span_link.py +1 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +1 -0
- vellum/client/types/workflow_deployment_parent_context.py +1 -0
- vellum/client/types/workflow_event_execution_read.py +1 -0
- vellum/client/types/workflow_execution_detail.py +1 -0
- vellum/client/types/workflow_execution_fulfilled_event.py +1 -0
- vellum/client/types/workflow_execution_initiated_event.py +1 -0
- vellum/client/types/workflow_execution_paused_event.py +1 -0
- vellum/client/types/workflow_execution_rejected_event.py +1 -0
- vellum/client/types/workflow_execution_resumed_event.py +1 -0
- vellum/client/types/workflow_execution_snapshotted_event.py +1 -0
- vellum/client/types/workflow_execution_span.py +1 -0
- vellum/client/types/workflow_execution_span_attributes.py +1 -0
- vellum/client/types/workflow_execution_streaming_event.py +1 -0
- vellum/client/types/workflow_parent_context.py +1 -0
- vellum/client/types/workflow_sandbox_parent_context.py +1 -0
- vellum/{resources/release_reviews/__init__.py → core/http_response.py} +1 -1
- vellum/{resources/release_reviews/client.py → raw_client.py} +1 -1
- vellum/resources/ad_hoc/raw_client.py +3 -0
- vellum/resources/container_images/raw_client.py +3 -0
- vellum/resources/deployments/raw_client.py +3 -0
- vellum/resources/document_indexes/raw_client.py +3 -0
- vellum/resources/documents/raw_client.py +3 -0
- vellum/resources/folder_entities/raw_client.py +3 -0
- vellum/resources/metric_definitions/raw_client.py +3 -0
- vellum/resources/ml_models/raw_client.py +3 -0
- vellum/resources/organizations/raw_client.py +3 -0
- vellum/resources/prompts/raw_client.py +3 -0
- vellum/resources/sandboxes/raw_client.py +3 -0
- vellum/resources/test_suite_runs/raw_client.py +3 -0
- vellum/resources/test_suites/raw_client.py +3 -0
- vellum/resources/workflow_deployments/raw_client.py +3 -0
- vellum/resources/workflow_executions/raw_client.py +3 -0
- vellum/resources/workflow_sandboxes/raw_client.py +3 -0
- vellum/resources/workflows/raw_client.py +3 -0
- vellum/resources/workspace_secrets/raw_client.py +3 -0
- vellum/resources/workspaces/raw_client.py +3 -0
- vellum/types/external_parent_context.py +3 -0
- vellum/workflows/emitters/vellum_emitter.py +3 -2
- vellum/workflows/events/types.py +6 -0
- vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +5 -15
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +6 -0
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +75 -0
- vellum/workflows/state/context.py +13 -2
- vellum/workflows/types/definition.py +2 -2
- vellum/workflows/types/tests/test_definition.py +2 -3
- vellum/workflows/utils/functions.py +1 -1
- vellum/workflows/utils/tests/test_functions.py +3 -3
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/RECORD +123 -81
- vellum_ee/workflows/display/exceptions.py +7 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +93 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +98 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py +1 -1
- vellum_ee/workflows/display/utils/expressions.py +1 -1
- vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
- vellum/client/resources/release_reviews/__init__.py +0 -2
- vellum/client/resources/release_reviews/client.py +0 -139
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.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.
|
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
|
-
|
56
|
-
|
67
|
+
Returns
|
68
|
+
-------
|
57
69
|
typing.Iterator[bytes]
|
58
70
|
|
59
71
|
"""
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
)
|
73
|
-
|
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
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
|
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.
|
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
|
-
|
198
|
-
|
176
|
+
Returns
|
177
|
+
-------
|
199
178
|
typing.AsyncIterator[bytes]
|
200
179
|
|
201
180
|
"""
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
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
|
-
)
|
215
|
-
|
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
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
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
|
-
|
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
|