vellum-ai 0.14.15__py3-none-any.whl → 0.14.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/__init__.py +2 -0
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/resources/document_indexes/client.py +0 -55
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/document_index_read.py +0 -10
- vellum/client/types/release.py +21 -0
- vellum/client/types/workflow_release_tag_read.py +7 -1
- vellum/plugins/pydantic.py +14 -4
- vellum/prompts/blocks/compilation.py +14 -0
- vellum/types/release.py +3 -0
- vellum/workflows/nodes/bases/base.py +7 -7
- vellum/workflows/nodes/bases/base_adornment_node.py +2 -0
- vellum/workflows/nodes/core/retry_node/node.py +1 -1
- vellum/workflows/nodes/core/try_node/node.py +1 -1
- vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py +4 -0
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +27 -1
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/__init__.py +0 -0
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py +182 -0
- vellum/workflows/nodes/displayable/inline_prompt_node/node.py +4 -1
- vellum/workflows/nodes/experimental/openai_chat_completion_node/node.py +7 -1
- vellum/workflows/utils/tests/test_vellum_variables.py +7 -1
- vellum/workflows/utils/vellum_variables.py +4 -0
- vellum/workflows/vellum_client.py +9 -5
- {vellum_ai-0.14.15.dist-info → vellum_ai-0.14.17.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.15.dist-info → vellum_ai-0.14.17.dist-info}/RECORD +40 -35
- vellum_cli/image_push.py +76 -42
- vellum_cli/tests/test_image_push.py +56 -0
- vellum_ee/workflows/display/nodes/base_node_display.py +35 -29
- vellum_ee/workflows/display/nodes/get_node_display_class.py +0 -9
- vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py +38 -18
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +1 -0
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py +29 -33
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py +91 -106
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py +33 -38
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py +138 -153
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py +23 -26
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +51 -7
- {vellum_ai-0.14.15.dist-info → vellum_ai-0.14.17.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.15.dist-info → vellum_ai-0.14.17.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.15.dist-info → vellum_ai-0.14.17.dist-info}/entry_points.txt +0 -0
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py
CHANGED
@@ -9,16 +9,15 @@ class Inputs(BaseInputs):
|
|
9
9
|
input: str
|
10
10
|
|
11
11
|
|
12
|
-
class BasicGenericNode(BaseNode):
|
13
|
-
pass
|
14
|
-
|
15
|
-
|
16
12
|
def test_serialize_node__basic(serialize_node):
|
13
|
+
class BasicGenericNode(BaseNode):
|
14
|
+
pass
|
15
|
+
|
17
16
|
serialized_node = serialize_node(BasicGenericNode)
|
18
17
|
assert not DeepDiff(
|
19
18
|
{
|
20
|
-
"id": "
|
21
|
-
"label": "BasicGenericNode",
|
19
|
+
"id": "8d7cbfe4-72ca-4367-a401-8d28723d2f00",
|
20
|
+
"label": "test_serialize_node__basic.<locals>.BasicGenericNode",
|
22
21
|
"type": "GENERIC",
|
23
22
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
24
23
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -34,10 +33,10 @@ def test_serialize_node__basic(serialize_node):
|
|
34
33
|
"test_trigger_serialization",
|
35
34
|
],
|
36
35
|
},
|
37
|
-
"trigger": {"id": "
|
36
|
+
"trigger": {"id": "be19c63b-3492-46b1-be9d-16f8d2e6410b", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
38
37
|
"ports": [
|
39
38
|
{
|
40
|
-
"id": "
|
39
|
+
"id": "8bec8d0c-113f-4110-afcb-4a6e566e7236",
|
41
40
|
"name": "default",
|
42
41
|
"type": "DEFAULT",
|
43
42
|
}
|
@@ -51,17 +50,16 @@ def test_serialize_node__basic(serialize_node):
|
|
51
50
|
)
|
52
51
|
|
53
52
|
|
54
|
-
class AwaitAnyGenericNode(BaseNode):
|
55
|
-
class Trigger(BaseNode.Trigger):
|
56
|
-
merge_behavior = MergeBehavior.AWAIT_ANY
|
57
|
-
|
58
|
-
|
59
53
|
def test_serialize_node__await_any(serialize_node):
|
54
|
+
class AwaitAnyGenericNode(BaseNode):
|
55
|
+
class Trigger(BaseNode.Trigger):
|
56
|
+
merge_behavior = MergeBehavior.AWAIT_ANY
|
57
|
+
|
60
58
|
serialized_node = serialize_node(AwaitAnyGenericNode)
|
61
59
|
assert not DeepDiff(
|
62
60
|
{
|
63
|
-
"id": "
|
64
|
-
"label": "AwaitAnyGenericNode",
|
61
|
+
"id": "42e17f0e-8496-415f-9c72-f85250ba6f0b",
|
62
|
+
"label": "test_serialize_node__await_any.<locals>.AwaitAnyGenericNode",
|
65
63
|
"type": "GENERIC",
|
66
64
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
67
65
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -77,10 +75,10 @@ def test_serialize_node__await_any(serialize_node):
|
|
77
75
|
"test_trigger_serialization",
|
78
76
|
],
|
79
77
|
},
|
80
|
-
"trigger": {"id": "
|
78
|
+
"trigger": {"id": "5bb6bb4c-4374-44c8-a7b5-7bb6c1060a5b", "merge_behavior": "AWAIT_ANY"},
|
81
79
|
"ports": [
|
82
80
|
{
|
83
|
-
"id": "
|
81
|
+
"id": "d9a84db7-8bd6-4a15-9e3c-c2e898c26d16",
|
84
82
|
"name": "default",
|
85
83
|
"type": "DEFAULT",
|
86
84
|
}
|
@@ -94,17 +92,16 @@ def test_serialize_node__await_any(serialize_node):
|
|
94
92
|
)
|
95
93
|
|
96
94
|
|
97
|
-
class AwaitAllGenericNode(BaseNode):
|
98
|
-
class Trigger(BaseNode.Trigger):
|
99
|
-
merge_behavior = MergeBehavior.AWAIT_ALL
|
100
|
-
|
101
|
-
|
102
95
|
def test_serialize_node__await_all(serialize_node):
|
96
|
+
class AwaitAllGenericNode(BaseNode):
|
97
|
+
class Trigger(BaseNode.Trigger):
|
98
|
+
merge_behavior = MergeBehavior.AWAIT_ALL
|
99
|
+
|
103
100
|
serialized_node = serialize_node(AwaitAllGenericNode)
|
104
101
|
assert not DeepDiff(
|
105
102
|
{
|
106
|
-
"id": "
|
107
|
-
"label": "AwaitAllGenericNode",
|
103
|
+
"id": "b3e1145a-5f41-456b-9382-6d0a1e828c2f",
|
104
|
+
"label": "test_serialize_node__await_all.<locals>.AwaitAllGenericNode",
|
108
105
|
"type": "GENERIC",
|
109
106
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
110
107
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -120,10 +117,10 @@ def test_serialize_node__await_all(serialize_node):
|
|
120
117
|
"test_trigger_serialization",
|
121
118
|
],
|
122
119
|
},
|
123
|
-
"trigger": {"id": "
|
120
|
+
"trigger": {"id": "124ba9cf-a30e-41ef-81bf-143708f8b1c3", "merge_behavior": "AWAIT_ALL"},
|
124
121
|
"ports": [
|
125
122
|
{
|
126
|
-
"id": "
|
123
|
+
"id": "fa73da35-0bf9-4f02-bf5b-0b0d1a6f1494",
|
127
124
|
"name": "default",
|
128
125
|
"type": "DEFAULT",
|
129
126
|
}
|
@@ -5,9 +5,11 @@ from vellum.workflows.nodes.bases.base import BaseNode
|
|
5
5
|
from vellum.workflows.nodes.core.inline_subworkflow_node.node import InlineSubworkflowNode
|
6
6
|
from vellum.workflows.nodes.core.retry_node.node import RetryNode
|
7
7
|
from vellum.workflows.nodes.core.templating_node.node import TemplatingNode
|
8
|
+
from vellum.workflows.nodes.core.try_node.node import TryNode
|
8
9
|
from vellum.workflows.workflows.base import BaseWorkflow
|
9
10
|
from vellum_ee.workflows.display.nodes import BaseNodeDisplay
|
10
11
|
from vellum_ee.workflows.display.nodes.vellum.retry_node import BaseRetryNodeDisplay
|
12
|
+
from vellum_ee.workflows.display.nodes.vellum.try_node import BaseTryNodeDisplay
|
11
13
|
from vellum_ee.workflows.display.vellum import NodeDisplayData, NodeDisplayPosition
|
12
14
|
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
13
15
|
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
@@ -119,6 +121,29 @@ def test_get_event_display_context__node_display_filled_without_base_display():
|
|
119
121
|
assert StartNode.__output_ids__ == node_event_display.output_display
|
120
122
|
|
121
123
|
|
124
|
+
def test_get_event_display_context__node_display_filled_without_output_display():
|
125
|
+
# GIVEN a simple workflow
|
126
|
+
class StartNode(BaseNode):
|
127
|
+
class Outputs(BaseNode.Outputs):
|
128
|
+
foo: str
|
129
|
+
|
130
|
+
class MyWorkflow(BaseWorkflow):
|
131
|
+
graph = StartNode
|
132
|
+
|
133
|
+
class StartNodeDisplay(BaseNodeDisplay[StartNode]):
|
134
|
+
pass
|
135
|
+
|
136
|
+
# WHEN we gather the event display context
|
137
|
+
display_context = VellumWorkflowDisplay(MyWorkflow).get_event_display_context()
|
138
|
+
|
139
|
+
# THEN the node display should be included
|
140
|
+
assert str(StartNode.__id__) in display_context.node_displays
|
141
|
+
node_event_display = display_context.node_displays[str(StartNode.__id__)]
|
142
|
+
|
143
|
+
# AND so should their output ids
|
144
|
+
assert node_event_display.output_display.keys() == {"foo"}
|
145
|
+
|
146
|
+
|
122
147
|
def test_get_event_display_context__node_display_to_include_subworkflow_display():
|
123
148
|
# GIVEN a simple workflow
|
124
149
|
class InnerNode(BaseNode):
|
@@ -145,19 +170,33 @@ def test_get_event_display_context__node_display_to_include_subworkflow_display(
|
|
145
170
|
assert str(InnerNode.__id__) in node_event_display.subworkflow_display.node_displays
|
146
171
|
|
147
172
|
|
148
|
-
|
149
|
-
|
150
|
-
|
173
|
+
@pytest.mark.parametrize(
|
174
|
+
["AdornmentNode", "AdornmentNodeDisplay", "expected_adornment_output_names"],
|
175
|
+
[
|
176
|
+
[RetryNode, BaseRetryNodeDisplay, {"foo"}],
|
177
|
+
[TryNode, BaseTryNodeDisplay, {"foo", "error"}],
|
178
|
+
],
|
179
|
+
ids=["retry_node", "try_node"],
|
180
|
+
)
|
181
|
+
def test_get_event_display_context__node_display_for_adornment_nodes(
|
182
|
+
AdornmentNode,
|
183
|
+
AdornmentNodeDisplay,
|
184
|
+
expected_adornment_output_names,
|
185
|
+
):
|
186
|
+
# GIVEN a simple workflow with an adornment
|
187
|
+
@AdornmentNode.wrap()
|
151
188
|
class MyNode(BaseNode):
|
152
|
-
|
189
|
+
class Outputs(BaseNode.Outputs):
|
190
|
+
foo: str
|
153
191
|
|
154
192
|
class MyWorkflow(BaseWorkflow):
|
155
193
|
graph = MyNode
|
156
194
|
|
157
195
|
# AND a display class for the node
|
196
|
+
adornment_node_id = uuid4()
|
158
197
|
inner_node_id = uuid4()
|
159
198
|
|
160
|
-
@
|
199
|
+
@AdornmentNodeDisplay.wrap(node_id=adornment_node_id)
|
161
200
|
class MyNodeDisplay(BaseNodeDisplay[MyNode]):
|
162
201
|
node_id = inner_node_id
|
163
202
|
|
@@ -165,11 +204,16 @@ def test_get_event_display_context__node_display_for_adornment_nodes():
|
|
165
204
|
display_context = VellumWorkflowDisplay(MyWorkflow).get_event_display_context()
|
166
205
|
|
167
206
|
# THEN the subworkflow display should be included
|
168
|
-
assert str(
|
169
|
-
node_event_display = display_context.node_displays[str(
|
207
|
+
assert str(adornment_node_id) in display_context.node_displays
|
208
|
+
node_event_display = display_context.node_displays[str(adornment_node_id)]
|
170
209
|
assert node_event_display.subworkflow_display is not None
|
171
210
|
assert str(inner_node_id) in node_event_display.subworkflow_display.node_displays
|
172
211
|
|
212
|
+
# AND the inner node should have the correct outputs
|
213
|
+
inner_node_display = node_event_display.subworkflow_display.node_displays[str(inner_node_id)]
|
214
|
+
assert inner_node_display.output_display.keys() == {"foo"}
|
215
|
+
assert node_event_display.output_display.keys() == expected_adornment_output_names
|
216
|
+
|
173
217
|
|
174
218
|
def test_get_event_display_context__templating_node_input_display():
|
175
219
|
# GIVEN a simple workflow with a templating node referencing another node output
|
File without changes
|
File without changes
|
File without changes
|