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
@@ -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
|
},
|
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py
CHANGED
@@ -13,18 +13,17 @@ class Inputs(BaseInputs):
|
|
13
13
|
input: str
|
14
14
|
|
15
15
|
|
16
|
-
class AnnotatedOutputGenericNode(BaseNode):
|
17
|
-
class Outputs(BaseNode.Outputs):
|
18
|
-
output: int
|
19
|
-
|
20
|
-
|
21
16
|
def test_serialize_node__annotated_output(serialize_node):
|
17
|
+
class AnnotatedOutputGenericNode(BaseNode):
|
18
|
+
class Outputs(BaseNode.Outputs):
|
19
|
+
output: int
|
20
|
+
|
22
21
|
serialized_node = serialize_node(AnnotatedOutputGenericNode)
|
23
22
|
|
24
23
|
assert not DeepDiff(
|
25
24
|
{
|
26
|
-
"id": "
|
27
|
-
"label": "AnnotatedOutputGenericNode",
|
25
|
+
"id": "e33ddf79-f48c-4057-ba17-d41a3a60ac98",
|
26
|
+
"label": "test_serialize_node__annotated_output.<locals>.AnnotatedOutputGenericNode",
|
28
27
|
"type": "GENERIC",
|
29
28
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
30
29
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -40,13 +39,13 @@ def test_serialize_node__annotated_output(serialize_node):
|
|
40
39
|
"test_outputs_serialization",
|
41
40
|
],
|
42
41
|
},
|
43
|
-
"trigger": {"id": "
|
44
|
-
"ports": [{"id": "
|
42
|
+
"trigger": {"id": "753f7ef1-8724-4af2-939a-794f74ffc21b", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
43
|
+
"ports": [{"id": "d83b7a5d-bbac-47ee-9277-1fbed71e83e8", "type": "DEFAULT", "name": "default"}],
|
45
44
|
"adornments": None,
|
46
45
|
"attributes": [],
|
47
46
|
"outputs": [
|
48
47
|
{
|
49
|
-
"id": "
|
48
|
+
"id": "0fd1356f-ca4e-4e85-b923-8a0164bfc451",
|
50
49
|
"name": "output",
|
51
50
|
"type": "NUMBER",
|
52
51
|
"value": None,
|
@@ -58,12 +57,11 @@ def test_serialize_node__annotated_output(serialize_node):
|
|
58
57
|
)
|
59
58
|
|
60
59
|
|
61
|
-
class WorkflowInputGenericNode(BaseNode):
|
62
|
-
class Outputs(BaseNode.Outputs):
|
63
|
-
output = Inputs.input
|
64
|
-
|
65
|
-
|
66
60
|
def test_serialize_node__workflow_input(serialize_node):
|
61
|
+
class WorkflowInputGenericNode(BaseNode):
|
62
|
+
class Outputs(BaseNode.Outputs):
|
63
|
+
output = Inputs.input
|
64
|
+
|
67
65
|
input_id = uuid4()
|
68
66
|
serialized_node = serialize_node(
|
69
67
|
node_class=WorkflowInputGenericNode,
|
@@ -72,8 +70,8 @@ def test_serialize_node__workflow_input(serialize_node):
|
|
72
70
|
|
73
71
|
assert not DeepDiff(
|
74
72
|
{
|
75
|
-
"id": "
|
76
|
-
"label": "WorkflowInputGenericNode",
|
73
|
+
"id": "30116483-6f38-40e0-baf2-32de0e14e9a3",
|
74
|
+
"label": "test_serialize_node__workflow_input.<locals>.WorkflowInputGenericNode",
|
77
75
|
"type": "GENERIC",
|
78
76
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
79
77
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -89,13 +87,13 @@ def test_serialize_node__workflow_input(serialize_node):
|
|
89
87
|
"test_outputs_serialization",
|
90
88
|
],
|
91
89
|
},
|
92
|
-
"trigger": {"id": "
|
93
|
-
"ports": [{"id": "
|
90
|
+
"trigger": {"id": "dcb92d51-1fbd-4d41-ab89-c8f490d2bb38", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
91
|
+
"ports": [{"id": "20d91130-ca86-4420-b2e7-a962c0f1a509", "type": "DEFAULT", "name": "default"}],
|
94
92
|
"adornments": None,
|
95
93
|
"attributes": [],
|
96
94
|
"outputs": [
|
97
95
|
{
|
98
|
-
"id": "
|
96
|
+
"id": "b62c0cbe-48d5-465d-8d9e-4ff82847f8c7",
|
99
97
|
"name": "output",
|
100
98
|
"type": "STRING",
|
101
99
|
"value": {
|
@@ -110,21 +108,18 @@ def test_serialize_node__workflow_input(serialize_node):
|
|
110
108
|
)
|
111
109
|
|
112
110
|
|
113
|
-
|
114
|
-
class
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
class NodeWithOutputDisplay(BaseNodeDisplay[NodeWithOutput]):
|
119
|
-
pass
|
120
|
-
|
111
|
+
def test_serialize_node__node_output_reference(serialize_node):
|
112
|
+
class NodeWithOutput(BaseNode):
|
113
|
+
class Outputs(BaseNode.Outputs):
|
114
|
+
output = Inputs.input
|
121
115
|
|
122
|
-
class
|
123
|
-
|
124
|
-
output = NodeWithOutput.Outputs.output
|
116
|
+
class NodeWithOutputDisplay(BaseNodeDisplay[NodeWithOutput]):
|
117
|
+
pass
|
125
118
|
|
119
|
+
class GenericNodeReferencingOutput(BaseNode):
|
120
|
+
class Outputs(BaseNode.Outputs):
|
121
|
+
output = NodeWithOutput.Outputs.output
|
126
122
|
|
127
|
-
def test_serialize_node__node_output_reference(serialize_node):
|
128
123
|
workflow_input_id = uuid4()
|
129
124
|
node_output_id = uuid4()
|
130
125
|
serialized_node = serialize_node(
|
@@ -138,8 +133,8 @@ def test_serialize_node__node_output_reference(serialize_node):
|
|
138
133
|
|
139
134
|
assert not DeepDiff(
|
140
135
|
{
|
141
|
-
"id": "
|
142
|
-
"label": "GenericNodeReferencingOutput",
|
136
|
+
"id": "ac067acc-6a6f-44b1-ae84-428e965ce691",
|
137
|
+
"label": "test_serialize_node__node_output_reference.<locals>.GenericNodeReferencingOutput",
|
143
138
|
"type": "GENERIC",
|
144
139
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
145
140
|
"base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
|
@@ -155,18 +150,18 @@ def test_serialize_node__node_output_reference(serialize_node):
|
|
155
150
|
"test_outputs_serialization",
|
156
151
|
],
|
157
152
|
},
|
158
|
-
"trigger": {"id": "
|
159
|
-
"ports": [{"id": "
|
153
|
+
"trigger": {"id": "e949426f-9f3c-425e-a4de-8c0c5f6a8945", "merge_behavior": "AWAIT_ATTRIBUTES"},
|
154
|
+
"ports": [{"id": "383dc10a-d8f3-4bac-b995-8b95bc6deb21", "type": "DEFAULT", "name": "default"}],
|
160
155
|
"adornments": None,
|
161
156
|
"attributes": [],
|
162
157
|
"outputs": [
|
163
158
|
{
|
164
|
-
"id": "
|
159
|
+
"id": "46e6e98e-9ecf-4880-86f9-6390f0851c31",
|
165
160
|
"name": "output",
|
166
161
|
"type": "STRING",
|
167
162
|
"value": {
|
168
163
|
"type": "NODE_OUTPUT",
|
169
|
-
"node_id": "
|
164
|
+
"node_id": "21213d1e-991c-405a-b4fa-a1e01c4dd088",
|
170
165
|
"node_output_id": str(node_output_id),
|
171
166
|
},
|
172
167
|
}
|