vellum-ai 1.1.1__py3-none-any.whl → 1.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/__init__.py +16 -0
- vellum/client/README.md +55 -0
- vellum/client/__init__.py +66 -507
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/pydantic_utilities.py +10 -3
- vellum/client/raw_client.py +844 -0
- vellum/client/reference.md +692 -19
- vellum/client/resources/ad_hoc/client.py +23 -180
- vellum/client/resources/ad_hoc/raw_client.py +276 -0
- vellum/client/resources/container_images/client.py +10 -36
- vellum/client/resources/deployments/client.py +16 -62
- vellum/client/resources/document_indexes/client.py +16 -72
- vellum/client/resources/documents/client.py +8 -30
- vellum/client/resources/folder_entities/client.py +4 -8
- vellum/client/resources/metric_definitions/client.py +4 -14
- vellum/client/resources/ml_models/client.py +2 -8
- vellum/client/resources/organizations/client.py +2 -6
- vellum/client/resources/prompts/client.py +2 -10
- vellum/client/resources/sandboxes/client.py +4 -20
- vellum/client/resources/test_suite_runs/client.py +4 -18
- vellum/client/resources/test_suites/client.py +11 -86
- vellum/client/resources/test_suites/raw_client.py +136 -0
- vellum/client/resources/workflow_deployments/client.py +20 -78
- vellum/client/resources/workflow_executions/client.py +2 -6
- vellum/client/resources/workflow_sandboxes/client.py +2 -10
- vellum/client/resources/workflows/client.py +7 -6
- vellum/client/resources/workflows/raw_client.py +58 -47
- vellum/client/resources/workspace_secrets/client.py +4 -20
- vellum/client/resources/workspaces/client.py +2 -6
- vellum/client/types/__init__.py +16 -0
- vellum/client/types/array_chat_message_content_item.py +4 -2
- vellum/client/types/array_chat_message_content_item_request.py +4 -2
- vellum/client/types/chat_message_content.py +4 -2
- vellum/client/types/chat_message_content_request.py +4 -2
- vellum/client/types/node_execution_span.py +2 -0
- vellum/client/types/prompt_block.py +4 -2
- vellum/client/types/vellum_value.py +4 -2
- vellum/client/types/vellum_value_request.py +4 -2
- vellum/client/types/vellum_variable_type.py +2 -1
- vellum/client/types/vellum_video.py +24 -0
- vellum/client/types/vellum_video_request.py +24 -0
- vellum/client/types/video_chat_message_content.py +25 -0
- vellum/client/types/video_chat_message_content_request.py +25 -0
- vellum/client/types/video_prompt_block.py +29 -0
- vellum/client/types/video_vellum_value.py +25 -0
- vellum/client/types/video_vellum_value_request.py +25 -0
- vellum/client/types/workflow_execution_span.py +2 -0
- vellum/client/types/workflow_execution_usage_calculation_fulfilled_body.py +22 -0
- vellum/prompts/blocks/compilation.py +22 -10
- vellum/types/vellum_video.py +3 -0
- vellum/types/vellum_video_request.py +3 -0
- vellum/types/video_chat_message_content.py +3 -0
- vellum/types/video_chat_message_content_request.py +3 -0
- vellum/types/video_prompt_block.py +3 -0
- vellum/types/video_vellum_value.py +3 -0
- vellum/types/video_vellum_value_request.py +3 -0
- vellum/types/workflow_execution_usage_calculation_fulfilled_body.py +3 -0
- vellum/workflows/events/workflow.py +11 -0
- vellum/workflows/graph/graph.py +103 -1
- vellum/workflows/graph/tests/test_graph.py +99 -0
- vellum/workflows/nodes/bases/base.py +9 -1
- vellum/workflows/nodes/displayable/bases/utils.py +4 -2
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +19 -18
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py +17 -7
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py +7 -7
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +47 -80
- vellum/workflows/references/environment_variable.py +10 -0
- vellum/workflows/runner/runner.py +18 -2
- vellum/workflows/state/context.py +101 -12
- vellum/workflows/types/definition.py +11 -1
- vellum/workflows/types/tests/test_definition.py +19 -0
- vellum/workflows/utils/vellum_variables.py +9 -5
- vellum/workflows/workflows/base.py +12 -5
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.3.dist-info}/METADATA +1 -1
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.3.dist-info}/RECORD +85 -69
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +55 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +15 -52
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +15 -49
- vellum_ee/workflows/display/types.py +14 -1
- vellum_ee/workflows/display/utils/expressions.py +13 -4
- vellum_ee/workflows/display/workflows/base_workflow_display.py +6 -19
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.3.dist-info}/LICENSE +0 -0
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.3.dist-info}/WHEEL +0 -0
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.3.dist-info}/entry_points.txt +0 -0
@@ -45,54 +45,20 @@ def test_serialize_workflow():
|
|
45
45
|
"id": "20adf593-c4f0-4c67-8e36-37eb66f28f66",
|
46
46
|
"name": "functions",
|
47
47
|
"value": {
|
48
|
-
"type": "
|
49
|
-
"
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
{
|
64
|
-
"id": "641decf3-79c5-4ef9-9fc8-06570d8a69af",
|
65
|
-
"key": "url",
|
66
|
-
"value": {
|
67
|
-
"type": "CONSTANT_VALUE",
|
68
|
-
"value": {"type": "STRING", "value": "https://api.githubcopilot.com/mcp/"},
|
69
|
-
},
|
70
|
-
},
|
71
|
-
{
|
72
|
-
"id": "801a74ca-7966-4ac3-b1b5-bebb71a7de07",
|
73
|
-
"key": "authorization_type",
|
74
|
-
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "BEARER_TOKEN"}},
|
75
|
-
},
|
76
|
-
{
|
77
|
-
"id": "fcd70e2f-0fb2-4011-a73b-90d5d7643be4",
|
78
|
-
"key": "bearer_token_value",
|
79
|
-
"value": {
|
80
|
-
"type": "ENVIRONMENT_VARIABLE",
|
81
|
-
"environment_variable": "GITHUB_PERSONAL_ACCESS_TOKEN",
|
82
|
-
},
|
83
|
-
},
|
84
|
-
{
|
85
|
-
"id": "b2fa2900-0e09-44ff-99db-c5399fd76d28",
|
86
|
-
"key": "api_key_header_key",
|
87
|
-
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
88
|
-
},
|
89
|
-
{
|
90
|
-
"id": "6ab23414-5f1b-49c1-a0bc-891bbba9124c",
|
91
|
-
"key": "api_key_header_value",
|
92
|
-
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
93
|
-
},
|
94
|
-
],
|
95
|
-
}
|
96
|
-
],
|
48
|
+
"type": "CONSTANT_VALUE",
|
49
|
+
"value": {
|
50
|
+
"type": "JSON",
|
51
|
+
"value": [
|
52
|
+
{
|
53
|
+
"type": "MCP_SERVER",
|
54
|
+
"name": "github",
|
55
|
+
"url": "https://api.githubcopilot.com/mcp/",
|
56
|
+
"authorization_type": "BEARER_TOKEN",
|
57
|
+
"bearer_token_value": "GITHUB_PERSONAL_ACCESS_TOKEN",
|
58
|
+
"api_key_header_key": None,
|
59
|
+
"api_key_header_value": None,
|
60
|
+
}
|
61
|
+
],
|
62
|
+
},
|
97
63
|
},
|
98
64
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from dataclasses import dataclass, field
|
2
|
-
from typing import TYPE_CHECKING, Dict, Tuple, Type
|
2
|
+
from typing import TYPE_CHECKING, Dict, Iterator, List, Tuple, Type
|
3
3
|
|
4
4
|
from vellum.client import Vellum as VellumClient
|
5
5
|
from vellum.workflows.descriptors.base import BaseDescriptor
|
@@ -51,3 +51,16 @@ class WorkflowDisplayContext:
|
|
51
51
|
workflow_output_displays: WorkflowOutputDisplays = field(default_factory=dict)
|
52
52
|
edge_displays: EdgeDisplays = field(default_factory=dict)
|
53
53
|
port_displays: PortDisplays = field(default_factory=dict)
|
54
|
+
_errors: List[Exception] = field(default_factory=list)
|
55
|
+
_dry_run: bool = False
|
56
|
+
|
57
|
+
def add_error(self, error: Exception) -> None:
|
58
|
+
if self._dry_run:
|
59
|
+
self._errors.append(error)
|
60
|
+
return
|
61
|
+
|
62
|
+
raise error
|
63
|
+
|
64
|
+
@property
|
65
|
+
def errors(self) -> Iterator[Exception]:
|
66
|
+
return iter(self._errors)
|
@@ -266,10 +266,19 @@ def serialize_value(display_context: "WorkflowDisplayContext", value: Any) -> Js
|
|
266
266
|
}
|
267
267
|
|
268
268
|
if isinstance(value, EnvironmentVariableReference):
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
269
|
+
if value.serialize_as_constant:
|
270
|
+
return {
|
271
|
+
"type": "CONSTANT_VALUE",
|
272
|
+
"value": {
|
273
|
+
"type": "STRING",
|
274
|
+
"value": value.name,
|
275
|
+
},
|
276
|
+
}
|
277
|
+
else:
|
278
|
+
return {
|
279
|
+
"type": "ENVIRONMENT_VARIABLE",
|
280
|
+
"environment_variable": value.name,
|
281
|
+
}
|
273
282
|
|
274
283
|
if isinstance(value, ExecutionCountReference):
|
275
284
|
node_class_display = display_context.global_node_displays[value.node_class]
|
@@ -6,7 +6,7 @@ import inspect
|
|
6
6
|
import logging
|
7
7
|
import os
|
8
8
|
from uuid import UUID
|
9
|
-
from typing import Any, Dict, ForwardRef, Generic,
|
9
|
+
from typing import Any, Dict, ForwardRef, Generic, List, Optional, Tuple, Type, TypeVar, Union, cast, get_args
|
10
10
|
|
11
11
|
from vellum.client import Vellum as VellumClient
|
12
12
|
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
@@ -96,8 +96,6 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
96
96
|
# Used to explicitly specify display data for a workflow's ports.
|
97
97
|
port_displays: PortDisplays = {}
|
98
98
|
|
99
|
-
_errors: List[Exception]
|
100
|
-
|
101
99
|
_serialized_files: List[str]
|
102
100
|
|
103
101
|
_dry_run: bool
|
@@ -116,7 +114,6 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
116
114
|
if self._parent_display_context
|
117
115
|
else create_vellum_client()
|
118
116
|
)
|
119
|
-
self._errors = []
|
120
117
|
self._serialized_files = []
|
121
118
|
self._dry_run = dry_run
|
122
119
|
|
@@ -196,7 +193,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
196
193
|
try:
|
197
194
|
serialized_node = node_display.serialize(self.display_context)
|
198
195
|
except (NotImplementedError, NodeValidationError) as e:
|
199
|
-
self.add_error(e)
|
196
|
+
self.display_context.add_error(e)
|
200
197
|
continue
|
201
198
|
|
202
199
|
serialized_nodes[node_display.node_id] = serialized_node
|
@@ -315,7 +312,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
315
312
|
# If there are terminal nodes with no workflow output reference,
|
316
313
|
# raise a serialization error
|
317
314
|
if len(unreferenced_final_output_node_outputs) > 0:
|
318
|
-
self.add_error(
|
315
|
+
self.display_context.add_error(
|
319
316
|
ValueError("Unable to serialize terminal nodes that are not referenced by workflow outputs.")
|
320
317
|
)
|
321
318
|
|
@@ -375,7 +372,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
375
372
|
try:
|
376
373
|
self._apply_auto_layout(nodes_dict_list, edges)
|
377
374
|
except Exception as e:
|
378
|
-
self.add_error(e)
|
375
|
+
self.display_context.add_error(e)
|
379
376
|
|
380
377
|
return {
|
381
378
|
"workflow_raw_data": {
|
@@ -446,17 +443,6 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
446
443
|
"""Can be overridden as a class attribute to specify a custom workflow id."""
|
447
444
|
return self._workflow.__id__
|
448
445
|
|
449
|
-
def add_error(self, error: Exception) -> None:
|
450
|
-
if self._dry_run:
|
451
|
-
self._errors.append(error)
|
452
|
-
return
|
453
|
-
|
454
|
-
raise error
|
455
|
-
|
456
|
-
@property
|
457
|
-
def errors(self) -> Iterator[Exception]:
|
458
|
-
return iter(self._errors)
|
459
|
-
|
460
446
|
def _enrich_global_node_output_displays(
|
461
447
|
self,
|
462
448
|
node: Type[BaseNode],
|
@@ -606,6 +592,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
606
592
|
edge_displays=edge_displays,
|
607
593
|
port_displays=port_displays,
|
608
594
|
workflow_display_class=self.__class__,
|
595
|
+
_dry_run=self._dry_run,
|
609
596
|
)
|
610
597
|
|
611
598
|
def _generate_workflow_meta_display(self) -> WorkflowMetaDisplay:
|
@@ -896,7 +883,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
896
883
|
|
897
884
|
return WorkflowSerializationResult(
|
898
885
|
exec_config=exec_config,
|
899
|
-
errors=[str(error) for error in workflow_display.errors],
|
886
|
+
errors=[str(error) for error in workflow_display.display_context.errors],
|
900
887
|
)
|
901
888
|
|
902
889
|
def _gather_additional_module_files(self, module_path: str) -> Dict[str, str]:
|
File without changes
|
File without changes
|
File without changes
|