vellum-ai 0.6.0__py3-none-any.whl → 0.6.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +20 -0
- vellum/client.py +3 -0
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/__init__.py +2 -0
- vellum/resources/deployments/client.py +416 -0
- vellum/resources/prompt_versions/__init__.py +2 -0
- vellum/resources/prompt_versions/client.py +192 -0
- vellum/resources/workflow_deployments/client.py +252 -0
- vellum/types/__init__.py +18 -0
- vellum/types/deployment_release_tag_deployment_history_item.py +26 -0
- vellum/types/deployment_release_tag_read.py +43 -0
- vellum/types/merge_enum.py +5 -0
- vellum/types/merge_node_result.py +27 -0
- vellum/types/release_tag_source.py +5 -0
- vellum/types/search_result_document.py +1 -1
- vellum/types/search_result_document_request.py +5 -0
- vellum/types/submit_completion_actual_request.py +5 -0
- vellum/types/subworkflow_node_result.py +3 -0
- vellum/types/subworkflow_node_result_data.py +25 -0
- vellum/types/workflow_node_result_data.py +12 -0
- vellum/types/workflow_release_tag_read.py +43 -0
- vellum/types/workflow_release_tag_workflow_deployment_history_item.py +33 -0
- {vellum_ai-0.6.0.dist-info → vellum_ai-0.6.2.dist-info}/METADATA +2 -3
- {vellum_ai-0.6.0.dist-info → vellum_ai-0.6.2.dist-info}/RECORD +26 -16
- {vellum_ai-0.6.0.dist-info → vellum_ai-0.6.2.dist-info}/LICENSE +0 -0
- {vellum_ai-0.6.0.dist-info → vellum_ai-0.6.2.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -73,6 +73,8 @@ from .types import (
|
|
73
73
|
ConditionalNodeResultData,
|
74
74
|
DeploymentProviderPayloadResponse,
|
75
75
|
DeploymentRead,
|
76
|
+
DeploymentReleaseTagDeploymentHistoryItem,
|
77
|
+
DeploymentReleaseTagRead,
|
76
78
|
DocumentDocumentToDocumentIndex,
|
77
79
|
DocumentIndexChunking,
|
78
80
|
DocumentIndexChunkingRequest,
|
@@ -191,6 +193,8 @@ from .types import (
|
|
191
193
|
JsonVellumValue,
|
192
194
|
LogicalOperator,
|
193
195
|
LogprobsEnum,
|
196
|
+
MergeEnum,
|
197
|
+
MergeNodeResult,
|
194
198
|
MetadataFilterConfigRequest,
|
195
199
|
MetadataFilterRuleCombinator,
|
196
200
|
MetadataFilterRuleRequest,
|
@@ -312,6 +316,7 @@ from .types import (
|
|
312
316
|
RejectedExecuteWorkflowWorkflowResultEvent,
|
313
317
|
RejectedPromptExecutionMeta,
|
314
318
|
RejectedWorkflowNodeResultEvent,
|
319
|
+
ReleaseTagSource,
|
315
320
|
SandboxScenario,
|
316
321
|
ScenarioInput,
|
317
322
|
ScenarioInputChatHistoryVariableValue,
|
@@ -359,6 +364,7 @@ from .types import (
|
|
359
364
|
SubmitWorkflowExecutionActualRequest_String,
|
360
365
|
SubworkflowEnum,
|
361
366
|
SubworkflowNodeResult,
|
367
|
+
SubworkflowNodeResultData,
|
362
368
|
TemplatingNodeArrayResult,
|
363
369
|
TemplatingNodeChatHistoryResult,
|
364
370
|
TemplatingNodeErrorResult,
|
@@ -497,6 +503,7 @@ from .types import (
|
|
497
503
|
WorkflowNodeResultData_Api,
|
498
504
|
WorkflowNodeResultData_CodeExecution,
|
499
505
|
WorkflowNodeResultData_Conditional,
|
506
|
+
WorkflowNodeResultData_Merge,
|
500
507
|
WorkflowNodeResultData_Metric,
|
501
508
|
WorkflowNodeResultData_Prompt,
|
502
509
|
WorkflowNodeResultData_Search,
|
@@ -528,6 +535,8 @@ from .types import (
|
|
528
535
|
WorkflowOutput_Number,
|
529
536
|
WorkflowOutput_SearchResults,
|
530
537
|
WorkflowOutput_String,
|
538
|
+
WorkflowReleaseTagRead,
|
539
|
+
WorkflowReleaseTagWorkflowDeploymentHistoryItem,
|
531
540
|
WorkflowRequestChatHistoryInputRequest,
|
532
541
|
WorkflowRequestInputRequest,
|
533
542
|
WorkflowRequestInputRequest_ChatHistory,
|
@@ -568,6 +577,7 @@ from .resources import (
|
|
568
577
|
document_indexes,
|
569
578
|
documents,
|
570
579
|
folder_entities,
|
580
|
+
prompt_versions,
|
571
581
|
sandboxes,
|
572
582
|
test_suite_runs,
|
573
583
|
test_suites,
|
@@ -650,6 +660,8 @@ __all__ = [
|
|
650
660
|
"ConditionalNodeResultData",
|
651
661
|
"DeploymentProviderPayloadResponse",
|
652
662
|
"DeploymentRead",
|
663
|
+
"DeploymentReleaseTagDeploymentHistoryItem",
|
664
|
+
"DeploymentReleaseTagRead",
|
653
665
|
"DeploymentsListRequestStatus",
|
654
666
|
"DocumentDocumentToDocumentIndex",
|
655
667
|
"DocumentIndexChunking",
|
@@ -772,6 +784,8 @@ __all__ = [
|
|
772
784
|
"JsonVellumValue",
|
773
785
|
"LogicalOperator",
|
774
786
|
"LogprobsEnum",
|
787
|
+
"MergeEnum",
|
788
|
+
"MergeNodeResult",
|
775
789
|
"MetadataFilterConfigRequest",
|
776
790
|
"MetadataFilterRuleCombinator",
|
777
791
|
"MetadataFilterRuleRequest",
|
@@ -894,6 +908,7 @@ __all__ = [
|
|
894
908
|
"RejectedExecuteWorkflowWorkflowResultEvent",
|
895
909
|
"RejectedPromptExecutionMeta",
|
896
910
|
"RejectedWorkflowNodeResultEvent",
|
911
|
+
"ReleaseTagSource",
|
897
912
|
"SandboxScenario",
|
898
913
|
"ScenarioInput",
|
899
914
|
"ScenarioInputChatHistoryVariableValue",
|
@@ -941,6 +956,7 @@ __all__ = [
|
|
941
956
|
"SubmitWorkflowExecutionActualRequest_String",
|
942
957
|
"SubworkflowEnum",
|
943
958
|
"SubworkflowNodeResult",
|
959
|
+
"SubworkflowNodeResultData",
|
944
960
|
"TemplatingNodeArrayResult",
|
945
961
|
"TemplatingNodeChatHistoryResult",
|
946
962
|
"TemplatingNodeErrorResult",
|
@@ -1081,6 +1097,7 @@ __all__ = [
|
|
1081
1097
|
"WorkflowNodeResultData_Api",
|
1082
1098
|
"WorkflowNodeResultData_CodeExecution",
|
1083
1099
|
"WorkflowNodeResultData_Conditional",
|
1100
|
+
"WorkflowNodeResultData_Merge",
|
1084
1101
|
"WorkflowNodeResultData_Metric",
|
1085
1102
|
"WorkflowNodeResultData_Prompt",
|
1086
1103
|
"WorkflowNodeResultData_Search",
|
@@ -1112,6 +1129,8 @@ __all__ = [
|
|
1112
1129
|
"WorkflowOutput_Number",
|
1113
1130
|
"WorkflowOutput_SearchResults",
|
1114
1131
|
"WorkflowOutput_String",
|
1132
|
+
"WorkflowReleaseTagRead",
|
1133
|
+
"WorkflowReleaseTagWorkflowDeploymentHistoryItem",
|
1115
1134
|
"WorkflowRequestChatHistoryInputRequest",
|
1116
1135
|
"WorkflowRequestInputRequest",
|
1117
1136
|
"WorkflowRequestInputRequest_ChatHistory",
|
@@ -1147,6 +1166,7 @@ __all__ = [
|
|
1147
1166
|
"document_indexes",
|
1148
1167
|
"documents",
|
1149
1168
|
"folder_entities",
|
1169
|
+
"prompt_versions",
|
1150
1170
|
"sandboxes",
|
1151
1171
|
"test_suite_runs",
|
1152
1172
|
"test_suites",
|
vellum/client.py
CHANGED
@@ -22,6 +22,7 @@ from .resources.deployments.client import AsyncDeploymentsClient, DeploymentsCli
|
|
22
22
|
from .resources.document_indexes.client import AsyncDocumentIndexesClient, DocumentIndexesClient
|
23
23
|
from .resources.documents.client import AsyncDocumentsClient, DocumentsClient
|
24
24
|
from .resources.folder_entities.client import AsyncFolderEntitiesClient, FolderEntitiesClient
|
25
|
+
from .resources.prompt_versions.client import AsyncPromptVersionsClient, PromptVersionsClient
|
25
26
|
from .resources.sandboxes.client import AsyncSandboxesClient, SandboxesClient
|
26
27
|
from .resources.test_suite_runs.client import AsyncTestSuiteRunsClient, TestSuiteRunsClient
|
27
28
|
from .resources.test_suites.client import AsyncTestSuitesClient, TestSuitesClient
|
@@ -96,6 +97,7 @@ class Vellum:
|
|
96
97
|
self.document_indexes = DocumentIndexesClient(client_wrapper=self._client_wrapper)
|
97
98
|
self.documents = DocumentsClient(client_wrapper=self._client_wrapper)
|
98
99
|
self.folder_entities = FolderEntitiesClient(client_wrapper=self._client_wrapper)
|
100
|
+
self.prompt_versions = PromptVersionsClient(client_wrapper=self._client_wrapper)
|
99
101
|
self.sandboxes = SandboxesClient(client_wrapper=self._client_wrapper)
|
100
102
|
self.test_suite_runs = TestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
101
103
|
self.test_suites = TestSuitesClient(client_wrapper=self._client_wrapper)
|
@@ -1058,6 +1060,7 @@ class AsyncVellum:
|
|
1058
1060
|
self.document_indexes = AsyncDocumentIndexesClient(client_wrapper=self._client_wrapper)
|
1059
1061
|
self.documents = AsyncDocumentsClient(client_wrapper=self._client_wrapper)
|
1060
1062
|
self.folder_entities = AsyncFolderEntitiesClient(client_wrapper=self._client_wrapper)
|
1063
|
+
self.prompt_versions = AsyncPromptVersionsClient(client_wrapper=self._client_wrapper)
|
1061
1064
|
self.sandboxes = AsyncSandboxesClient(client_wrapper=self._client_wrapper)
|
1062
1065
|
self.test_suite_runs = AsyncTestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
1063
1066
|
self.test_suites = AsyncTestSuitesClient(client_wrapper=self._client_wrapper)
|
vellum/core/client_wrapper.py
CHANGED
vellum/resources/__init__.py
CHANGED
@@ -5,6 +5,7 @@ from . import (
|
|
5
5
|
document_indexes,
|
6
6
|
documents,
|
7
7
|
folder_entities,
|
8
|
+
prompt_versions,
|
8
9
|
sandboxes,
|
9
10
|
test_suite_runs,
|
10
11
|
test_suites,
|
@@ -22,6 +23,7 @@ __all__ = [
|
|
22
23
|
"document_indexes",
|
23
24
|
"documents",
|
24
25
|
"folder_entities",
|
26
|
+
"prompt_versions",
|
25
27
|
"sandboxes",
|
26
28
|
"test_suite_runs",
|
27
29
|
"test_suites",
|
@@ -16,8 +16,10 @@ from ...errors.internal_server_error import InternalServerError
|
|
16
16
|
from ...errors.not_found_error import NotFoundError
|
17
17
|
from ...types.deployment_provider_payload_response import DeploymentProviderPayloadResponse
|
18
18
|
from ...types.deployment_read import DeploymentRead
|
19
|
+
from ...types.deployment_release_tag_read import DeploymentReleaseTagRead
|
19
20
|
from ...types.paginated_slim_deployment_read_list import PaginatedSlimDeploymentReadList
|
20
21
|
from ...types.prompt_deployment_input_request import PromptDeploymentInputRequest
|
22
|
+
from ...types.workflow_deployment_read import WorkflowDeploymentRead
|
21
23
|
from .types.deployments_list_request_status import DeploymentsListRequestStatus
|
22
24
|
|
23
25
|
# this is used as the default value for optional parameters
|
@@ -144,6 +146,130 @@ class DeploymentsClient:
|
|
144
146
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
145
147
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
146
148
|
|
149
|
+
def retrieve_deployment_release_tag(
|
150
|
+
self, id: str, name: str, *, request_options: typing.Optional[RequestOptions] = None
|
151
|
+
) -> DeploymentReleaseTagRead:
|
152
|
+
"""
|
153
|
+
Retrieve a Deployment Release Tag by tag name, associated with a specified Deployment.
|
154
|
+
|
155
|
+
Parameters:
|
156
|
+
- id: str. A UUID string identifying this deployment.
|
157
|
+
|
158
|
+
- name: str. The name of the Release Tag associated with this Deployment that you'd like to retrieve.
|
159
|
+
|
160
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
161
|
+
---
|
162
|
+
from vellum.client import Vellum
|
163
|
+
|
164
|
+
client = Vellum(
|
165
|
+
api_key="YOUR_API_KEY",
|
166
|
+
)
|
167
|
+
client.deployments.retrieve_deployment_release_tag(
|
168
|
+
id="id",
|
169
|
+
name="name",
|
170
|
+
)
|
171
|
+
"""
|
172
|
+
_response = self._client_wrapper.httpx_client.request(
|
173
|
+
method="GET",
|
174
|
+
url=urllib.parse.urljoin(
|
175
|
+
f"{self._client_wrapper.get_environment().default}/",
|
176
|
+
f"v1/deployments/{jsonable_encoder(id)}/release-tags/{jsonable_encoder(name)}",
|
177
|
+
),
|
178
|
+
params=jsonable_encoder(
|
179
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
180
|
+
),
|
181
|
+
headers=jsonable_encoder(
|
182
|
+
remove_none_from_dict(
|
183
|
+
{
|
184
|
+
**self._client_wrapper.get_headers(),
|
185
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
186
|
+
}
|
187
|
+
)
|
188
|
+
),
|
189
|
+
timeout=request_options.get("timeout_in_seconds")
|
190
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
191
|
+
else self._client_wrapper.get_timeout(),
|
192
|
+
retries=0,
|
193
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
194
|
+
)
|
195
|
+
if 200 <= _response.status_code < 300:
|
196
|
+
return pydantic_v1.parse_obj_as(DeploymentReleaseTagRead, _response.json()) # type: ignore
|
197
|
+
try:
|
198
|
+
_response_json = _response.json()
|
199
|
+
except JSONDecodeError:
|
200
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
201
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
202
|
+
|
203
|
+
def update_deployment_release_tag(
|
204
|
+
self,
|
205
|
+
id: str,
|
206
|
+
name: str,
|
207
|
+
*,
|
208
|
+
history_item_id: typing.Optional[str] = OMIT,
|
209
|
+
request_options: typing.Optional[RequestOptions] = None,
|
210
|
+
) -> DeploymentReleaseTagRead:
|
211
|
+
"""
|
212
|
+
Updates an existing Release Tag associated with the specified Deployment.
|
213
|
+
|
214
|
+
Parameters:
|
215
|
+
- id: str. A UUID string identifying this deployment.
|
216
|
+
|
217
|
+
- name: str. The name of the Release Tag associated with this Deployment that you'd like to update.
|
218
|
+
|
219
|
+
- history_item_id: typing.Optional[str]. The ID of the Deployment History Item to tag
|
220
|
+
|
221
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
222
|
+
---
|
223
|
+
from vellum.client import Vellum
|
224
|
+
|
225
|
+
client = Vellum(
|
226
|
+
api_key="YOUR_API_KEY",
|
227
|
+
)
|
228
|
+
client.deployments.update_deployment_release_tag(
|
229
|
+
id="id",
|
230
|
+
name="name",
|
231
|
+
)
|
232
|
+
"""
|
233
|
+
_request: typing.Dict[str, typing.Any] = {}
|
234
|
+
if history_item_id is not OMIT:
|
235
|
+
_request["history_item_id"] = history_item_id
|
236
|
+
_response = self._client_wrapper.httpx_client.request(
|
237
|
+
method="PATCH",
|
238
|
+
url=urllib.parse.urljoin(
|
239
|
+
f"{self._client_wrapper.get_environment().default}/",
|
240
|
+
f"v1/deployments/{jsonable_encoder(id)}/release-tags/{jsonable_encoder(name)}",
|
241
|
+
),
|
242
|
+
params=jsonable_encoder(
|
243
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
244
|
+
),
|
245
|
+
json=jsonable_encoder(_request)
|
246
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
247
|
+
else {
|
248
|
+
**jsonable_encoder(_request),
|
249
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
250
|
+
},
|
251
|
+
headers=jsonable_encoder(
|
252
|
+
remove_none_from_dict(
|
253
|
+
{
|
254
|
+
**self._client_wrapper.get_headers(),
|
255
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
256
|
+
}
|
257
|
+
)
|
258
|
+
),
|
259
|
+
timeout=request_options.get("timeout_in_seconds")
|
260
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
261
|
+
else self._client_wrapper.get_timeout(),
|
262
|
+
retries=0,
|
263
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
264
|
+
)
|
265
|
+
if 200 <= _response.status_code < 300:
|
266
|
+
return pydantic_v1.parse_obj_as(DeploymentReleaseTagRead, _response.json()) # type: ignore
|
267
|
+
try:
|
268
|
+
_response_json = _response.json()
|
269
|
+
except JSONDecodeError:
|
270
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
271
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
272
|
+
|
147
273
|
def retrieve_provider_payload(
|
148
274
|
self,
|
149
275
|
*,
|
@@ -225,6 +351,89 @@ class DeploymentsClient:
|
|
225
351
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
226
352
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
227
353
|
|
354
|
+
def deploy_workflow(
|
355
|
+
self,
|
356
|
+
id: str,
|
357
|
+
workflow_id: str,
|
358
|
+
*,
|
359
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
360
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
361
|
+
label: typing.Optional[str] = OMIT,
|
362
|
+
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
363
|
+
request_options: typing.Optional[RequestOptions] = None,
|
364
|
+
) -> WorkflowDeploymentRead:
|
365
|
+
"""
|
366
|
+
Parameters:
|
367
|
+
- id: str. A UUID string identifying this workflow sandbox.
|
368
|
+
|
369
|
+
- workflow_id: str. An ID identifying the Workflow you'd like to deploy.
|
370
|
+
|
371
|
+
- workflow_deployment_id: typing.Optional[str]. 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.
|
372
|
+
|
373
|
+
- workflow_deployment_name: typing.Optional[str]. 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.
|
374
|
+
|
375
|
+
- label: typing.Optional[str]. In the event that a new Workflow Deployment is created, this will be the label it's given.
|
376
|
+
|
377
|
+
- release_tags: typing.Optional[typing.Sequence[str]]. Optionally provide the release tags that you'd like to be associated with the latest release of the created/updated Prompt Deployment.
|
378
|
+
|
379
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
380
|
+
---
|
381
|
+
from vellum.client import Vellum
|
382
|
+
|
383
|
+
client = Vellum(
|
384
|
+
api_key="YOUR_API_KEY",
|
385
|
+
)
|
386
|
+
client.deployments.deploy_workflow(
|
387
|
+
id="id",
|
388
|
+
workflow_id="workflow_id",
|
389
|
+
)
|
390
|
+
"""
|
391
|
+
_request: typing.Dict[str, typing.Any] = {}
|
392
|
+
if workflow_deployment_id is not OMIT:
|
393
|
+
_request["workflow_deployment_id"] = workflow_deployment_id
|
394
|
+
if workflow_deployment_name is not OMIT:
|
395
|
+
_request["workflow_deployment_name"] = workflow_deployment_name
|
396
|
+
if label is not OMIT:
|
397
|
+
_request["label"] = label
|
398
|
+
if release_tags is not OMIT:
|
399
|
+
_request["release_tags"] = release_tags
|
400
|
+
_response = self._client_wrapper.httpx_client.request(
|
401
|
+
method="POST",
|
402
|
+
url=urllib.parse.urljoin(
|
403
|
+
f"{self._client_wrapper.get_environment().default}/",
|
404
|
+
f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
|
405
|
+
),
|
406
|
+
params=jsonable_encoder(
|
407
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
408
|
+
),
|
409
|
+
json=jsonable_encoder(_request)
|
410
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
411
|
+
else {
|
412
|
+
**jsonable_encoder(_request),
|
413
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
414
|
+
},
|
415
|
+
headers=jsonable_encoder(
|
416
|
+
remove_none_from_dict(
|
417
|
+
{
|
418
|
+
**self._client_wrapper.get_headers(),
|
419
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
420
|
+
}
|
421
|
+
)
|
422
|
+
),
|
423
|
+
timeout=request_options.get("timeout_in_seconds")
|
424
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
425
|
+
else self._client_wrapper.get_timeout(),
|
426
|
+
retries=0,
|
427
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
428
|
+
)
|
429
|
+
if 200 <= _response.status_code < 300:
|
430
|
+
return pydantic_v1.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
431
|
+
try:
|
432
|
+
_response_json = _response.json()
|
433
|
+
except JSONDecodeError:
|
434
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
435
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
436
|
+
|
228
437
|
|
229
438
|
class AsyncDeploymentsClient:
|
230
439
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -346,6 +555,130 @@ class AsyncDeploymentsClient:
|
|
346
555
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
347
556
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
348
557
|
|
558
|
+
async def retrieve_deployment_release_tag(
|
559
|
+
self, id: str, name: str, *, request_options: typing.Optional[RequestOptions] = None
|
560
|
+
) -> DeploymentReleaseTagRead:
|
561
|
+
"""
|
562
|
+
Retrieve a Deployment Release Tag by tag name, associated with a specified Deployment.
|
563
|
+
|
564
|
+
Parameters:
|
565
|
+
- id: str. A UUID string identifying this deployment.
|
566
|
+
|
567
|
+
- name: str. The name of the Release Tag associated with this Deployment that you'd like to retrieve.
|
568
|
+
|
569
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
570
|
+
---
|
571
|
+
from vellum.client import AsyncVellum
|
572
|
+
|
573
|
+
client = AsyncVellum(
|
574
|
+
api_key="YOUR_API_KEY",
|
575
|
+
)
|
576
|
+
await client.deployments.retrieve_deployment_release_tag(
|
577
|
+
id="id",
|
578
|
+
name="name",
|
579
|
+
)
|
580
|
+
"""
|
581
|
+
_response = await self._client_wrapper.httpx_client.request(
|
582
|
+
method="GET",
|
583
|
+
url=urllib.parse.urljoin(
|
584
|
+
f"{self._client_wrapper.get_environment().default}/",
|
585
|
+
f"v1/deployments/{jsonable_encoder(id)}/release-tags/{jsonable_encoder(name)}",
|
586
|
+
),
|
587
|
+
params=jsonable_encoder(
|
588
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
589
|
+
),
|
590
|
+
headers=jsonable_encoder(
|
591
|
+
remove_none_from_dict(
|
592
|
+
{
|
593
|
+
**self._client_wrapper.get_headers(),
|
594
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
595
|
+
}
|
596
|
+
)
|
597
|
+
),
|
598
|
+
timeout=request_options.get("timeout_in_seconds")
|
599
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
600
|
+
else self._client_wrapper.get_timeout(),
|
601
|
+
retries=0,
|
602
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
603
|
+
)
|
604
|
+
if 200 <= _response.status_code < 300:
|
605
|
+
return pydantic_v1.parse_obj_as(DeploymentReleaseTagRead, _response.json()) # type: ignore
|
606
|
+
try:
|
607
|
+
_response_json = _response.json()
|
608
|
+
except JSONDecodeError:
|
609
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
610
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
611
|
+
|
612
|
+
async def update_deployment_release_tag(
|
613
|
+
self,
|
614
|
+
id: str,
|
615
|
+
name: str,
|
616
|
+
*,
|
617
|
+
history_item_id: typing.Optional[str] = OMIT,
|
618
|
+
request_options: typing.Optional[RequestOptions] = None,
|
619
|
+
) -> DeploymentReleaseTagRead:
|
620
|
+
"""
|
621
|
+
Updates an existing Release Tag associated with the specified Deployment.
|
622
|
+
|
623
|
+
Parameters:
|
624
|
+
- id: str. A UUID string identifying this deployment.
|
625
|
+
|
626
|
+
- name: str. The name of the Release Tag associated with this Deployment that you'd like to update.
|
627
|
+
|
628
|
+
- history_item_id: typing.Optional[str]. The ID of the Deployment History Item to tag
|
629
|
+
|
630
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
631
|
+
---
|
632
|
+
from vellum.client import AsyncVellum
|
633
|
+
|
634
|
+
client = AsyncVellum(
|
635
|
+
api_key="YOUR_API_KEY",
|
636
|
+
)
|
637
|
+
await client.deployments.update_deployment_release_tag(
|
638
|
+
id="id",
|
639
|
+
name="name",
|
640
|
+
)
|
641
|
+
"""
|
642
|
+
_request: typing.Dict[str, typing.Any] = {}
|
643
|
+
if history_item_id is not OMIT:
|
644
|
+
_request["history_item_id"] = history_item_id
|
645
|
+
_response = await self._client_wrapper.httpx_client.request(
|
646
|
+
method="PATCH",
|
647
|
+
url=urllib.parse.urljoin(
|
648
|
+
f"{self._client_wrapper.get_environment().default}/",
|
649
|
+
f"v1/deployments/{jsonable_encoder(id)}/release-tags/{jsonable_encoder(name)}",
|
650
|
+
),
|
651
|
+
params=jsonable_encoder(
|
652
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
653
|
+
),
|
654
|
+
json=jsonable_encoder(_request)
|
655
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
656
|
+
else {
|
657
|
+
**jsonable_encoder(_request),
|
658
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
659
|
+
},
|
660
|
+
headers=jsonable_encoder(
|
661
|
+
remove_none_from_dict(
|
662
|
+
{
|
663
|
+
**self._client_wrapper.get_headers(),
|
664
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
665
|
+
}
|
666
|
+
)
|
667
|
+
),
|
668
|
+
timeout=request_options.get("timeout_in_seconds")
|
669
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
670
|
+
else self._client_wrapper.get_timeout(),
|
671
|
+
retries=0,
|
672
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
673
|
+
)
|
674
|
+
if 200 <= _response.status_code < 300:
|
675
|
+
return pydantic_v1.parse_obj_as(DeploymentReleaseTagRead, _response.json()) # type: ignore
|
676
|
+
try:
|
677
|
+
_response_json = _response.json()
|
678
|
+
except JSONDecodeError:
|
679
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
680
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
681
|
+
|
349
682
|
async def retrieve_provider_payload(
|
350
683
|
self,
|
351
684
|
*,
|
@@ -426,3 +759,86 @@ class AsyncDeploymentsClient:
|
|
426
759
|
except JSONDecodeError:
|
427
760
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
428
761
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
762
|
+
|
763
|
+
async def deploy_workflow(
|
764
|
+
self,
|
765
|
+
id: str,
|
766
|
+
workflow_id: str,
|
767
|
+
*,
|
768
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
769
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
770
|
+
label: typing.Optional[str] = OMIT,
|
771
|
+
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
772
|
+
request_options: typing.Optional[RequestOptions] = None,
|
773
|
+
) -> WorkflowDeploymentRead:
|
774
|
+
"""
|
775
|
+
Parameters:
|
776
|
+
- id: str. A UUID string identifying this workflow sandbox.
|
777
|
+
|
778
|
+
- workflow_id: str. An ID identifying the Workflow you'd like to deploy.
|
779
|
+
|
780
|
+
- workflow_deployment_id: typing.Optional[str]. 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.
|
781
|
+
|
782
|
+
- workflow_deployment_name: typing.Optional[str]. 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.
|
783
|
+
|
784
|
+
- label: typing.Optional[str]. In the event that a new Workflow Deployment is created, this will be the label it's given.
|
785
|
+
|
786
|
+
- release_tags: typing.Optional[typing.Sequence[str]]. Optionally provide the release tags that you'd like to be associated with the latest release of the created/updated Prompt Deployment.
|
787
|
+
|
788
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
789
|
+
---
|
790
|
+
from vellum.client import AsyncVellum
|
791
|
+
|
792
|
+
client = AsyncVellum(
|
793
|
+
api_key="YOUR_API_KEY",
|
794
|
+
)
|
795
|
+
await client.deployments.deploy_workflow(
|
796
|
+
id="id",
|
797
|
+
workflow_id="workflow_id",
|
798
|
+
)
|
799
|
+
"""
|
800
|
+
_request: typing.Dict[str, typing.Any] = {}
|
801
|
+
if workflow_deployment_id is not OMIT:
|
802
|
+
_request["workflow_deployment_id"] = workflow_deployment_id
|
803
|
+
if workflow_deployment_name is not OMIT:
|
804
|
+
_request["workflow_deployment_name"] = workflow_deployment_name
|
805
|
+
if label is not OMIT:
|
806
|
+
_request["label"] = label
|
807
|
+
if release_tags is not OMIT:
|
808
|
+
_request["release_tags"] = release_tags
|
809
|
+
_response = await self._client_wrapper.httpx_client.request(
|
810
|
+
method="POST",
|
811
|
+
url=urllib.parse.urljoin(
|
812
|
+
f"{self._client_wrapper.get_environment().default}/",
|
813
|
+
f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
|
814
|
+
),
|
815
|
+
params=jsonable_encoder(
|
816
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
817
|
+
),
|
818
|
+
json=jsonable_encoder(_request)
|
819
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
820
|
+
else {
|
821
|
+
**jsonable_encoder(_request),
|
822
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
823
|
+
},
|
824
|
+
headers=jsonable_encoder(
|
825
|
+
remove_none_from_dict(
|
826
|
+
{
|
827
|
+
**self._client_wrapper.get_headers(),
|
828
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
829
|
+
}
|
830
|
+
)
|
831
|
+
),
|
832
|
+
timeout=request_options.get("timeout_in_seconds")
|
833
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
834
|
+
else self._client_wrapper.get_timeout(),
|
835
|
+
retries=0,
|
836
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
837
|
+
)
|
838
|
+
if 200 <= _response.status_code < 300:
|
839
|
+
return pydantic_v1.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
840
|
+
try:
|
841
|
+
_response_json = _response.json()
|
842
|
+
except JSONDecodeError:
|
843
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
844
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|