vellum-ai 0.6.2__py3-none-any.whl → 0.6.3__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +2 -2
- vellum/client.py +3 -3
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/__init__.py +2 -2
- vellum/resources/deployments/client.py +0 -167
- vellum/resources/sandboxes/client.py +167 -0
- vellum/resources/{prompt_versions → workflow_sandboxes}/client.py +39 -39
- {vellum_ai-0.6.2.dist-info → vellum_ai-0.6.3.dist-info}/METADATA +1 -1
- {vellum_ai-0.6.2.dist-info → vellum_ai-0.6.3.dist-info}/RECORD +12 -12
- /vellum/resources/{prompt_versions → workflow_sandboxes}/__init__.py +0 -0
- {vellum_ai-0.6.2.dist-info → vellum_ai-0.6.3.dist-info}/LICENSE +0 -0
- {vellum_ai-0.6.2.dist-info → vellum_ai-0.6.3.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -577,11 +577,11 @@ from .resources import (
|
|
577
577
|
document_indexes,
|
578
578
|
documents,
|
579
579
|
folder_entities,
|
580
|
-
prompt_versions,
|
581
580
|
sandboxes,
|
582
581
|
test_suite_runs,
|
583
582
|
test_suites,
|
584
583
|
workflow_deployments,
|
584
|
+
workflow_sandboxes,
|
585
585
|
)
|
586
586
|
from .environment import VellumEnvironment
|
587
587
|
from .version import __version__
|
@@ -1166,9 +1166,9 @@ __all__ = [
|
|
1166
1166
|
"document_indexes",
|
1167
1167
|
"documents",
|
1168
1168
|
"folder_entities",
|
1169
|
-
"prompt_versions",
|
1170
1169
|
"sandboxes",
|
1171
1170
|
"test_suite_runs",
|
1172
1171
|
"test_suites",
|
1173
1172
|
"workflow_deployments",
|
1173
|
+
"workflow_sandboxes",
|
1174
1174
|
]
|
vellum/client.py
CHANGED
@@ -22,11 +22,11 @@ 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
|
26
25
|
from .resources.sandboxes.client import AsyncSandboxesClient, SandboxesClient
|
27
26
|
from .resources.test_suite_runs.client import AsyncTestSuiteRunsClient, TestSuiteRunsClient
|
28
27
|
from .resources.test_suites.client import AsyncTestSuitesClient, TestSuitesClient
|
29
28
|
from .resources.workflow_deployments.client import AsyncWorkflowDeploymentsClient, WorkflowDeploymentsClient
|
29
|
+
from .resources.workflow_sandboxes.client import AsyncWorkflowSandboxesClient, WorkflowSandboxesClient
|
30
30
|
from .types.execute_prompt_event import ExecutePromptEvent
|
31
31
|
from .types.execute_prompt_response import ExecutePromptResponse
|
32
32
|
from .types.execute_workflow_response import ExecuteWorkflowResponse
|
@@ -97,11 +97,11 @@ class Vellum:
|
|
97
97
|
self.document_indexes = DocumentIndexesClient(client_wrapper=self._client_wrapper)
|
98
98
|
self.documents = DocumentsClient(client_wrapper=self._client_wrapper)
|
99
99
|
self.folder_entities = FolderEntitiesClient(client_wrapper=self._client_wrapper)
|
100
|
-
self.prompt_versions = PromptVersionsClient(client_wrapper=self._client_wrapper)
|
101
100
|
self.sandboxes = SandboxesClient(client_wrapper=self._client_wrapper)
|
102
101
|
self.test_suite_runs = TestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
103
102
|
self.test_suites = TestSuitesClient(client_wrapper=self._client_wrapper)
|
104
103
|
self.workflow_deployments = WorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
104
|
+
self.workflow_sandboxes = WorkflowSandboxesClient(client_wrapper=self._client_wrapper)
|
105
105
|
|
106
106
|
def execute_prompt(
|
107
107
|
self,
|
@@ -1060,11 +1060,11 @@ class AsyncVellum:
|
|
1060
1060
|
self.document_indexes = AsyncDocumentIndexesClient(client_wrapper=self._client_wrapper)
|
1061
1061
|
self.documents = AsyncDocumentsClient(client_wrapper=self._client_wrapper)
|
1062
1062
|
self.folder_entities = AsyncFolderEntitiesClient(client_wrapper=self._client_wrapper)
|
1063
|
-
self.prompt_versions = AsyncPromptVersionsClient(client_wrapper=self._client_wrapper)
|
1064
1063
|
self.sandboxes = AsyncSandboxesClient(client_wrapper=self._client_wrapper)
|
1065
1064
|
self.test_suite_runs = AsyncTestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
1066
1065
|
self.test_suites = AsyncTestSuitesClient(client_wrapper=self._client_wrapper)
|
1067
1066
|
self.workflow_deployments = AsyncWorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
1067
|
+
self.workflow_sandboxes = AsyncWorkflowSandboxesClient(client_wrapper=self._client_wrapper)
|
1068
1068
|
|
1069
1069
|
async def execute_prompt(
|
1070
1070
|
self,
|
vellum/core/client_wrapper.py
CHANGED
vellum/resources/__init__.py
CHANGED
@@ -5,11 +5,11 @@ from . import (
|
|
5
5
|
document_indexes,
|
6
6
|
documents,
|
7
7
|
folder_entities,
|
8
|
-
prompt_versions,
|
9
8
|
sandboxes,
|
10
9
|
test_suite_runs,
|
11
10
|
test_suites,
|
12
11
|
workflow_deployments,
|
12
|
+
workflow_sandboxes,
|
13
13
|
)
|
14
14
|
from .deployments import DeploymentsListRequestStatus
|
15
15
|
from .document_indexes import DocumentIndexesListRequestStatus
|
@@ -23,9 +23,9 @@ __all__ = [
|
|
23
23
|
"document_indexes",
|
24
24
|
"documents",
|
25
25
|
"folder_entities",
|
26
|
-
"prompt_versions",
|
27
26
|
"sandboxes",
|
28
27
|
"test_suite_runs",
|
29
28
|
"test_suites",
|
30
29
|
"workflow_deployments",
|
30
|
+
"workflow_sandboxes",
|
31
31
|
]
|
@@ -19,7 +19,6 @@ from ...types.deployment_read import DeploymentRead
|
|
19
19
|
from ...types.deployment_release_tag_read import DeploymentReleaseTagRead
|
20
20
|
from ...types.paginated_slim_deployment_read_list import PaginatedSlimDeploymentReadList
|
21
21
|
from ...types.prompt_deployment_input_request import PromptDeploymentInputRequest
|
22
|
-
from ...types.workflow_deployment_read import WorkflowDeploymentRead
|
23
22
|
from .types.deployments_list_request_status import DeploymentsListRequestStatus
|
24
23
|
|
25
24
|
# this is used as the default value for optional parameters
|
@@ -351,89 +350,6 @@ class DeploymentsClient:
|
|
351
350
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
352
351
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
353
352
|
|
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
|
-
|
437
353
|
|
438
354
|
class AsyncDeploymentsClient:
|
439
355
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -759,86 +675,3 @@ class AsyncDeploymentsClient:
|
|
759
675
|
except JSONDecodeError:
|
760
676
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
761
677
|
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)
|
@@ -10,6 +10,7 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
10
10
|
from ...core.pydantic_utilities import pydantic_v1
|
11
11
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
12
12
|
from ...core.request_options import RequestOptions
|
13
|
+
from ...types.deployment_read import DeploymentRead
|
13
14
|
from ...types.named_scenario_input_request import NamedScenarioInputRequest
|
14
15
|
from ...types.sandbox_scenario import SandboxScenario
|
15
16
|
|
@@ -21,6 +22,89 @@ class SandboxesClient:
|
|
21
22
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
22
23
|
self._client_wrapper = client_wrapper
|
23
24
|
|
25
|
+
def deploy_prompt(
|
26
|
+
self,
|
27
|
+
id: str,
|
28
|
+
prompt_id: str,
|
29
|
+
*,
|
30
|
+
prompt_deployment_id: typing.Optional[str] = OMIT,
|
31
|
+
prompt_deployment_name: typing.Optional[str] = OMIT,
|
32
|
+
label: typing.Optional[str] = OMIT,
|
33
|
+
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
34
|
+
request_options: typing.Optional[RequestOptions] = None,
|
35
|
+
) -> DeploymentRead:
|
36
|
+
"""
|
37
|
+
Parameters:
|
38
|
+
- id: str. A UUID string identifying this sandbox.
|
39
|
+
|
40
|
+
- prompt_id: str. An ID identifying the Prompt you'd like to deploy.
|
41
|
+
|
42
|
+
- prompt_deployment_id: typing.Optional[str]. The Vellum-generated ID of the Prompt Deployment you'd like to update. Cannot specify both this and prompt_deployment_name. Leave null to create a new Prompt Deployment.
|
43
|
+
|
44
|
+
- prompt_deployment_name: typing.Optional[str]. The unique name of the Prompt Deployment you'd like to either create or update. Cannot specify both this and prompt_deployment_id. If provided and matches an existing Prompt Deployment, that Prompt Deployment will be updated. Otherwise, a new Prompt Deployment will be created.
|
45
|
+
|
46
|
+
- label: typing.Optional[str]. In the event that a new Prompt Deployment is created, this will be the label it's given.
|
47
|
+
|
48
|
+
- 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.
|
49
|
+
|
50
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
51
|
+
---
|
52
|
+
from vellum.client import Vellum
|
53
|
+
|
54
|
+
client = Vellum(
|
55
|
+
api_key="YOUR_API_KEY",
|
56
|
+
)
|
57
|
+
client.sandboxes.deploy_prompt(
|
58
|
+
id="id",
|
59
|
+
prompt_id="prompt_id",
|
60
|
+
)
|
61
|
+
"""
|
62
|
+
_request: typing.Dict[str, typing.Any] = {}
|
63
|
+
if prompt_deployment_id is not OMIT:
|
64
|
+
_request["prompt_deployment_id"] = prompt_deployment_id
|
65
|
+
if prompt_deployment_name is not OMIT:
|
66
|
+
_request["prompt_deployment_name"] = prompt_deployment_name
|
67
|
+
if label is not OMIT:
|
68
|
+
_request["label"] = label
|
69
|
+
if release_tags is not OMIT:
|
70
|
+
_request["release_tags"] = release_tags
|
71
|
+
_response = self._client_wrapper.httpx_client.request(
|
72
|
+
method="POST",
|
73
|
+
url=urllib.parse.urljoin(
|
74
|
+
f"{self._client_wrapper.get_environment().default}/",
|
75
|
+
f"v1/sandboxes/{jsonable_encoder(id)}/prompts/{jsonable_encoder(prompt_id)}/deploy",
|
76
|
+
),
|
77
|
+
params=jsonable_encoder(
|
78
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
79
|
+
),
|
80
|
+
json=jsonable_encoder(_request)
|
81
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
82
|
+
else {
|
83
|
+
**jsonable_encoder(_request),
|
84
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
85
|
+
},
|
86
|
+
headers=jsonable_encoder(
|
87
|
+
remove_none_from_dict(
|
88
|
+
{
|
89
|
+
**self._client_wrapper.get_headers(),
|
90
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
91
|
+
}
|
92
|
+
)
|
93
|
+
),
|
94
|
+
timeout=request_options.get("timeout_in_seconds")
|
95
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
96
|
+
else self._client_wrapper.get_timeout(),
|
97
|
+
retries=0,
|
98
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
99
|
+
)
|
100
|
+
if 200 <= _response.status_code < 300:
|
101
|
+
return pydantic_v1.parse_obj_as(DeploymentRead, _response.json()) # type: ignore
|
102
|
+
try:
|
103
|
+
_response_json = _response.json()
|
104
|
+
except JSONDecodeError:
|
105
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
106
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
107
|
+
|
24
108
|
def upsert_sandbox_scenario(
|
25
109
|
self,
|
26
110
|
id: str,
|
@@ -161,6 +245,89 @@ class AsyncSandboxesClient:
|
|
161
245
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
162
246
|
self._client_wrapper = client_wrapper
|
163
247
|
|
248
|
+
async def deploy_prompt(
|
249
|
+
self,
|
250
|
+
id: str,
|
251
|
+
prompt_id: str,
|
252
|
+
*,
|
253
|
+
prompt_deployment_id: typing.Optional[str] = OMIT,
|
254
|
+
prompt_deployment_name: typing.Optional[str] = OMIT,
|
255
|
+
label: typing.Optional[str] = OMIT,
|
256
|
+
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
257
|
+
request_options: typing.Optional[RequestOptions] = None,
|
258
|
+
) -> DeploymentRead:
|
259
|
+
"""
|
260
|
+
Parameters:
|
261
|
+
- id: str. A UUID string identifying this sandbox.
|
262
|
+
|
263
|
+
- prompt_id: str. An ID identifying the Prompt you'd like to deploy.
|
264
|
+
|
265
|
+
- prompt_deployment_id: typing.Optional[str]. The Vellum-generated ID of the Prompt Deployment you'd like to update. Cannot specify both this and prompt_deployment_name. Leave null to create a new Prompt Deployment.
|
266
|
+
|
267
|
+
- prompt_deployment_name: typing.Optional[str]. The unique name of the Prompt Deployment you'd like to either create or update. Cannot specify both this and prompt_deployment_id. If provided and matches an existing Prompt Deployment, that Prompt Deployment will be updated. Otherwise, a new Prompt Deployment will be created.
|
268
|
+
|
269
|
+
- label: typing.Optional[str]. In the event that a new Prompt Deployment is created, this will be the label it's given.
|
270
|
+
|
271
|
+
- 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.
|
272
|
+
|
273
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
274
|
+
---
|
275
|
+
from vellum.client import AsyncVellum
|
276
|
+
|
277
|
+
client = AsyncVellum(
|
278
|
+
api_key="YOUR_API_KEY",
|
279
|
+
)
|
280
|
+
await client.sandboxes.deploy_prompt(
|
281
|
+
id="id",
|
282
|
+
prompt_id="prompt_id",
|
283
|
+
)
|
284
|
+
"""
|
285
|
+
_request: typing.Dict[str, typing.Any] = {}
|
286
|
+
if prompt_deployment_id is not OMIT:
|
287
|
+
_request["prompt_deployment_id"] = prompt_deployment_id
|
288
|
+
if prompt_deployment_name is not OMIT:
|
289
|
+
_request["prompt_deployment_name"] = prompt_deployment_name
|
290
|
+
if label is not OMIT:
|
291
|
+
_request["label"] = label
|
292
|
+
if release_tags is not OMIT:
|
293
|
+
_request["release_tags"] = release_tags
|
294
|
+
_response = await self._client_wrapper.httpx_client.request(
|
295
|
+
method="POST",
|
296
|
+
url=urllib.parse.urljoin(
|
297
|
+
f"{self._client_wrapper.get_environment().default}/",
|
298
|
+
f"v1/sandboxes/{jsonable_encoder(id)}/prompts/{jsonable_encoder(prompt_id)}/deploy",
|
299
|
+
),
|
300
|
+
params=jsonable_encoder(
|
301
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
302
|
+
),
|
303
|
+
json=jsonable_encoder(_request)
|
304
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
305
|
+
else {
|
306
|
+
**jsonable_encoder(_request),
|
307
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
308
|
+
},
|
309
|
+
headers=jsonable_encoder(
|
310
|
+
remove_none_from_dict(
|
311
|
+
{
|
312
|
+
**self._client_wrapper.get_headers(),
|
313
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
314
|
+
}
|
315
|
+
)
|
316
|
+
),
|
317
|
+
timeout=request_options.get("timeout_in_seconds")
|
318
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
319
|
+
else self._client_wrapper.get_timeout(),
|
320
|
+
retries=0,
|
321
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
322
|
+
)
|
323
|
+
if 200 <= _response.status_code < 300:
|
324
|
+
return pydantic_v1.parse_obj_as(DeploymentRead, _response.json()) # type: ignore
|
325
|
+
try:
|
326
|
+
_response_json = _response.json()
|
327
|
+
except JSONDecodeError:
|
328
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
329
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
330
|
+
|
164
331
|
async def upsert_sandbox_scenario(
|
165
332
|
self,
|
166
333
|
id: str,
|
@@ -10,38 +10,38 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
10
10
|
from ...core.pydantic_utilities import pydantic_v1
|
11
11
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
12
12
|
from ...core.request_options import RequestOptions
|
13
|
-
from ...types.
|
13
|
+
from ...types.workflow_deployment_read import WorkflowDeploymentRead
|
14
14
|
|
15
15
|
# this is used as the default value for optional parameters
|
16
16
|
OMIT = typing.cast(typing.Any, ...)
|
17
17
|
|
18
18
|
|
19
|
-
class
|
19
|
+
class WorkflowSandboxesClient:
|
20
20
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
21
21
|
self._client_wrapper = client_wrapper
|
22
22
|
|
23
|
-
def
|
23
|
+
def deploy_workflow(
|
24
24
|
self,
|
25
25
|
id: str,
|
26
|
-
|
26
|
+
workflow_id: str,
|
27
27
|
*,
|
28
|
-
|
29
|
-
|
28
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
29
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
30
30
|
label: typing.Optional[str] = OMIT,
|
31
31
|
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
32
32
|
request_options: typing.Optional[RequestOptions] = None,
|
33
|
-
) ->
|
33
|
+
) -> WorkflowDeploymentRead:
|
34
34
|
"""
|
35
35
|
Parameters:
|
36
|
-
- id: str. A UUID string identifying this sandbox.
|
36
|
+
- id: str. A UUID string identifying this workflow sandbox.
|
37
37
|
|
38
|
-
-
|
38
|
+
- workflow_id: str. An ID identifying the Workflow you'd like to deploy.
|
39
39
|
|
40
|
-
-
|
40
|
+
- 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.
|
41
41
|
|
42
|
-
-
|
42
|
+
- 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.
|
43
43
|
|
44
|
-
- label: typing.Optional[str]. In the event that a new
|
44
|
+
- label: typing.Optional[str]. In the event that a new Workflow Deployment is created, this will be the label it's given.
|
45
45
|
|
46
46
|
- 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.
|
47
47
|
|
@@ -52,16 +52,16 @@ class PromptVersionsClient:
|
|
52
52
|
client = Vellum(
|
53
53
|
api_key="YOUR_API_KEY",
|
54
54
|
)
|
55
|
-
client.
|
55
|
+
client.workflow_sandboxes.deploy_workflow(
|
56
56
|
id="id",
|
57
|
-
|
57
|
+
workflow_id="workflow_id",
|
58
58
|
)
|
59
59
|
"""
|
60
60
|
_request: typing.Dict[str, typing.Any] = {}
|
61
|
-
if
|
62
|
-
_request["
|
63
|
-
if
|
64
|
-
_request["
|
61
|
+
if workflow_deployment_id is not OMIT:
|
62
|
+
_request["workflow_deployment_id"] = workflow_deployment_id
|
63
|
+
if workflow_deployment_name is not OMIT:
|
64
|
+
_request["workflow_deployment_name"] = workflow_deployment_name
|
65
65
|
if label is not OMIT:
|
66
66
|
_request["label"] = label
|
67
67
|
if release_tags is not OMIT:
|
@@ -70,7 +70,7 @@ class PromptVersionsClient:
|
|
70
70
|
method="POST",
|
71
71
|
url=urllib.parse.urljoin(
|
72
72
|
f"{self._client_wrapper.get_environment().default}/",
|
73
|
-
f"v1/sandboxes/{jsonable_encoder(id)}/
|
73
|
+
f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
|
74
74
|
),
|
75
75
|
params=jsonable_encoder(
|
76
76
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
@@ -96,7 +96,7 @@ class PromptVersionsClient:
|
|
96
96
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
97
97
|
)
|
98
98
|
if 200 <= _response.status_code < 300:
|
99
|
-
return pydantic_v1.parse_obj_as(
|
99
|
+
return pydantic_v1.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
100
100
|
try:
|
101
101
|
_response_json = _response.json()
|
102
102
|
except JSONDecodeError:
|
@@ -104,32 +104,32 @@ class PromptVersionsClient:
|
|
104
104
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
105
105
|
|
106
106
|
|
107
|
-
class
|
107
|
+
class AsyncWorkflowSandboxesClient:
|
108
108
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
109
109
|
self._client_wrapper = client_wrapper
|
110
110
|
|
111
|
-
async def
|
111
|
+
async def deploy_workflow(
|
112
112
|
self,
|
113
113
|
id: str,
|
114
|
-
|
114
|
+
workflow_id: str,
|
115
115
|
*,
|
116
|
-
|
117
|
-
|
116
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
117
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
118
118
|
label: typing.Optional[str] = OMIT,
|
119
119
|
release_tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
120
120
|
request_options: typing.Optional[RequestOptions] = None,
|
121
|
-
) ->
|
121
|
+
) -> WorkflowDeploymentRead:
|
122
122
|
"""
|
123
123
|
Parameters:
|
124
|
-
- id: str. A UUID string identifying this sandbox.
|
124
|
+
- id: str. A UUID string identifying this workflow sandbox.
|
125
125
|
|
126
|
-
-
|
126
|
+
- workflow_id: str. An ID identifying the Workflow you'd like to deploy.
|
127
127
|
|
128
|
-
-
|
128
|
+
- 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.
|
129
129
|
|
130
|
-
-
|
130
|
+
- 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.
|
131
131
|
|
132
|
-
- label: typing.Optional[str]. In the event that a new
|
132
|
+
- label: typing.Optional[str]. In the event that a new Workflow Deployment is created, this will be the label it's given.
|
133
133
|
|
134
134
|
- 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.
|
135
135
|
|
@@ -140,16 +140,16 @@ class AsyncPromptVersionsClient:
|
|
140
140
|
client = AsyncVellum(
|
141
141
|
api_key="YOUR_API_KEY",
|
142
142
|
)
|
143
|
-
await client.
|
143
|
+
await client.workflow_sandboxes.deploy_workflow(
|
144
144
|
id="id",
|
145
|
-
|
145
|
+
workflow_id="workflow_id",
|
146
146
|
)
|
147
147
|
"""
|
148
148
|
_request: typing.Dict[str, typing.Any] = {}
|
149
|
-
if
|
150
|
-
_request["
|
151
|
-
if
|
152
|
-
_request["
|
149
|
+
if workflow_deployment_id is not OMIT:
|
150
|
+
_request["workflow_deployment_id"] = workflow_deployment_id
|
151
|
+
if workflow_deployment_name is not OMIT:
|
152
|
+
_request["workflow_deployment_name"] = workflow_deployment_name
|
153
153
|
if label is not OMIT:
|
154
154
|
_request["label"] = label
|
155
155
|
if release_tags is not OMIT:
|
@@ -158,7 +158,7 @@ class AsyncPromptVersionsClient:
|
|
158
158
|
method="POST",
|
159
159
|
url=urllib.parse.urljoin(
|
160
160
|
f"{self._client_wrapper.get_environment().default}/",
|
161
|
-
f"v1/sandboxes/{jsonable_encoder(id)}/
|
161
|
+
f"v1/workflow-sandboxes/{jsonable_encoder(id)}/workflows/{jsonable_encoder(workflow_id)}/deploy",
|
162
162
|
),
|
163
163
|
params=jsonable_encoder(
|
164
164
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
@@ -184,7 +184,7 @@ class AsyncPromptVersionsClient:
|
|
184
184
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
185
185
|
)
|
186
186
|
if 200 <= _response.status_code < 300:
|
187
|
-
return pydantic_v1.parse_obj_as(
|
187
|
+
return pydantic_v1.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
188
188
|
try:
|
189
189
|
_response_json = _response.json()
|
190
190
|
except JSONDecodeError:
|
@@ -1,8 +1,8 @@
|
|
1
|
-
vellum/__init__.py,sha256=
|
2
|
-
vellum/client.py,sha256=
|
1
|
+
vellum/__init__.py,sha256=RxyqAQAQKjaI4Q7hmri_fIUkYNgYu8ySChEuISNPt_E,42641
|
2
|
+
vellum/client.py,sha256=tH28pqtzdD8V_dlklDppc-3kUlKZkkDBHHW4E0U-s08,97387
|
3
3
|
vellum/core/__init__.py,sha256=1pNSKkwyQvMl_F0wohBqmoQAITptg3zlvCwsoSSzy7c,853
|
4
4
|
vellum/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
5
|
-
vellum/core/client_wrapper.py,sha256
|
5
|
+
vellum/core/client_wrapper.py,sha256=-Aw-Y44hope113sAqU0k5QV8pZZmaG-Ag-3HRo6dYFQ,1697
|
6
6
|
vellum/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
7
7
|
vellum/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
8
8
|
vellum/core/http_client.py,sha256=5ok6hqgZDJhg57EHvMnr0BBaHdG50QxFPKaCZ9aVWTc,5059
|
@@ -26,9 +26,9 @@ vellum/lib/utils/env.py,sha256=ySl859lYBfls8hmlaU_RFdquHa_A_7SzaC6KEdFqh1Y,298
|
|
26
26
|
vellum/lib/utils/exceptions.py,sha256=dXMAkzqbHV_AP5FjjbegPlfUE0zQDlpA3qOsoOJUxfg,49
|
27
27
|
vellum/lib/utils/paginator.py,sha256=yDvgehocYBDclLt5SewZH4hCIyq0yLHdBzkyPCoYPjs,698
|
28
28
|
vellum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
vellum/resources/__init__.py,sha256=
|
29
|
+
vellum/resources/__init__.py,sha256=K9Pl_nZ5i7-cdT-rzttq8bZxustkIxPjDhcDEitCLoA,780
|
30
30
|
vellum/resources/deployments/__init__.py,sha256=AE0TcFwLrLBljM0ZDX-pPw4Kqt-1f5JDpIok2HS80QI,157
|
31
|
-
vellum/resources/deployments/client.py,sha256=p-
|
31
|
+
vellum/resources/deployments/client.py,sha256=p-n2k6RQIwNBDm9dU-wE6pI0kRhNjQiARBeQYWX9wuM,30612
|
32
32
|
vellum/resources/deployments/types/__init__.py,sha256=IhwnmoXJ0r_QEhh1b2tBcaAm_x3fWMVuIhYmAapp_ZA,183
|
33
33
|
vellum/resources/deployments/types/deployments_list_request_status.py,sha256=CxlQD16KZXme7x31YYCe_3aAgEueutDTeJo5A4Au-aU,174
|
34
34
|
vellum/resources/document_indexes/__init__.py,sha256=YpOl_9IV7xOlH4OmusQxtAJB11kxQfCSMDyT1_UD0oM,165
|
@@ -39,10 +39,8 @@ vellum/resources/documents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roe
|
|
39
39
|
vellum/resources/documents/client.py,sha256=lzi8zUVIo8eJA_fyqIjzho1FRGZrCTvNaIcFDQfaGEk,34322
|
40
40
|
vellum/resources/folder_entities/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
41
41
|
vellum/resources/folder_entities/client.py,sha256=dbq-WQ9Rh7zvB4i_U_FXqF1qvRhSEsJqOq6dKr7_PzY,6435
|
42
|
-
vellum/resources/prompt_versions/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
43
|
-
vellum/resources/prompt_versions/client.py,sha256=Yccl4TXz9tiNg94CV4OjlfjOOaU_dypb0-HYWSllPzk,9294
|
44
42
|
vellum/resources/sandboxes/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
45
|
-
vellum/resources/sandboxes/client.py,sha256=
|
43
|
+
vellum/resources/sandboxes/client.py,sha256=Lm45GGIRSODx5WJbyXP3ThR3FB8QSPajMWiqvnpVsIc,21168
|
46
44
|
vellum/resources/test_suite_runs/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
47
45
|
vellum/resources/test_suite_runs/client.py,sha256=LOcjVwBAgQF__yEGvsbZpjBhefGtLL1vnSqJ1K3uly0,18728
|
48
46
|
vellum/resources/test_suites/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
@@ -51,6 +49,8 @@ vellum/resources/workflow_deployments/__init__.py,sha256=-5BCA0kSmW6WUh4gqLuQtHv
|
|
51
49
|
vellum/resources/workflow_deployments/client.py,sha256=Oal32DF472B46CBWkb8GgDonjyAFQ28hHV5lq4DF1AM,22437
|
52
50
|
vellum/resources/workflow_deployments/types/__init__.py,sha256=rmS_4dtbgLHGNQJ_pOloygrjl4sNbKZjTEKBxbMyz6E,208
|
53
51
|
vellum/resources/workflow_deployments/types/workflow_deployments_list_request_status.py,sha256=FXVkVmGM6DZ2RpTGnZXWJYiVlLQ-K5fDtX3WMaBPaWk,182
|
52
|
+
vellum/resources/workflow_sandboxes/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
53
|
+
vellum/resources/workflow_sandboxes/client.py,sha256=BR9Lw9x2bNBaLZ6dd6uHI7xCv1WwrsuSDwmLi1NbJOk,9499
|
54
54
|
vellum/terraform/__init__.py,sha256=t69swjCfZmrf7tmHcUYVHH5bflrp1Ax2YnbwNMuG2YQ,454
|
55
55
|
vellum/terraform/_jsii/__init__.py,sha256=AV9B1-EC-DQ2MSTWojcpbHjahvoZxNaYeZ6aCi5SXEQ,473
|
56
56
|
vellum/terraform/_jsii/vellum-ai_vellum@0.0.0.jsii.tgz,sha256=e1tV8nF_TEMLqCNrRBkDIlXKfO65c0lGj92G-CzeAVI,15887
|
@@ -438,7 +438,7 @@ vellum/types/workflow_result_event_output_data_search_results.py,sha256=gazaUrC5
|
|
438
438
|
vellum/types/workflow_result_event_output_data_string.py,sha256=aVWIIGbLj4TJJhTTj6WzhbYXQkcZatKuhhNy8UYwXbw,1482
|
439
439
|
vellum/types/workflow_stream_event.py,sha256=KA6Bkk_XA6AIPWR-1vKnwF1A8l_Bm5y0arQCWWWRpsk,911
|
440
440
|
vellum/version.py,sha256=neLt8HBHHUtDF9M5fsyUzHT-pKooEPvceaLDqqIGb0s,77
|
441
|
-
vellum_ai-0.6.
|
442
|
-
vellum_ai-0.6.
|
443
|
-
vellum_ai-0.6.
|
444
|
-
vellum_ai-0.6.
|
441
|
+
vellum_ai-0.6.3.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
|
442
|
+
vellum_ai-0.6.3.dist-info/METADATA,sha256=0hbs1I28Mjj7hqjMBUUiY86Qt5PCftFdaXFILID0JBM,3591
|
443
|
+
vellum_ai-0.6.3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
444
|
+
vellum_ai-0.6.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|