vellum-ai 0.14.14__py3-none-any.whl → 0.14.16__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/client/core/client_wrapper.py +1 -1
- vellum/client/core/pydantic_utilities.py +4 -5
- vellum/client/resources/document_indexes/client.py +0 -55
- vellum/client/types/document_index_read.py +0 -10
- vellum/client/types/logical_operator.py +1 -0
- vellum/plugins/pydantic.py +14 -4
- vellum/workflows/nodes/core/retry_node/tests/test_node.py +23 -0
- vellum/workflows/nodes/displayable/api_node/tests/test_api_node.py +29 -0
- vellum/workflows/nodes/displayable/bases/api_node/node.py +2 -2
- vellum/workflows/vellum_client.py +9 -5
- {vellum_ai-0.14.14.dist-info → vellum_ai-0.14.16.dist-info}/METADATA +2 -2
- {vellum_ai-0.14.14.dist-info → vellum_ai-0.14.16.dist-info}/RECORD +33 -32
- 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 +8 -5
- vellum_ee/workflows/display/nodes/base_node_vellum_display.py +1 -4
- vellum_ee/workflows/display/nodes/get_node_display_class.py +34 -8
- vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py +55 -1
- vellum_ee/workflows/display/nodes/vellum/retry_node.py +1 -54
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +1 -8
- vellum_ee/workflows/display/nodes/vellum/try_node.py +1 -42
- vellum_ee/workflows/display/tests/test_vellum_workflow_display.py +47 -10
- 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 +197 -145
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py +23 -26
- vellum_ee/workflows/display/utils/vellum.py +3 -0
- vellum_ee/workflows/display/workflows/base_workflow_display.py +3 -6
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +52 -0
- {vellum_ai-0.14.14.dist-info → vellum_ai-0.14.16.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.14.dist-info → vellum_ai-0.14.16.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.14.dist-info → vellum_ai-0.14.16.dist-info}/entry_points.txt +0 -0
@@ -21,20 +21,18 @@ class Inputs(BaseInputs):
|
|
21
21
|
input: str
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
class Outputs(BaseOutputs):
|
29
|
-
output: str
|
30
|
-
|
24
|
+
def test_serialize_node__retry(serialize_node):
|
25
|
+
@RetryNode.wrap(max_attempts=3)
|
26
|
+
class InnerRetryGenericNode(BaseNode):
|
27
|
+
input = Inputs.input
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
pass
|
29
|
+
class Outputs(BaseOutputs):
|
30
|
+
output: str
|
35
31
|
|
32
|
+
@BaseRetryNodeDisplay.wrap(max_attempts=3)
|
33
|
+
class InnerRetryGenericNodeDisplay(BaseNodeDisplay[InnerRetryGenericNode]):
|
34
|
+
pass
|
36
35
|
|
37
|
-
def test_serialize_node__retry(serialize_node):
|
38
36
|
input_id = uuid4()
|
39
37
|
serialized_node = serialize_node(
|
40
38
|
node_class=InnerRetryGenericNode,
|
@@ -49,8 +47,8 @@ def test_serialize_node__retry(serialize_node):
|
|
49
47
|
)
|
50
48
|
assert not DeepDiff(
|
51
49
|
{
|
52
|
-
"id": "
|
53
|
-
"label": "InnerRetryGenericNode",
|
50
|
+
"id": "188b50aa-e518-4b7b-a5e0-e2585fb1d7b5",
|
51
|
+
"label": "test_serialize_node__retry.<locals>.InnerRetryGenericNode",
|
54
52
|
"type": "GENERIC",
|
55
53
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
56
54
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -66,8 +64,8 @@ def test_serialize_node__retry(serialize_node):
|
|
66
64
|
"test_adornments_serialization",
|
67
65
|
],
|
68
66
|
},
|
69
|
-
"trigger": {"id": "
|
70
|
-
"ports": [{"id": "
|
67
|
+
"trigger": {"id": "d38a83bf-23d1-4f9d-a875-a08dc27cf397", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
68
|
+
"ports": [{"id": "078650c9-f775-4cd0-a08c-23af9983a361", "name": "default", "type": "DEFAULT"}],
|
71
69
|
"adornments": [
|
72
70
|
{
|
73
71
|
"id": "5be7d260-74f7-4734-b31b-a46a94539586",
|
@@ -102,13 +100,13 @@ def test_serialize_node__retry(serialize_node):
|
|
102
100
|
],
|
103
101
|
"attributes": [
|
104
102
|
{
|
105
|
-
"id": "
|
103
|
+
"id": "278df25e-58b5-43c3-b346-cf6444d893a5",
|
106
104
|
"name": "input",
|
107
105
|
"value": {"type": "WORKFLOW_INPUT", "input_variable_id": str(input_id)},
|
108
106
|
}
|
109
107
|
],
|
110
108
|
"outputs": [
|
111
|
-
{"id": "
|
109
|
+
{"id": "dc89dc0d-c0bd-47fd-88aa-ec7b262aa2f1", "name": "output", "type": "STRING", "value": None}
|
112
110
|
],
|
113
111
|
},
|
114
112
|
serialized_node,
|
@@ -136,20 +134,18 @@ def test_serialize_node__retry__no_display():
|
|
136
134
|
assert exec_config is not None
|
137
135
|
|
138
136
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
class Outputs(BaseOutputs):
|
144
|
-
output: str
|
145
|
-
|
137
|
+
def test_serialize_node__try(serialize_node):
|
138
|
+
@TryNode.wrap()
|
139
|
+
class InnerTryGenericNode(BaseNode):
|
140
|
+
input = Inputs.input
|
146
141
|
|
147
|
-
|
148
|
-
|
149
|
-
pass
|
142
|
+
class Outputs(BaseOutputs):
|
143
|
+
output: str
|
150
144
|
|
145
|
+
@BaseTryNodeDisplay.wrap()
|
146
|
+
class InnerTryGenericNodeDisplay(BaseNodeDisplay[InnerTryGenericNode]):
|
147
|
+
pass
|
151
148
|
|
152
|
-
def test_serialize_node__try(serialize_node):
|
153
149
|
input_id = uuid4()
|
154
150
|
serialized_node = serialize_node(
|
155
151
|
base_class=BaseNodeVellumDisplay,
|
@@ -163,7 +159,7 @@ def test_serialize_node__try(serialize_node):
|
|
163
159
|
assert not DeepDiff(
|
164
160
|
{
|
165
161
|
"id": str(InnerTryGenericNode.__wrapped_node__.__id__),
|
166
|
-
"label": "InnerTryGenericNode",
|
162
|
+
"label": "test_serialize_node__try.<locals>.InnerTryGenericNode",
|
167
163
|
"type": "GENERIC",
|
168
164
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
169
165
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -179,8 +175,8 @@ def test_serialize_node__try(serialize_node):
|
|
179
175
|
"test_adornments_serialization",
|
180
176
|
],
|
181
177
|
},
|
182
|
-
"trigger": {"id": "
|
183
|
-
"ports": [{"id": "
|
178
|
+
"trigger": {"id": "16bc1522-c408-47ad-9a22-0ef136384abf", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
179
|
+
"ports": [{"id": "8d25f244-4b12-4f8b-b202-8948698679a0", "name": "default", "type": "DEFAULT"}],
|
184
180
|
"adornments": [
|
185
181
|
{
|
186
182
|
"id": "3344083c-a32c-4a32-920b-0fb5093448fa",
|
@@ -200,13 +196,13 @@ def test_serialize_node__try(serialize_node):
|
|
200
196
|
],
|
201
197
|
"attributes": [
|
202
198
|
{
|
203
|
-
"id": "
|
199
|
+
"id": "51aa0077-4060-496b-8e2e-e79d56ee6a32",
|
204
200
|
"name": "input",
|
205
201
|
"value": {"type": "WORKFLOW_INPUT", "input_variable_id": str(input_id)},
|
206
202
|
}
|
207
203
|
],
|
208
204
|
"outputs": [
|
209
|
-
{"id": "
|
205
|
+
{"id": "ce9f8b86-6d26-4c03-8bfa-a31aa2cd97f1", "name": "output", "type": "STRING", "value": None}
|
210
206
|
],
|
211
207
|
},
|
212
208
|
serialized_node,
|
@@ -19,17 +19,16 @@ class Inputs(BaseInputs):
|
|
19
19
|
input: str
|
20
20
|
|
21
21
|
|
22
|
-
class ConstantValueGenericNode(BaseNode):
|
23
|
-
attr: str = "hello"
|
24
|
-
|
25
|
-
|
26
22
|
def test_serialize_node__constant_value(serialize_node):
|
23
|
+
class ConstantValueGenericNode(BaseNode):
|
24
|
+
attr: str = "hello"
|
25
|
+
|
27
26
|
serialized_node = serialize_node(ConstantValueGenericNode)
|
28
27
|
|
29
28
|
assert not DeepDiff(
|
30
29
|
{
|
31
|
-
"id": "
|
32
|
-
"label": "ConstantValueGenericNode",
|
30
|
+
"id": "67e07859-7f67-4287-9854-06ab4199e576",
|
31
|
+
"label": "test_serialize_node__constant_value.<locals>.ConstantValueGenericNode",
|
33
32
|
"type": "GENERIC",
|
34
33
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
35
34
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -45,12 +44,12 @@ def test_serialize_node__constant_value(serialize_node):
|
|
45
44
|
"test_attributes_serialization",
|
46
45
|
],
|
47
46
|
},
|
48
|
-
"trigger": {"id": "
|
49
|
-
"ports": [{"id": "
|
47
|
+
"trigger": {"id": "5d41f6fc-fc1a-4a19-9a06-6a0ea9d38557", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
48
|
+
"ports": [{"id": "96ac6512-0128-4cf7-ba51-2725b4807c8f", "type": "DEFAULT", "name": "default"}],
|
50
49
|
"adornments": None,
|
51
50
|
"attributes": [
|
52
51
|
{
|
53
|
-
"id": "
|
52
|
+
"id": "84e4f91c-af1a-4f9d-a578-e3f234dea23b",
|
54
53
|
"name": "attr",
|
55
54
|
"value": {
|
56
55
|
"type": "CONSTANT_VALUE",
|
@@ -68,17 +67,16 @@ def test_serialize_node__constant_value(serialize_node):
|
|
68
67
|
)
|
69
68
|
|
70
69
|
|
71
|
-
class ConstantValueReferenceGenericNode(BaseNode):
|
72
|
-
attr: str = ConstantValueReference("hello")
|
73
|
-
|
74
|
-
|
75
70
|
def test_serialize_node__constant_value_reference(serialize_node):
|
71
|
+
class ConstantValueReferenceGenericNode(BaseNode):
|
72
|
+
attr: str = ConstantValueReference("hello")
|
73
|
+
|
76
74
|
serialized_node = serialize_node(ConstantValueReferenceGenericNode)
|
77
75
|
|
78
76
|
assert not DeepDiff(
|
79
77
|
{
|
80
|
-
"id": "
|
81
|
-
"label": "ConstantValueReferenceGenericNode",
|
78
|
+
"id": "73643f17-e49e-47d2-bd01-bb9c3eab6ae9",
|
79
|
+
"label": "test_serialize_node__constant_value_reference.<locals>.ConstantValueReferenceGenericNode",
|
82
80
|
"type": "GENERIC",
|
83
81
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
84
82
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -94,12 +92,12 @@ def test_serialize_node__constant_value_reference(serialize_node):
|
|
94
92
|
"test_attributes_serialization",
|
95
93
|
],
|
96
94
|
},
|
97
|
-
"trigger": {"id": "
|
98
|
-
"ports": [{"id": "
|
95
|
+
"trigger": {"id": "174f3a8e-99c2-4045-8327-ad2dc658889e", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
96
|
+
"ports": [{"id": "61adfacf-c3a9-4aea-a3da-bcdbc03273c6", "name": "default", "type": "DEFAULT"}],
|
99
97
|
"adornments": None,
|
100
98
|
"attributes": [
|
101
99
|
{
|
102
|
-
"id": "
|
100
|
+
"id": "f8e5efc6-8117-4a1c-bcea-5ba23555409a",
|
103
101
|
"name": "attr",
|
104
102
|
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "hello"}},
|
105
103
|
}
|
@@ -111,17 +109,16 @@ def test_serialize_node__constant_value_reference(serialize_node):
|
|
111
109
|
)
|
112
110
|
|
113
111
|
|
114
|
-
class LazyReferenceGenericNode(BaseNode):
|
115
|
-
attr: str = LazyReference(lambda: ConstantValueReference("hello"))
|
116
|
-
|
117
|
-
|
118
112
|
def test_serialize_node__lazy_reference(serialize_node):
|
113
|
+
class LazyReferenceGenericNode(BaseNode):
|
114
|
+
attr: str = LazyReference(lambda: ConstantValueReference("hello"))
|
115
|
+
|
119
116
|
serialized_node = serialize_node(LazyReferenceGenericNode)
|
120
117
|
|
121
118
|
assert not DeepDiff(
|
122
119
|
{
|
123
|
-
"id": "
|
124
|
-
"label": "LazyReferenceGenericNode",
|
120
|
+
"id": "3d6bfe3b-263a-40a6-8a05-98288e9559a4",
|
121
|
+
"label": "test_serialize_node__lazy_reference.<locals>.LazyReferenceGenericNode",
|
125
122
|
"type": "GENERIC",
|
126
123
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
127
124
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -137,12 +134,12 @@ def test_serialize_node__lazy_reference(serialize_node):
|
|
137
134
|
"test_attributes_serialization",
|
138
135
|
],
|
139
136
|
},
|
140
|
-
"trigger": {"id": "
|
141
|
-
"ports": [{"id": "
|
137
|
+
"trigger": {"id": "a3598540-7464-4965-8a2f-f022a011007d", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
138
|
+
"ports": [{"id": "2dba7224-a376-4780-8414-2b50601f9283", "name": "default", "type": "DEFAULT"}],
|
142
139
|
"adornments": None,
|
143
140
|
"attributes": [
|
144
141
|
{
|
145
|
-
"id": "
|
142
|
+
"id": "7ae37eb4-18c8-49e1-b5ac-6369ce7ed5dd",
|
146
143
|
"name": "attr",
|
147
144
|
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "hello"}},
|
148
145
|
}
|
@@ -191,20 +188,20 @@ def test_serialize_node__lazy_reference_with_string():
|
|
191
188
|
]
|
192
189
|
|
193
190
|
|
194
|
-
class WorkflowInputGenericNode(BaseNode):
|
195
|
-
attr: str = Inputs.input
|
196
|
-
|
197
|
-
|
198
191
|
def test_serialize_node__workflow_input(serialize_node):
|
192
|
+
class WorkflowInputGenericNode(BaseNode):
|
193
|
+
attr: str = Inputs.input
|
194
|
+
|
199
195
|
input_id = uuid4()
|
200
196
|
serialized_node = serialize_node(
|
201
197
|
node_class=WorkflowInputGenericNode,
|
202
198
|
global_workflow_input_displays={Inputs.input: WorkflowInputsDisplay(id=input_id)},
|
203
199
|
)
|
200
|
+
|
204
201
|
assert not DeepDiff(
|
205
202
|
{
|
206
|
-
"id": "
|
207
|
-
"label": "WorkflowInputGenericNode",
|
203
|
+
"id": "30116483-6f38-40e0-baf2-32de0e14e9a3",
|
204
|
+
"label": "test_serialize_node__workflow_input.<locals>.WorkflowInputGenericNode",
|
208
205
|
"type": "GENERIC",
|
209
206
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
210
207
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -220,12 +217,12 @@ def test_serialize_node__workflow_input(serialize_node):
|
|
220
217
|
"test_attributes_serialization",
|
221
218
|
],
|
222
219
|
},
|
223
|
-
"trigger": {"id": "
|
224
|
-
"ports": [{"id": "
|
220
|
+
"trigger": {"id": "dcb92d51-1fbd-4d41-ab89-c8f490d2bb38", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
221
|
+
"ports": [{"id": "20d91130-ca86-4420-b2e7-a962c0f1a509", "type": "DEFAULT", "name": "default"}],
|
225
222
|
"adornments": None,
|
226
223
|
"attributes": [
|
227
224
|
{
|
228
|
-
"id": "
|
225
|
+
"id": "6b2f781b-1a70-4abc-965a-a4edb8563f0e",
|
229
226
|
"name": "attr",
|
230
227
|
"value": {
|
231
228
|
"type": "WORKFLOW_INPUT",
|
@@ -240,20 +237,17 @@ def test_serialize_node__workflow_input(serialize_node):
|
|
240
237
|
)
|
241
238
|
|
242
239
|
|
243
|
-
|
244
|
-
class
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
class NodeWithOutputDisplay(BaseNodeDisplay[NodeWithOutput]):
|
249
|
-
pass
|
250
|
-
|
240
|
+
def test_serialize_node__node_output(serialize_node):
|
241
|
+
class NodeWithOutput(BaseNode):
|
242
|
+
class Outputs(BaseNode.Outputs):
|
243
|
+
output = Inputs.input
|
251
244
|
|
252
|
-
class
|
253
|
-
|
245
|
+
class NodeWithOutputDisplay(BaseNodeDisplay[NodeWithOutput]):
|
246
|
+
pass
|
254
247
|
|
248
|
+
class GenericNodeReferencingOutput(BaseNode):
|
249
|
+
attr = NodeWithOutput.Outputs.output
|
255
250
|
|
256
|
-
def test_serialize_node__node_output(serialize_node):
|
257
251
|
workflow_input_id = uuid4()
|
258
252
|
node_output_id = uuid4()
|
259
253
|
serialized_node = serialize_node(
|
@@ -267,8 +261,8 @@ def test_serialize_node__node_output(serialize_node):
|
|
267
261
|
|
268
262
|
assert not DeepDiff(
|
269
263
|
{
|
270
|
-
"id": "
|
271
|
-
"label": "GenericNodeReferencingOutput",
|
264
|
+
"id": "7210742f-8c3e-4379-9800-8b4b7f5dd7ed",
|
265
|
+
"label": "test_serialize_node__node_output.<locals>.GenericNodeReferencingOutput",
|
272
266
|
"type": "GENERIC",
|
273
267
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
274
268
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -284,16 +278,16 @@ def test_serialize_node__node_output(serialize_node):
|
|
284
278
|
"test_attributes_serialization",
|
285
279
|
],
|
286
280
|
},
|
287
|
-
"trigger": {"id": "
|
288
|
-
"ports": [{"id": "
|
281
|
+
"trigger": {"id": "aa7f0dce-0413-4802-b1dd-f96a2d2eb8e5", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
282
|
+
"ports": [{"id": "a345665a-decd-4f6b-af38-387bd41c2643", "type": "DEFAULT", "name": "default"}],
|
289
283
|
"adornments": None,
|
290
284
|
"attributes": [
|
291
285
|
{
|
292
|
-
"id": "
|
286
|
+
"id": "1318ab14-deb1-4254-9636-4bd783bdd9eb",
|
293
287
|
"name": "attr",
|
294
288
|
"value": {
|
295
289
|
"type": "NODE_OUTPUT",
|
296
|
-
"node_id": "
|
290
|
+
"node_id": "48cf26cc-7b6d-49a7-a1a3-298f6d66772b",
|
297
291
|
"node_output_id": str(node_output_id),
|
298
292
|
},
|
299
293
|
}
|
@@ -305,20 +299,20 @@ def test_serialize_node__node_output(serialize_node):
|
|
305
299
|
)
|
306
300
|
|
307
301
|
|
308
|
-
class VellumSecretGenericNode(BaseNode):
|
309
|
-
attr = VellumSecretReference(name="hello")
|
310
|
-
|
311
|
-
|
312
302
|
def test_serialize_node__vellum_secret(serialize_node):
|
303
|
+
class VellumSecretGenericNode(BaseNode):
|
304
|
+
attr = VellumSecretReference(name="hello")
|
305
|
+
|
313
306
|
input_id = uuid4()
|
314
307
|
serialized_node = serialize_node(
|
315
308
|
node_class=VellumSecretGenericNode,
|
316
309
|
global_workflow_input_displays={Inputs.input: WorkflowInputsDisplay(id=input_id)},
|
317
310
|
)
|
311
|
+
|
318
312
|
assert not DeepDiff(
|
319
313
|
{
|
320
|
-
"id": "
|
321
|
-
"label": "VellumSecretGenericNode",
|
314
|
+
"id": "0e75bd8f-882e-4ab7-8348-061319b574f7",
|
315
|
+
"label": "test_serialize_node__vellum_secret.<locals>.VellumSecretGenericNode",
|
322
316
|
"type": "GENERIC",
|
323
317
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
324
318
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -334,12 +328,12 @@ def test_serialize_node__vellum_secret(serialize_node):
|
|
334
328
|
"test_attributes_serialization",
|
335
329
|
],
|
336
330
|
},
|
337
|
-
"trigger": {"id": "
|
338
|
-
"ports": [{"id": "
|
331
|
+
"trigger": {"id": "c5006d90-90cc-4e97-9092-f75785fa61ec", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
332
|
+
"ports": [{"id": "6d1c2139-64bd-4433-84d7-3fe08850134b", "type": "DEFAULT", "name": "default"}],
|
339
333
|
"adornments": None,
|
340
334
|
"attributes": [
|
341
335
|
{
|
342
|
-
"id": "
|
336
|
+
"id": "c2eb79e2-4cd3-4176-8da9-0d76327cbf0f",
|
343
337
|
"name": "attr",
|
344
338
|
"value": {"type": "VELLUM_SECRET", "vellum_secret_name": "hello"},
|
345
339
|
}
|
@@ -351,19 +345,16 @@ def test_serialize_node__vellum_secret(serialize_node):
|
|
351
345
|
)
|
352
346
|
|
353
347
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
class NodeWithExecutionsDisplay(BaseNodeDisplay[NodeWithExecutions]):
|
359
|
-
pass
|
360
|
-
|
348
|
+
def test_serialize_node__node_execution(serialize_node):
|
349
|
+
class NodeWithExecutions(BaseNode):
|
350
|
+
pass
|
361
351
|
|
362
|
-
class
|
363
|
-
|
352
|
+
class NodeWithExecutionsDisplay(BaseNodeDisplay[NodeWithExecutions]):
|
353
|
+
pass
|
364
354
|
|
355
|
+
class GenericNodeReferencingExecutions(BaseNode):
|
356
|
+
attr: int = NodeWithExecutions.Execution.count
|
365
357
|
|
366
|
-
def test_serialize_node__node_execution(serialize_node):
|
367
358
|
workflow_input_id = uuid4()
|
368
359
|
serialized_node = serialize_node(
|
369
360
|
node_class=GenericNodeReferencingExecutions,
|
@@ -373,8 +364,8 @@ def test_serialize_node__node_execution(serialize_node):
|
|
373
364
|
|
374
365
|
assert not DeepDiff(
|
375
366
|
{
|
376
|
-
"id": "
|
377
|
-
"label": "GenericNodeReferencingExecutions",
|
367
|
+
"id": "f42dda6b-e856-49bd-b203-46c9dd66c08b",
|
368
|
+
"label": "test_serialize_node__node_execution.<locals>.GenericNodeReferencingExecutions",
|
378
369
|
"type": "GENERIC",
|
379
370
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
380
371
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -390,16 +381,16 @@ def test_serialize_node__node_execution(serialize_node):
|
|
390
381
|
"test_attributes_serialization",
|
391
382
|
],
|
392
383
|
},
|
393
|
-
"trigger": {"id": "
|
394
|
-
"ports": [{"id": "
|
384
|
+
"trigger": {"id": "2fc95236-b5bc-4574-bade-2c9f0933b18c", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
385
|
+
"ports": [{"id": "59844b72-ac5e-43c5-b3a7-9c57ba73ec8c", "type": "DEFAULT", "name": "default"}],
|
395
386
|
"adornments": None,
|
396
387
|
"attributes": [
|
397
388
|
{
|
398
|
-
"id": "
|
389
|
+
"id": "8be1be85-ac70-4e61-b52a-cd416f5320b9",
|
399
390
|
"name": "attr",
|
400
391
|
"value": {
|
401
392
|
"type": "EXECUTION_COUNTER",
|
402
|
-
"node_id": "
|
393
|
+
"node_id": "d68cc3c3-d5dc-4a51-bbfc-1fd4b41abad0",
|
403
394
|
},
|
404
395
|
}
|
405
396
|
],
|
@@ -410,33 +401,27 @@ def test_serialize_node__node_execution(serialize_node):
|
|
410
401
|
)
|
411
402
|
|
412
403
|
|
413
|
-
|
414
|
-
class
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
class CoalesceNodeADisplay(BaseNodeDisplay[CoalesceNodeA]):
|
419
|
-
pass
|
420
|
-
|
421
|
-
|
422
|
-
class CoalesceNodeB(BaseNode):
|
423
|
-
class Outputs(BaseNode.Outputs):
|
424
|
-
output: str
|
425
|
-
|
426
|
-
|
427
|
-
class CoalesceNodeBDisplay(BaseNodeDisplay[CoalesceNodeB]):
|
428
|
-
pass
|
404
|
+
def test_serialize_node__coalesce(serialize_node):
|
405
|
+
class CoalesceNodeA(BaseNode):
|
406
|
+
class Outputs(BaseNode.Outputs):
|
407
|
+
output: str
|
429
408
|
|
409
|
+
class CoalesceNodeADisplay(BaseNodeDisplay[CoalesceNodeA]):
|
410
|
+
pass
|
430
411
|
|
431
|
-
class
|
432
|
-
|
412
|
+
class CoalesceNodeB(BaseNode):
|
413
|
+
class Outputs(BaseNode.Outputs):
|
414
|
+
output: str
|
433
415
|
|
416
|
+
class CoalesceNodeBDisplay(BaseNodeDisplay[CoalesceNodeB]):
|
417
|
+
pass
|
434
418
|
|
435
|
-
class
|
436
|
-
|
419
|
+
class CoalesceNodeFinal(BaseNode):
|
420
|
+
attr = CoalesceNodeA.Outputs.output.coalesce(CoalesceNodeB.Outputs.output)
|
437
421
|
|
422
|
+
class CoalesceNodeFinalDisplay(BaseNodeDisplay[CoalesceNodeFinal]):
|
423
|
+
pass
|
438
424
|
|
439
|
-
def test_serialize_node__coalesce(serialize_node):
|
440
425
|
coalesce_node_a_output_id = uuid4()
|
441
426
|
coalesce_node_b_output_id = uuid4()
|
442
427
|
serialized_node = serialize_node(
|
@@ -460,8 +445,8 @@ def test_serialize_node__coalesce(serialize_node):
|
|
460
445
|
|
461
446
|
assert not DeepDiff(
|
462
447
|
{
|
463
|
-
"id": "
|
464
|
-
"label": "CoalesceNodeFinal",
|
448
|
+
"id": "bb99f326-7d2a-4b5e-95f3-6039114798da",
|
449
|
+
"label": "test_serialize_node__coalesce.<locals>.CoalesceNodeFinal",
|
465
450
|
"type": "GENERIC",
|
466
451
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
467
452
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -477,24 +462,24 @@ def test_serialize_node__coalesce(serialize_node):
|
|
477
462
|
"test_attributes_serialization",
|
478
463
|
],
|
479
464
|
},
|
480
|
-
"trigger": {"id": "
|
481
|
-
"ports": [{"id": "
|
465
|
+
"trigger": {"id": "0302231d-73f2-4587-8a62-8ed3640f0f91", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
466
|
+
"ports": [{"id": "9d97a0c9-6a79-433a-bcdf-e07aa10c0f3c", "name": "default", "type": "DEFAULT"}],
|
482
467
|
"adornments": None,
|
483
468
|
"attributes": [
|
484
469
|
{
|
485
|
-
"id": "
|
470
|
+
"id": "2e25b25b-4aac-425f-91f4-f0fa55453b8c",
|
486
471
|
"name": "attr",
|
487
472
|
"value": {
|
488
473
|
"type": "BINARY_EXPRESSION",
|
489
474
|
"lhs": {
|
490
475
|
"type": "NODE_OUTPUT",
|
491
|
-
"node_id": "
|
476
|
+
"node_id": "f6d1aa4d-c3fd-421d-9dc8-4209bddf7fd3",
|
492
477
|
"node_output_id": str(coalesce_node_a_output_id),
|
493
478
|
},
|
494
479
|
"operator": "coalesce",
|
495
480
|
"rhs": {
|
496
481
|
"type": "NODE_OUTPUT",
|
497
|
-
"node_id": "
|
482
|
+
"node_id": "d1f673fb-80e1-4f9e-9d7d-afe64599ce39",
|
498
483
|
"node_output_id": str(coalesce_node_b_output_id),
|
499
484
|
},
|
500
485
|
},
|