vellum-ai 0.3.6__py3-none-any.whl → 0.3.8__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +40 -0
- vellum/client.py +11 -8
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/__init__.py +2 -0
- vellum/resources/deployments/client.py +2 -2
- vellum/resources/folder_entities/__init__.py +2 -0
- vellum/resources/folder_entities/client.py +98 -0
- vellum/resources/workflow_deployments/client.py +65 -8
- vellum/types/__init__.py +40 -0
- vellum/types/array_enum.py +5 -0
- vellum/types/array_variable_value_item.py +89 -0
- vellum/types/chat_history_variable_value.py +29 -0
- vellum/types/node_input_compiled_array_value.py +31 -0
- vellum/types/node_input_variable_compiled_value.py +11 -0
- vellum/types/node_output_compiled_array_value.py +30 -0
- vellum/types/node_output_compiled_function_value.py +30 -0
- vellum/types/node_output_compiled_value.py +22 -0
- vellum/types/number_variable_value.py +28 -0
- vellum/types/prompt_node_result_data.py +1 -0
- vellum/types/search_results_variable_value.py +29 -0
- vellum/types/workflow_deployment_read.py +57 -0
- vellum/types/workflow_request_chat_history_input_request.py +4 -0
- vellum/types/workflow_request_json_input_request.py +4 -0
- vellum/types/workflow_request_number_input_request.py +4 -0
- vellum/types/workflow_request_string_input_request.py +4 -0
- {vellum_ai-0.3.6.dist-info → vellum_ai-0.3.8.dist-info}/METADATA +1 -1
- {vellum_ai-0.3.6.dist-info → vellum_ai-0.3.8.dist-info}/RECORD +29 -18
- {vellum_ai-0.3.6.dist-info → vellum_ai-0.3.8.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.6.dist-info → vellum_ai-0.3.8.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -13,9 +13,19 @@ from .types import (
|
|
13
13
|
ArrayChatMessageContentItem_Image,
|
14
14
|
ArrayChatMessageContentItem_String,
|
15
15
|
ArrayChatMessageContentRequest,
|
16
|
+
ArrayEnum,
|
17
|
+
ArrayVariableValueItem,
|
18
|
+
ArrayVariableValueItem_ChatHistory,
|
19
|
+
ArrayVariableValueItem_Error,
|
20
|
+
ArrayVariableValueItem_FunctionCall,
|
21
|
+
ArrayVariableValueItem_Json,
|
22
|
+
ArrayVariableValueItem_Number,
|
23
|
+
ArrayVariableValueItem_SearchResults,
|
24
|
+
ArrayVariableValueItem_String,
|
16
25
|
BlockTypeEnum,
|
17
26
|
ChatHistoryEnum,
|
18
27
|
ChatHistoryInputRequest,
|
28
|
+
ChatHistoryVariableValue,
|
19
29
|
ChatMessage,
|
20
30
|
ChatMessageContent,
|
21
31
|
ChatMessageContentRequest,
|
@@ -134,6 +144,7 @@ from .types import (
|
|
134
144
|
NamedTestCaseVariableValueRequest_Number,
|
135
145
|
NamedTestCaseVariableValueRequest_SearchResults,
|
136
146
|
NamedTestCaseVariableValueRequest_String,
|
147
|
+
NodeInputCompiledArrayValue,
|
137
148
|
NodeInputCompiledChatHistoryValue,
|
138
149
|
NodeInputCompiledErrorValue,
|
139
150
|
NodeInputCompiledJsonValue,
|
@@ -141,21 +152,26 @@ from .types import (
|
|
141
152
|
NodeInputCompiledSearchResultsValue,
|
142
153
|
NodeInputCompiledStringValue,
|
143
154
|
NodeInputVariableCompiledValue,
|
155
|
+
NodeInputVariableCompiledValue_Array,
|
144
156
|
NodeInputVariableCompiledValue_ChatHistory,
|
145
157
|
NodeInputVariableCompiledValue_Error,
|
146
158
|
NodeInputVariableCompiledValue_Json,
|
147
159
|
NodeInputVariableCompiledValue_Number,
|
148
160
|
NodeInputVariableCompiledValue_SearchResults,
|
149
161
|
NodeInputVariableCompiledValue_String,
|
162
|
+
NodeOutputCompiledArrayValue,
|
150
163
|
NodeOutputCompiledChatHistoryValue,
|
151
164
|
NodeOutputCompiledErrorValue,
|
165
|
+
NodeOutputCompiledFunctionValue,
|
152
166
|
NodeOutputCompiledJsonValue,
|
153
167
|
NodeOutputCompiledNumberValue,
|
154
168
|
NodeOutputCompiledSearchResultsValue,
|
155
169
|
NodeOutputCompiledStringValue,
|
156
170
|
NodeOutputCompiledValue,
|
171
|
+
NodeOutputCompiledValue_Array,
|
157
172
|
NodeOutputCompiledValue_ChatHistory,
|
158
173
|
NodeOutputCompiledValue_Error,
|
174
|
+
NodeOutputCompiledValue_FunctionCall,
|
159
175
|
NodeOutputCompiledValue_Json,
|
160
176
|
NodeOutputCompiledValue_Number,
|
161
177
|
NodeOutputCompiledValue_SearchResults,
|
@@ -163,6 +179,7 @@ from .types import (
|
|
163
179
|
NormalizedLogProbs,
|
164
180
|
NormalizedTokenLogProbs,
|
165
181
|
NumberEnum,
|
182
|
+
NumberVariableValue,
|
166
183
|
PaginatedSlimDeploymentReadList,
|
167
184
|
PaginatedSlimDocumentList,
|
168
185
|
PaginatedSlimWorkflowDeploymentList,
|
@@ -222,6 +239,7 @@ from .types import (
|
|
222
239
|
SearchResultMergingRequest,
|
223
240
|
SearchResultRequest,
|
224
241
|
SearchResultsEnum,
|
242
|
+
SearchResultsVariableValue,
|
225
243
|
SearchWeightsRequest,
|
226
244
|
SlimDeploymentRead,
|
227
245
|
SlimDocument,
|
@@ -294,6 +312,7 @@ from .types import (
|
|
294
312
|
VellumImageRequest,
|
295
313
|
VellumVariable,
|
296
314
|
VellumVariableType,
|
315
|
+
WorkflowDeploymentRead,
|
297
316
|
WorkflowEventError,
|
298
317
|
WorkflowExecutionActualChatHistoryRequest,
|
299
318
|
WorkflowExecutionActualJsonRequest,
|
@@ -367,6 +386,7 @@ from .resources import (
|
|
367
386
|
deployments,
|
368
387
|
document_indexes,
|
369
388
|
documents,
|
389
|
+
folder_entities,
|
370
390
|
model_versions,
|
371
391
|
registered_prompts,
|
372
392
|
sandboxes,
|
@@ -388,10 +408,20 @@ __all__ = [
|
|
388
408
|
"ArrayChatMessageContentItem_Image",
|
389
409
|
"ArrayChatMessageContentItem_String",
|
390
410
|
"ArrayChatMessageContentRequest",
|
411
|
+
"ArrayEnum",
|
412
|
+
"ArrayVariableValueItem",
|
413
|
+
"ArrayVariableValueItem_ChatHistory",
|
414
|
+
"ArrayVariableValueItem_Error",
|
415
|
+
"ArrayVariableValueItem_FunctionCall",
|
416
|
+
"ArrayVariableValueItem_Json",
|
417
|
+
"ArrayVariableValueItem_Number",
|
418
|
+
"ArrayVariableValueItem_SearchResults",
|
419
|
+
"ArrayVariableValueItem_String",
|
391
420
|
"BadRequestError",
|
392
421
|
"BlockTypeEnum",
|
393
422
|
"ChatHistoryEnum",
|
394
423
|
"ChatHistoryInputRequest",
|
424
|
+
"ChatHistoryVariableValue",
|
395
425
|
"ChatMessage",
|
396
426
|
"ChatMessageContent",
|
397
427
|
"ChatMessageContentRequest",
|
@@ -514,6 +544,7 @@ __all__ = [
|
|
514
544
|
"NamedTestCaseVariableValueRequest_Number",
|
515
545
|
"NamedTestCaseVariableValueRequest_SearchResults",
|
516
546
|
"NamedTestCaseVariableValueRequest_String",
|
547
|
+
"NodeInputCompiledArrayValue",
|
517
548
|
"NodeInputCompiledChatHistoryValue",
|
518
549
|
"NodeInputCompiledErrorValue",
|
519
550
|
"NodeInputCompiledJsonValue",
|
@@ -521,21 +552,26 @@ __all__ = [
|
|
521
552
|
"NodeInputCompiledSearchResultsValue",
|
522
553
|
"NodeInputCompiledStringValue",
|
523
554
|
"NodeInputVariableCompiledValue",
|
555
|
+
"NodeInputVariableCompiledValue_Array",
|
524
556
|
"NodeInputVariableCompiledValue_ChatHistory",
|
525
557
|
"NodeInputVariableCompiledValue_Error",
|
526
558
|
"NodeInputVariableCompiledValue_Json",
|
527
559
|
"NodeInputVariableCompiledValue_Number",
|
528
560
|
"NodeInputVariableCompiledValue_SearchResults",
|
529
561
|
"NodeInputVariableCompiledValue_String",
|
562
|
+
"NodeOutputCompiledArrayValue",
|
530
563
|
"NodeOutputCompiledChatHistoryValue",
|
531
564
|
"NodeOutputCompiledErrorValue",
|
565
|
+
"NodeOutputCompiledFunctionValue",
|
532
566
|
"NodeOutputCompiledJsonValue",
|
533
567
|
"NodeOutputCompiledNumberValue",
|
534
568
|
"NodeOutputCompiledSearchResultsValue",
|
535
569
|
"NodeOutputCompiledStringValue",
|
536
570
|
"NodeOutputCompiledValue",
|
571
|
+
"NodeOutputCompiledValue_Array",
|
537
572
|
"NodeOutputCompiledValue_ChatHistory",
|
538
573
|
"NodeOutputCompiledValue_Error",
|
574
|
+
"NodeOutputCompiledValue_FunctionCall",
|
539
575
|
"NodeOutputCompiledValue_Json",
|
540
576
|
"NodeOutputCompiledValue_Number",
|
541
577
|
"NodeOutputCompiledValue_SearchResults",
|
@@ -544,6 +580,7 @@ __all__ = [
|
|
544
580
|
"NormalizedTokenLogProbs",
|
545
581
|
"NotFoundError",
|
546
582
|
"NumberEnum",
|
583
|
+
"NumberVariableValue",
|
547
584
|
"PaginatedSlimDeploymentReadList",
|
548
585
|
"PaginatedSlimDocumentList",
|
549
586
|
"PaginatedSlimWorkflowDeploymentList",
|
@@ -603,6 +640,7 @@ __all__ = [
|
|
603
640
|
"SearchResultMergingRequest",
|
604
641
|
"SearchResultRequest",
|
605
642
|
"SearchResultsEnum",
|
643
|
+
"SearchResultsVariableValue",
|
606
644
|
"SearchWeightsRequest",
|
607
645
|
"SlimDeploymentRead",
|
608
646
|
"SlimDocument",
|
@@ -676,6 +714,7 @@ __all__ = [
|
|
676
714
|
"VellumImageRequest",
|
677
715
|
"VellumVariable",
|
678
716
|
"VellumVariableType",
|
717
|
+
"WorkflowDeploymentRead",
|
679
718
|
"WorkflowDeploymentsListRequestStatus",
|
680
719
|
"WorkflowEventError",
|
681
720
|
"WorkflowExecutionActualChatHistoryRequest",
|
@@ -745,6 +784,7 @@ __all__ = [
|
|
745
784
|
"deployments",
|
746
785
|
"document_indexes",
|
747
786
|
"documents",
|
787
|
+
"folder_entities",
|
748
788
|
"model_versions",
|
749
789
|
"registered_prompts",
|
750
790
|
"sandboxes",
|
vellum/client.py
CHANGED
@@ -18,6 +18,7 @@ from .errors.not_found_error import NotFoundError
|
|
18
18
|
from .resources.deployments.client import AsyncDeploymentsClient, DeploymentsClient
|
19
19
|
from .resources.document_indexes.client import AsyncDocumentIndexesClient, DocumentIndexesClient
|
20
20
|
from .resources.documents.client import AsyncDocumentsClient, DocumentsClient
|
21
|
+
from .resources.folder_entities.client import AsyncFolderEntitiesClient, FolderEntitiesClient
|
21
22
|
from .resources.model_versions.client import AsyncModelVersionsClient, ModelVersionsClient
|
22
23
|
from .resources.registered_prompts.client import AsyncRegisteredPromptsClient, RegisteredPromptsClient
|
23
24
|
from .resources.sandboxes.client import AsyncSandboxesClient, SandboxesClient
|
@@ -67,6 +68,7 @@ class Vellum:
|
|
67
68
|
self.deployments = DeploymentsClient(client_wrapper=self._client_wrapper)
|
68
69
|
self.document_indexes = DocumentIndexesClient(client_wrapper=self._client_wrapper)
|
69
70
|
self.documents = DocumentsClient(client_wrapper=self._client_wrapper)
|
71
|
+
self.folder_entities = FolderEntitiesClient(client_wrapper=self._client_wrapper)
|
70
72
|
self.model_versions = ModelVersionsClient(client_wrapper=self._client_wrapper)
|
71
73
|
self.registered_prompts = RegisteredPromptsClient(client_wrapper=self._client_wrapper)
|
72
74
|
self.sandboxes = SandboxesClient(client_wrapper=self._client_wrapper)
|
@@ -98,7 +100,7 @@ class Vellum:
|
|
98
100
|
|
99
101
|
- release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
100
102
|
|
101
|
-
- external_id: typing.Optional[str].
|
103
|
+
- external_id: typing.Optional[str]. "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
102
104
|
|
103
105
|
- expand_meta: typing.Optional[PromptDeploymentExpandMetaRequestRequest]. The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
104
106
|
|
@@ -173,7 +175,7 @@ class Vellum:
|
|
173
175
|
|
174
176
|
- release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
175
177
|
|
176
|
-
- external_id: typing.Optional[str].
|
178
|
+
- external_id: typing.Optional[str]. "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
177
179
|
|
178
180
|
- expand_meta: typing.Optional[PromptDeploymentExpandMetaRequestRequest]. The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
179
181
|
|
@@ -249,7 +251,7 @@ class Vellum:
|
|
249
251
|
|
250
252
|
- inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's Deployment with their corresponding values.
|
251
253
|
|
252
|
-
- external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes.
|
254
|
+
- external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
|
253
255
|
"""
|
254
256
|
_request: typing.Dict[str, typing.Any] = {"inputs": inputs}
|
255
257
|
if workflow_deployment_id is not OMIT:
|
@@ -303,7 +305,7 @@ class Vellum:
|
|
303
305
|
|
304
306
|
- inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's deployment with their corresponding values.
|
305
307
|
|
306
|
-
- external_id: typing.Optional[str]. Optionally include a unique identifier for tracking purposes.
|
308
|
+
- external_id: typing.Optional[str]. Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
|
307
309
|
|
308
310
|
- event_types: typing.Optional[typing.List[WorkflowExecutionEventType]]. Optionally specify which events you want to receive. Defaults to only WORKFLOW events. Note that the schema of non-WORKFLOW events is unstable and should be used with caution.
|
309
311
|
"""
|
@@ -649,6 +651,7 @@ class AsyncVellum:
|
|
649
651
|
self.deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper)
|
650
652
|
self.document_indexes = AsyncDocumentIndexesClient(client_wrapper=self._client_wrapper)
|
651
653
|
self.documents = AsyncDocumentsClient(client_wrapper=self._client_wrapper)
|
654
|
+
self.folder_entities = AsyncFolderEntitiesClient(client_wrapper=self._client_wrapper)
|
652
655
|
self.model_versions = AsyncModelVersionsClient(client_wrapper=self._client_wrapper)
|
653
656
|
self.registered_prompts = AsyncRegisteredPromptsClient(client_wrapper=self._client_wrapper)
|
654
657
|
self.sandboxes = AsyncSandboxesClient(client_wrapper=self._client_wrapper)
|
@@ -680,7 +683,7 @@ class AsyncVellum:
|
|
680
683
|
|
681
684
|
- release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
682
685
|
|
683
|
-
- external_id: typing.Optional[str].
|
686
|
+
- external_id: typing.Optional[str]. "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
684
687
|
|
685
688
|
- expand_meta: typing.Optional[PromptDeploymentExpandMetaRequestRequest]. The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
686
689
|
|
@@ -755,7 +758,7 @@ class AsyncVellum:
|
|
755
758
|
|
756
759
|
- release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
757
760
|
|
758
|
-
- external_id: typing.Optional[str].
|
761
|
+
- external_id: typing.Optional[str]. "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
759
762
|
|
760
763
|
- expand_meta: typing.Optional[PromptDeploymentExpandMetaRequestRequest]. The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
761
764
|
|
@@ -831,7 +834,7 @@ class AsyncVellum:
|
|
831
834
|
|
832
835
|
- inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's Deployment with their corresponding values.
|
833
836
|
|
834
|
-
- external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes.
|
837
|
+
- external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
|
835
838
|
"""
|
836
839
|
_request: typing.Dict[str, typing.Any] = {"inputs": inputs}
|
837
840
|
if workflow_deployment_id is not OMIT:
|
@@ -885,7 +888,7 @@ class AsyncVellum:
|
|
885
888
|
|
886
889
|
- inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's deployment with their corresponding values.
|
887
890
|
|
888
|
-
- external_id: typing.Optional[str]. Optionally include a unique identifier for tracking purposes.
|
891
|
+
- external_id: typing.Optional[str]. Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
|
889
892
|
|
890
893
|
- event_types: typing.Optional[typing.List[WorkflowExecutionEventType]]. Optionally specify which events you want to receive. Defaults to only WORKFLOW events. Note that the schema of non-WORKFLOW events is unstable and should be used with caution.
|
891
894
|
"""
|
vellum/core/client_wrapper.py
CHANGED
vellum/resources/__init__.py
CHANGED
@@ -4,6 +4,7 @@ from . import (
|
|
4
4
|
deployments,
|
5
5
|
document_indexes,
|
6
6
|
documents,
|
7
|
+
folder_entities,
|
7
8
|
model_versions,
|
8
9
|
registered_prompts,
|
9
10
|
sandboxes,
|
@@ -19,6 +20,7 @@ __all__ = [
|
|
19
20
|
"deployments",
|
20
21
|
"document_indexes",
|
21
22
|
"documents",
|
23
|
+
"folder_entities",
|
22
24
|
"model_versions",
|
23
25
|
"registered_prompts",
|
24
26
|
"sandboxes",
|
@@ -43,7 +43,7 @@ class DeploymentsClient:
|
|
43
43
|
|
44
44
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
45
45
|
|
46
|
-
- status: typing.Optional[DeploymentsListRequestStatus].
|
46
|
+
- status: typing.Optional[DeploymentsListRequestStatus]. status
|
47
47
|
---
|
48
48
|
from vellum.client import Vellum
|
49
49
|
|
@@ -164,7 +164,7 @@ class AsyncDeploymentsClient:
|
|
164
164
|
|
165
165
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
166
166
|
|
167
|
-
- status: typing.Optional[DeploymentsListRequestStatus].
|
167
|
+
- status: typing.Optional[DeploymentsListRequestStatus]. status
|
168
168
|
---
|
169
169
|
from vellum.client import AsyncVellum
|
170
170
|
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
import urllib.parse
|
5
|
+
from json.decoder import JSONDecodeError
|
6
|
+
|
7
|
+
from ...core.api_error import ApiError
|
8
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
10
|
+
|
11
|
+
# this is used as the default value for optional parameters
|
12
|
+
OMIT = typing.cast(typing.Any, ...)
|
13
|
+
|
14
|
+
|
15
|
+
class FolderEntitiesClient:
|
16
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
17
|
+
self._client_wrapper = client_wrapper
|
18
|
+
|
19
|
+
def add_entity_to_folder(self, folder_id: str, *, entity_id: str) -> None:
|
20
|
+
"""
|
21
|
+
Add an entity to a specific folder or root directory.
|
22
|
+
|
23
|
+
Adding an entity to a folder will remove it from any other folders it might have been a member of.
|
24
|
+
|
25
|
+
Parameters:
|
26
|
+
- folder_id: str. The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
|
27
|
+
|
28
|
+
- entity_id: str. The ID of the entity you would like to move.
|
29
|
+
---
|
30
|
+
from vellum.client import Vellum
|
31
|
+
|
32
|
+
client = Vellum(
|
33
|
+
api_key="YOUR_API_KEY",
|
34
|
+
)
|
35
|
+
client.folder_entities.add_entity_to_folder(
|
36
|
+
folder_id="folder_id",
|
37
|
+
entity_id="entity_id",
|
38
|
+
)
|
39
|
+
"""
|
40
|
+
_response = self._client_wrapper.httpx_client.request(
|
41
|
+
"POST",
|
42
|
+
urllib.parse.urljoin(
|
43
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/folders/{folder_id}/add-entity"
|
44
|
+
),
|
45
|
+
json=jsonable_encoder({"entity_id": entity_id}),
|
46
|
+
headers=self._client_wrapper.get_headers(),
|
47
|
+
timeout=None,
|
48
|
+
)
|
49
|
+
if 200 <= _response.status_code < 300:
|
50
|
+
return
|
51
|
+
try:
|
52
|
+
_response_json = _response.json()
|
53
|
+
except JSONDecodeError:
|
54
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
55
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
56
|
+
|
57
|
+
|
58
|
+
class AsyncFolderEntitiesClient:
|
59
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
60
|
+
self._client_wrapper = client_wrapper
|
61
|
+
|
62
|
+
async def add_entity_to_folder(self, folder_id: str, *, entity_id: str) -> None:
|
63
|
+
"""
|
64
|
+
Add an entity to a specific folder or root directory.
|
65
|
+
|
66
|
+
Adding an entity to a folder will remove it from any other folders it might have been a member of.
|
67
|
+
|
68
|
+
Parameters:
|
69
|
+
- folder_id: str. The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
|
70
|
+
|
71
|
+
- entity_id: str. The ID of the entity you would like to move.
|
72
|
+
---
|
73
|
+
from vellum.client import AsyncVellum
|
74
|
+
|
75
|
+
client = AsyncVellum(
|
76
|
+
api_key="YOUR_API_KEY",
|
77
|
+
)
|
78
|
+
await client.folder_entities.add_entity_to_folder(
|
79
|
+
folder_id="folder_id",
|
80
|
+
entity_id="entity_id",
|
81
|
+
)
|
82
|
+
"""
|
83
|
+
_response = await self._client_wrapper.httpx_client.request(
|
84
|
+
"POST",
|
85
|
+
urllib.parse.urljoin(
|
86
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/folders/{folder_id}/add-entity"
|
87
|
+
),
|
88
|
+
json=jsonable_encoder({"entity_id": entity_id}),
|
89
|
+
headers=self._client_wrapper.get_headers(),
|
90
|
+
timeout=None,
|
91
|
+
)
|
92
|
+
if 200 <= _response.status_code < 300:
|
93
|
+
return
|
94
|
+
try:
|
95
|
+
_response_json = _response.json()
|
96
|
+
except JSONDecodeError:
|
97
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
98
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
@@ -8,6 +8,7 @@ from ...core.api_error import ApiError
|
|
8
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
10
10
|
from ...types.paginated_slim_workflow_deployment_list import PaginatedSlimWorkflowDeploymentList
|
11
|
+
from ...types.workflow_deployment_read import WorkflowDeploymentRead
|
11
12
|
from .types.workflow_deployments_list_request_status import WorkflowDeploymentsListRequestStatus
|
12
13
|
|
13
14
|
try:
|
@@ -36,10 +37,8 @@ class WorkflowDeploymentsClient:
|
|
36
37
|
|
37
38
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
38
39
|
|
39
|
-
- status: typing.Optional[WorkflowDeploymentsListRequestStatus].
|
40
|
-
|
41
|
-
- `ACTIVE` - Active
|
42
|
-
- `ARCHIVED` - Archived---
|
40
|
+
- status: typing.Optional[WorkflowDeploymentsListRequestStatus]. status
|
41
|
+
---
|
43
42
|
from vellum.client import Vellum
|
44
43
|
|
45
44
|
client = Vellum(
|
@@ -62,6 +61,36 @@ class WorkflowDeploymentsClient:
|
|
62
61
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
63
62
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
64
63
|
|
64
|
+
def retrieve(self, id: str) -> WorkflowDeploymentRead:
|
65
|
+
"""
|
66
|
+
Used to retrieve a workflow deployment given its ID or name.
|
67
|
+
|
68
|
+
Parameters:
|
69
|
+
- id: str. Either the Workflow Deployment's ID or its unique name
|
70
|
+
---
|
71
|
+
from vellum.client import Vellum
|
72
|
+
|
73
|
+
client = Vellum(
|
74
|
+
api_key="YOUR_API_KEY",
|
75
|
+
)
|
76
|
+
client.workflow_deployments.retrieve(
|
77
|
+
id="id",
|
78
|
+
)
|
79
|
+
"""
|
80
|
+
_response = self._client_wrapper.httpx_client.request(
|
81
|
+
"GET",
|
82
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/workflow-deployments/{id}"),
|
83
|
+
headers=self._client_wrapper.get_headers(),
|
84
|
+
timeout=None,
|
85
|
+
)
|
86
|
+
if 200 <= _response.status_code < 300:
|
87
|
+
return pydantic.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
88
|
+
try:
|
89
|
+
_response_json = _response.json()
|
90
|
+
except JSONDecodeError:
|
91
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
92
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
93
|
+
|
65
94
|
|
66
95
|
class AsyncWorkflowDeploymentsClient:
|
67
96
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -83,10 +112,8 @@ class AsyncWorkflowDeploymentsClient:
|
|
83
112
|
|
84
113
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
85
114
|
|
86
|
-
- status: typing.Optional[WorkflowDeploymentsListRequestStatus].
|
87
|
-
|
88
|
-
- `ACTIVE` - Active
|
89
|
-
- `ARCHIVED` - Archived---
|
115
|
+
- status: typing.Optional[WorkflowDeploymentsListRequestStatus]. status
|
116
|
+
---
|
90
117
|
from vellum.client import AsyncVellum
|
91
118
|
|
92
119
|
client = AsyncVellum(
|
@@ -108,3 +135,33 @@ class AsyncWorkflowDeploymentsClient:
|
|
108
135
|
except JSONDecodeError:
|
109
136
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
110
137
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
138
|
+
|
139
|
+
async def retrieve(self, id: str) -> WorkflowDeploymentRead:
|
140
|
+
"""
|
141
|
+
Used to retrieve a workflow deployment given its ID or name.
|
142
|
+
|
143
|
+
Parameters:
|
144
|
+
- id: str. Either the Workflow Deployment's ID or its unique name
|
145
|
+
---
|
146
|
+
from vellum.client import AsyncVellum
|
147
|
+
|
148
|
+
client = AsyncVellum(
|
149
|
+
api_key="YOUR_API_KEY",
|
150
|
+
)
|
151
|
+
await client.workflow_deployments.retrieve(
|
152
|
+
id="id",
|
153
|
+
)
|
154
|
+
"""
|
155
|
+
_response = await self._client_wrapper.httpx_client.request(
|
156
|
+
"GET",
|
157
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/workflow-deployments/{id}"),
|
158
|
+
headers=self._client_wrapper.get_headers(),
|
159
|
+
timeout=None,
|
160
|
+
)
|
161
|
+
if 200 <= _response.status_code < 300:
|
162
|
+
return pydantic.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
163
|
+
try:
|
164
|
+
_response_json = _response.json()
|
165
|
+
except JSONDecodeError:
|
166
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
167
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
vellum/types/__init__.py
CHANGED
@@ -16,9 +16,21 @@ from .array_chat_message_content_item_request import (
|
|
16
16
|
ArrayChatMessageContentItemRequest_String,
|
17
17
|
)
|
18
18
|
from .array_chat_message_content_request import ArrayChatMessageContentRequest
|
19
|
+
from .array_enum import ArrayEnum
|
20
|
+
from .array_variable_value_item import (
|
21
|
+
ArrayVariableValueItem,
|
22
|
+
ArrayVariableValueItem_ChatHistory,
|
23
|
+
ArrayVariableValueItem_Error,
|
24
|
+
ArrayVariableValueItem_FunctionCall,
|
25
|
+
ArrayVariableValueItem_Json,
|
26
|
+
ArrayVariableValueItem_Number,
|
27
|
+
ArrayVariableValueItem_SearchResults,
|
28
|
+
ArrayVariableValueItem_String,
|
29
|
+
)
|
19
30
|
from .block_type_enum import BlockTypeEnum
|
20
31
|
from .chat_history_enum import ChatHistoryEnum
|
21
32
|
from .chat_history_input_request import ChatHistoryInputRequest
|
33
|
+
from .chat_history_variable_value import ChatHistoryVariableValue
|
22
34
|
from .chat_message import ChatMessage
|
23
35
|
from .chat_message_content import (
|
24
36
|
ChatMessageContent,
|
@@ -149,6 +161,7 @@ from .named_test_case_variable_value_request import (
|
|
149
161
|
NamedTestCaseVariableValueRequest_SearchResults,
|
150
162
|
NamedTestCaseVariableValueRequest_String,
|
151
163
|
)
|
164
|
+
from .node_input_compiled_array_value import NodeInputCompiledArrayValue
|
152
165
|
from .node_input_compiled_chat_history_value import NodeInputCompiledChatHistoryValue
|
153
166
|
from .node_input_compiled_error_value import NodeInputCompiledErrorValue
|
154
167
|
from .node_input_compiled_json_value import NodeInputCompiledJsonValue
|
@@ -157,6 +170,7 @@ from .node_input_compiled_search_results_value import NodeInputCompiledSearchRes
|
|
157
170
|
from .node_input_compiled_string_value import NodeInputCompiledStringValue
|
158
171
|
from .node_input_variable_compiled_value import (
|
159
172
|
NodeInputVariableCompiledValue,
|
173
|
+
NodeInputVariableCompiledValue_Array,
|
160
174
|
NodeInputVariableCompiledValue_ChatHistory,
|
161
175
|
NodeInputVariableCompiledValue_Error,
|
162
176
|
NodeInputVariableCompiledValue_Json,
|
@@ -164,16 +178,20 @@ from .node_input_variable_compiled_value import (
|
|
164
178
|
NodeInputVariableCompiledValue_SearchResults,
|
165
179
|
NodeInputVariableCompiledValue_String,
|
166
180
|
)
|
181
|
+
from .node_output_compiled_array_value import NodeOutputCompiledArrayValue
|
167
182
|
from .node_output_compiled_chat_history_value import NodeOutputCompiledChatHistoryValue
|
168
183
|
from .node_output_compiled_error_value import NodeOutputCompiledErrorValue
|
184
|
+
from .node_output_compiled_function_value import NodeOutputCompiledFunctionValue
|
169
185
|
from .node_output_compiled_json_value import NodeOutputCompiledJsonValue
|
170
186
|
from .node_output_compiled_number_value import NodeOutputCompiledNumberValue
|
171
187
|
from .node_output_compiled_search_results_value import NodeOutputCompiledSearchResultsValue
|
172
188
|
from .node_output_compiled_string_value import NodeOutputCompiledStringValue
|
173
189
|
from .node_output_compiled_value import (
|
174
190
|
NodeOutputCompiledValue,
|
191
|
+
NodeOutputCompiledValue_Array,
|
175
192
|
NodeOutputCompiledValue_ChatHistory,
|
176
193
|
NodeOutputCompiledValue_Error,
|
194
|
+
NodeOutputCompiledValue_FunctionCall,
|
177
195
|
NodeOutputCompiledValue_Json,
|
178
196
|
NodeOutputCompiledValue_Number,
|
179
197
|
NodeOutputCompiledValue_SearchResults,
|
@@ -182,6 +200,7 @@ from .node_output_compiled_value import (
|
|
182
200
|
from .normalized_log_probs import NormalizedLogProbs
|
183
201
|
from .normalized_token_log_probs import NormalizedTokenLogProbs
|
184
202
|
from .number_enum import NumberEnum
|
203
|
+
from .number_variable_value import NumberVariableValue
|
185
204
|
from .paginated_slim_deployment_read_list import PaginatedSlimDeploymentReadList
|
186
205
|
from .paginated_slim_document_list import PaginatedSlimDocumentList
|
187
206
|
from .paginated_slim_workflow_deployment_list import PaginatedSlimWorkflowDeploymentList
|
@@ -245,6 +264,7 @@ from .search_result_document_request import SearchResultDocumentRequest
|
|
245
264
|
from .search_result_merging_request import SearchResultMergingRequest
|
246
265
|
from .search_result_request import SearchResultRequest
|
247
266
|
from .search_results_enum import SearchResultsEnum
|
267
|
+
from .search_results_variable_value import SearchResultsVariableValue
|
248
268
|
from .search_weights_request import SearchWeightsRequest
|
249
269
|
from .slim_deployment_read import SlimDeploymentRead
|
250
270
|
from .slim_document import SlimDocument
|
@@ -325,6 +345,7 @@ from .vellum_image import VellumImage
|
|
325
345
|
from .vellum_image_request import VellumImageRequest
|
326
346
|
from .vellum_variable import VellumVariable
|
327
347
|
from .vellum_variable_type import VellumVariableType
|
348
|
+
from .workflow_deployment_read import WorkflowDeploymentRead
|
328
349
|
from .workflow_event_error import WorkflowEventError
|
329
350
|
from .workflow_execution_actual_chat_history_request import WorkflowExecutionActualChatHistoryRequest
|
330
351
|
from .workflow_execution_actual_json_request import WorkflowExecutionActualJsonRequest
|
@@ -412,9 +433,19 @@ __all__ = [
|
|
412
433
|
"ArrayChatMessageContentItem_Image",
|
413
434
|
"ArrayChatMessageContentItem_String",
|
414
435
|
"ArrayChatMessageContentRequest",
|
436
|
+
"ArrayEnum",
|
437
|
+
"ArrayVariableValueItem",
|
438
|
+
"ArrayVariableValueItem_ChatHistory",
|
439
|
+
"ArrayVariableValueItem_Error",
|
440
|
+
"ArrayVariableValueItem_FunctionCall",
|
441
|
+
"ArrayVariableValueItem_Json",
|
442
|
+
"ArrayVariableValueItem_Number",
|
443
|
+
"ArrayVariableValueItem_SearchResults",
|
444
|
+
"ArrayVariableValueItem_String",
|
415
445
|
"BlockTypeEnum",
|
416
446
|
"ChatHistoryEnum",
|
417
447
|
"ChatHistoryInputRequest",
|
448
|
+
"ChatHistoryVariableValue",
|
418
449
|
"ChatMessage",
|
419
450
|
"ChatMessageContent",
|
420
451
|
"ChatMessageContentRequest",
|
@@ -533,6 +564,7 @@ __all__ = [
|
|
533
564
|
"NamedTestCaseVariableValueRequest_Number",
|
534
565
|
"NamedTestCaseVariableValueRequest_SearchResults",
|
535
566
|
"NamedTestCaseVariableValueRequest_String",
|
567
|
+
"NodeInputCompiledArrayValue",
|
536
568
|
"NodeInputCompiledChatHistoryValue",
|
537
569
|
"NodeInputCompiledErrorValue",
|
538
570
|
"NodeInputCompiledJsonValue",
|
@@ -540,21 +572,26 @@ __all__ = [
|
|
540
572
|
"NodeInputCompiledSearchResultsValue",
|
541
573
|
"NodeInputCompiledStringValue",
|
542
574
|
"NodeInputVariableCompiledValue",
|
575
|
+
"NodeInputVariableCompiledValue_Array",
|
543
576
|
"NodeInputVariableCompiledValue_ChatHistory",
|
544
577
|
"NodeInputVariableCompiledValue_Error",
|
545
578
|
"NodeInputVariableCompiledValue_Json",
|
546
579
|
"NodeInputVariableCompiledValue_Number",
|
547
580
|
"NodeInputVariableCompiledValue_SearchResults",
|
548
581
|
"NodeInputVariableCompiledValue_String",
|
582
|
+
"NodeOutputCompiledArrayValue",
|
549
583
|
"NodeOutputCompiledChatHistoryValue",
|
550
584
|
"NodeOutputCompiledErrorValue",
|
585
|
+
"NodeOutputCompiledFunctionValue",
|
551
586
|
"NodeOutputCompiledJsonValue",
|
552
587
|
"NodeOutputCompiledNumberValue",
|
553
588
|
"NodeOutputCompiledSearchResultsValue",
|
554
589
|
"NodeOutputCompiledStringValue",
|
555
590
|
"NodeOutputCompiledValue",
|
591
|
+
"NodeOutputCompiledValue_Array",
|
556
592
|
"NodeOutputCompiledValue_ChatHistory",
|
557
593
|
"NodeOutputCompiledValue_Error",
|
594
|
+
"NodeOutputCompiledValue_FunctionCall",
|
558
595
|
"NodeOutputCompiledValue_Json",
|
559
596
|
"NodeOutputCompiledValue_Number",
|
560
597
|
"NodeOutputCompiledValue_SearchResults",
|
@@ -562,6 +599,7 @@ __all__ = [
|
|
562
599
|
"NormalizedLogProbs",
|
563
600
|
"NormalizedTokenLogProbs",
|
564
601
|
"NumberEnum",
|
602
|
+
"NumberVariableValue",
|
565
603
|
"PaginatedSlimDeploymentReadList",
|
566
604
|
"PaginatedSlimDocumentList",
|
567
605
|
"PaginatedSlimWorkflowDeploymentList",
|
@@ -621,6 +659,7 @@ __all__ = [
|
|
621
659
|
"SearchResultMergingRequest",
|
622
660
|
"SearchResultRequest",
|
623
661
|
"SearchResultsEnum",
|
662
|
+
"SearchResultsVariableValue",
|
624
663
|
"SearchWeightsRequest",
|
625
664
|
"SlimDeploymentRead",
|
626
665
|
"SlimDocument",
|
@@ -693,6 +732,7 @@ __all__ = [
|
|
693
732
|
"VellumImageRequest",
|
694
733
|
"VellumVariable",
|
695
734
|
"VellumVariableType",
|
735
|
+
"WorkflowDeploymentRead",
|
696
736
|
"WorkflowEventError",
|
697
737
|
"WorkflowExecutionActualChatHistoryRequest",
|
698
738
|
"WorkflowExecutionActualJsonRequest",
|