vellum-ai 0.10.3__py3-none-any.whl → 0.10.6__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/client/core/client_wrapper.py +1 -1
- vellum/workflows/events/tests/test_event.py +30 -0
- vellum/workflows/events/types.py +57 -3
- vellum/workflows/nodes/__init__.py +6 -7
- vellum/workflows/nodes/bases/base.py +0 -1
- vellum/workflows/nodes/core/inline_subworkflow_node/node.py +2 -1
- vellum/workflows/nodes/core/map_node/node.py +1 -1
- vellum/workflows/nodes/core/retry_node/node.py +1 -0
- vellum/workflows/nodes/core/templating_node/node.py +5 -1
- vellum/workflows/nodes/core/try_node/node.py +66 -27
- vellum/workflows/nodes/core/try_node/tests/test_node.py +39 -8
- vellum/workflows/nodes/displayable/__init__.py +2 -0
- vellum/workflows/nodes/displayable/bases/api_node/node.py +3 -3
- vellum/workflows/nodes/displayable/code_execution_node/node.py +5 -2
- vellum/workflows/nodes/displayable/final_output_node/node.py +6 -2
- vellum/workflows/nodes/displayable/note_node/__init__.py +5 -0
- vellum/workflows/nodes/displayable/note_node/node.py +10 -0
- vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py +10 -11
- vellum/workflows/nodes/utils.py +2 -0
- vellum/workflows/outputs/base.py +26 -2
- vellum/workflows/runner/runner.py +41 -27
- vellum/workflows/state/tests/test_state.py +2 -0
- vellum/workflows/types/tests/test_utils.py +9 -0
- vellum/workflows/types/utils.py +1 -1
- vellum/workflows/utils/vellum_variables.py +13 -1
- vellum/workflows/workflows/base.py +24 -1
- {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/METADATA +8 -6
- {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/RECORD +61 -56
- vellum_cli/CONTRIBUTING.md +66 -0
- vellum_cli/README.md +3 -0
- vellum_ee/workflows/display/base.py +2 -1
- vellum_ee/workflows/display/nodes/base_node_display.py +27 -4
- vellum_ee/workflows/display/nodes/vellum/__init__.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/api_node.py +3 -3
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +4 -4
- vellum_ee/workflows/display/nodes/vellum/conditional_node.py +86 -41
- vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +3 -3
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +4 -5
- vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +9 -9
- vellum_ee/workflows/display/nodes/vellum/map_node.py +5 -5
- vellum_ee/workflows/display/nodes/vellum/note_node.py +32 -0
- vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +5 -5
- vellum_ee/workflows/display/nodes/vellum/search_node.py +6 -10
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +2 -2
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +4 -5
- vellum_ee/workflows/display/nodes/vellum/try_node.py +16 -4
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +7 -3
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +127 -101
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +6 -5
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +77 -64
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +4 -3
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +6 -6
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +6 -6
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +4 -3
- vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +7 -6
- vellum_ee/workflows/display/workflows/base_workflow_display.py +14 -9
- vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +2 -7
- vellum_ee/workflows/display/workflows/vellum_workflow_display.py +18 -16
- {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/LICENSE +0 -0
- {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/WHEEL +0 -0
- {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/entry_points.txt +0 -0
@@ -3,17 +3,6 @@ from unittest import mock
|
|
3
3
|
|
4
4
|
from deepdiff import DeepDiff
|
5
5
|
|
6
|
-
from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
|
7
|
-
from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import (
|
8
|
-
create_simple_workflow,
|
9
|
-
)
|
10
|
-
from vellum_ee.workflows.display.nodes.base_node_vellum_display import (
|
11
|
-
BaseNodeVellumDisplay,
|
12
|
-
)
|
13
|
-
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
14
|
-
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import (
|
15
|
-
get_workflow_display,
|
16
|
-
)
|
17
6
|
from vellum.workflows.expressions.begins_with import BeginsWithExpression
|
18
7
|
from vellum.workflows.expressions.between import BetweenExpression
|
19
8
|
from vellum.workflows.expressions.contains import ContainsExpression
|
@@ -36,6 +25,18 @@ from vellum.workflows.expressions.less_than_or_equal_to import (
|
|
36
25
|
)
|
37
26
|
from vellum.workflows.expressions.not_between import NotBetweenExpression
|
38
27
|
from vellum.workflows.expressions.not_in import NotInExpression
|
28
|
+
from vellum_ee.workflows.display.nodes.base_node_vellum_display import (
|
29
|
+
BaseNodeVellumDisplay,
|
30
|
+
)
|
31
|
+
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
32
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import (
|
33
|
+
get_workflow_display,
|
34
|
+
)
|
35
|
+
|
36
|
+
from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
|
37
|
+
from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import (
|
38
|
+
create_simple_workflow,
|
39
|
+
)
|
39
40
|
|
40
41
|
|
41
42
|
def test_serialize_workflow():
|
@@ -67,9 +68,9 @@ def test_serialize_workflow():
|
|
67
68
|
"id": "eece050a-432e-4a2c-8c87-9480397e4cbf",
|
68
69
|
"key": "category",
|
69
70
|
"type": "STRING",
|
70
|
-
"required":
|
71
|
+
"required": True,
|
71
72
|
"default": None,
|
72
|
-
"extensions": None,
|
73
|
+
"extensions": {"color": None},
|
73
74
|
},
|
74
75
|
],
|
75
76
|
input_variables,
|
@@ -150,8 +151,8 @@ def test_serialize_workflow():
|
|
150
151
|
"type": "CONDITIONAL",
|
151
152
|
"inputs": [
|
152
153
|
{
|
153
|
-
"id": "
|
154
|
-
"key": "
|
154
|
+
"id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
|
155
|
+
"key": "e0490a35-c863-422b-a12a-f18858d75241.field",
|
155
156
|
"value": {
|
156
157
|
"rules": [
|
157
158
|
{
|
@@ -165,8 +166,8 @@ def test_serialize_workflow():
|
|
165
166
|
},
|
166
167
|
},
|
167
168
|
{
|
168
|
-
"id": "
|
169
|
-
"key": "
|
169
|
+
"id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
|
170
|
+
"key": "e0490a35-c863-422b-a12a-f18858d75241.value",
|
170
171
|
"value": {
|
171
172
|
"rules": [
|
172
173
|
{
|
@@ -178,8 +179,8 @@ def test_serialize_workflow():
|
|
178
179
|
},
|
179
180
|
},
|
180
181
|
{
|
181
|
-
"id": "
|
182
|
-
"key": "
|
182
|
+
"id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
|
183
|
+
"key": "f7818d41-3f66-42c7-8218-de5c30379906.field",
|
183
184
|
"value": {
|
184
185
|
"rules": [
|
185
186
|
{
|
@@ -193,8 +194,8 @@ def test_serialize_workflow():
|
|
193
194
|
},
|
194
195
|
},
|
195
196
|
{
|
196
|
-
"id": "
|
197
|
-
"key": "
|
197
|
+
"id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
|
198
|
+
"key": "f7818d41-3f66-42c7-8218-de5c30379906.value",
|
198
199
|
"value": {
|
199
200
|
"rules": [
|
200
201
|
{
|
@@ -206,8 +207,8 @@ def test_serialize_workflow():
|
|
206
207
|
},
|
207
208
|
},
|
208
209
|
{
|
209
|
-
"id": "
|
210
|
-
"key": "
|
210
|
+
"id": "a593293c-9c17-45c5-8c99-fc867aad580e",
|
211
|
+
"key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.field",
|
211
212
|
"value": {
|
212
213
|
"rules": [
|
213
214
|
{
|
@@ -221,8 +222,8 @@ def test_serialize_workflow():
|
|
221
222
|
},
|
222
223
|
},
|
223
224
|
{
|
224
|
-
"id": "
|
225
|
-
"key": "
|
225
|
+
"id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
|
226
|
+
"key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.value",
|
226
227
|
"value": {
|
227
228
|
"rules": [
|
228
229
|
{
|
@@ -234,8 +235,8 @@ def test_serialize_workflow():
|
|
234
235
|
},
|
235
236
|
},
|
236
237
|
{
|
237
|
-
"id": "
|
238
|
-
"key": "
|
238
|
+
"id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
|
239
|
+
"key": "aa692069-9672-4adb-b874-74da98745f24.field",
|
239
240
|
"value": {
|
240
241
|
"rules": [
|
241
242
|
{
|
@@ -249,8 +250,8 @@ def test_serialize_workflow():
|
|
249
250
|
},
|
250
251
|
},
|
251
252
|
{
|
252
|
-
"id": "
|
253
|
-
"key": "
|
253
|
+
"id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
|
254
|
+
"key": "aa692069-9672-4adb-b874-74da98745f24.value",
|
254
255
|
"value": {
|
255
256
|
"rules": [
|
256
257
|
{
|
@@ -262,8 +263,8 @@ def test_serialize_workflow():
|
|
262
263
|
},
|
263
264
|
},
|
264
265
|
{
|
265
|
-
"id": "
|
266
|
-
"key": "
|
266
|
+
"id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
|
267
|
+
"key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.field",
|
267
268
|
"value": {
|
268
269
|
"rules": [
|
269
270
|
{
|
@@ -277,8 +278,8 @@ def test_serialize_workflow():
|
|
277
278
|
},
|
278
279
|
},
|
279
280
|
{
|
280
|
-
"id": "
|
281
|
-
"key": "
|
281
|
+
"id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
|
282
|
+
"key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.value",
|
282
283
|
"value": {
|
283
284
|
"rules": [
|
284
285
|
{
|
@@ -290,8 +291,8 @@ def test_serialize_workflow():
|
|
290
291
|
},
|
291
292
|
},
|
292
293
|
{
|
293
|
-
"id": "
|
294
|
-
"key": "
|
294
|
+
"id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
|
295
|
+
"key": "e59504e1-4134-46dc-8055-114c6a606af8.field",
|
295
296
|
"value": {
|
296
297
|
"rules": [
|
297
298
|
{
|
@@ -305,8 +306,8 @@ def test_serialize_workflow():
|
|
305
306
|
},
|
306
307
|
},
|
307
308
|
{
|
308
|
-
"id": "
|
309
|
-
"key": "
|
309
|
+
"id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
|
310
|
+
"key": "e59504e1-4134-46dc-8055-114c6a606af8.value",
|
310
311
|
"value": {
|
311
312
|
"rules": [
|
312
313
|
{
|
@@ -330,13 +331,13 @@ def test_serialize_workflow():
|
|
330
331
|
"id": "2ccd0730-26d1-4fb4-baa9-1a2a182dd9a0",
|
331
332
|
"rules": [
|
332
333
|
{
|
333
|
-
"id": "
|
334
|
+
"id": "e0490a35-c863-422b-a12a-f18858d75241",
|
334
335
|
"rules": None,
|
335
336
|
"combinator": None,
|
336
337
|
"negated": False,
|
337
|
-
"field_node_input_id": "
|
338
|
+
"field_node_input_id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
|
338
339
|
"operator": "=",
|
339
|
-
"value_node_input_id": "
|
340
|
+
"value_node_input_id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
|
340
341
|
}
|
341
342
|
],
|
342
343
|
"combinator": "AND",
|
@@ -354,13 +355,13 @@ def test_serialize_workflow():
|
|
354
355
|
"id": "cc3f0d92-b603-42cc-b2e9-83e3b23b3bcb",
|
355
356
|
"rules": [
|
356
357
|
{
|
357
|
-
"id": "
|
358
|
+
"id": "f7818d41-3f66-42c7-8218-de5c30379906",
|
358
359
|
"rules": None,
|
359
360
|
"combinator": None,
|
360
361
|
"negated": False,
|
361
|
-
"field_node_input_id": "
|
362
|
+
"field_node_input_id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
|
362
363
|
"operator": "=",
|
363
|
-
"value_node_input_id": "
|
364
|
+
"value_node_input_id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
|
364
365
|
}
|
365
366
|
],
|
366
367
|
"combinator": "AND",
|
@@ -378,13 +379,13 @@ def test_serialize_workflow():
|
|
378
379
|
"id": "a5a0f391-7052-452f-9fe1-a5781a491591",
|
379
380
|
"rules": [
|
380
381
|
{
|
381
|
-
"id": "
|
382
|
+
"id": "38483416-c474-4e50-bfbc-7e92de2b4c2c",
|
382
383
|
"rules": None,
|
383
384
|
"combinator": None,
|
384
385
|
"negated": False,
|
385
|
-
"field_node_input_id": "
|
386
|
+
"field_node_input_id": "a593293c-9c17-45c5-8c99-fc867aad580e",
|
386
387
|
"operator": "=",
|
387
|
-
"value_node_input_id": "
|
388
|
+
"value_node_input_id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
|
388
389
|
}
|
389
390
|
],
|
390
391
|
"combinator": "AND",
|
@@ -402,34 +403,34 @@ def test_serialize_workflow():
|
|
402
403
|
"id": "efe7a851-2a67-4189-99ec-bc193242b270",
|
403
404
|
"rules": [
|
404
405
|
{
|
405
|
-
"id": "
|
406
|
+
"id": "aa692069-9672-4adb-b874-74da98745f24",
|
406
407
|
"rules": None,
|
407
408
|
"combinator": None,
|
408
409
|
"negated": False,
|
409
|
-
"field_node_input_id": "
|
410
|
+
"field_node_input_id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
|
410
411
|
"operator": "=",
|
411
|
-
"value_node_input_id": "
|
412
|
+
"value_node_input_id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
|
412
413
|
},
|
413
414
|
{
|
414
415
|
"id": "2c78817b-8b73-43fd-8dab-a8923018da9d",
|
415
416
|
"rules": [
|
416
417
|
{
|
417
|
-
"id": "
|
418
|
+
"id": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658",
|
418
419
|
"rules": None,
|
419
420
|
"combinator": None,
|
420
421
|
"negated": False,
|
421
|
-
"field_node_input_id": "
|
422
|
+
"field_node_input_id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
|
422
423
|
"operator": "=",
|
423
|
-
"value_node_input_id": "
|
424
|
+
"value_node_input_id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
|
424
425
|
},
|
425
426
|
{
|
426
|
-
"id": "
|
427
|
+
"id": "e59504e1-4134-46dc-8055-114c6a606af8",
|
427
428
|
"rules": None,
|
428
429
|
"combinator": None,
|
429
430
|
"negated": False,
|
430
|
-
"field_node_input_id": "
|
431
|
+
"field_node_input_id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
|
431
432
|
"operator": "=",
|
432
|
-
"value_node_input_id": "
|
433
|
+
"value_node_input_id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
|
433
434
|
},
|
434
435
|
],
|
435
436
|
"combinator": "AND",
|
@@ -446,6 +447,12 @@ def test_serialize_workflow():
|
|
446
447
|
"value_node_input_id": None,
|
447
448
|
},
|
448
449
|
},
|
450
|
+
{
|
451
|
+
"id": "c2fa8a44-923b-462a-b0d2-fa800a152e52",
|
452
|
+
"type": "ELSE",
|
453
|
+
"source_handle_id": "493024f4-8010-4e1a-abae-b6adbc6fb208",
|
454
|
+
"data": None,
|
455
|
+
},
|
449
456
|
],
|
450
457
|
"version": "2",
|
451
458
|
},
|
@@ -958,14 +965,15 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
958
965
|
|
959
966
|
# AND the conditional node should be what we expect
|
960
967
|
conditional_node = workflow_raw_data["nodes"][1]
|
968
|
+
print(conditional_node)
|
961
969
|
assert not DeepDiff(
|
962
970
|
{
|
963
971
|
"id": "a9143814-6bb0-4cb3-a817-4fc076417121",
|
964
972
|
"type": "CONDITIONAL",
|
965
973
|
"inputs": [
|
966
974
|
{
|
967
|
-
"id": "
|
968
|
-
"key": "
|
975
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
976
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
969
977
|
"value": {
|
970
978
|
"rules": [
|
971
979
|
{
|
@@ -977,8 +985,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
977
985
|
},
|
978
986
|
},
|
979
987
|
{
|
980
|
-
"id": "
|
981
|
-
"key": "
|
988
|
+
"id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
989
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
|
982
990
|
"value": {
|
983
991
|
"rules": [
|
984
992
|
{
|
@@ -1002,13 +1010,13 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1002
1010
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1003
1011
|
"rules": [
|
1004
1012
|
{
|
1005
|
-
"id": "
|
1013
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1006
1014
|
"rules": None,
|
1007
1015
|
"combinator": None,
|
1008
1016
|
"negated": False,
|
1009
|
-
"field_node_input_id": "
|
1017
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1010
1018
|
"operator": f"{operator}",
|
1011
|
-
"value_node_input_id": "
|
1019
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1012
1020
|
}
|
1013
1021
|
],
|
1014
1022
|
"combinator": "AND",
|
@@ -1017,14 +1025,28 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1017
1025
|
"operator": None,
|
1018
1026
|
"value_node_input_id": None,
|
1019
1027
|
},
|
1020
|
-
}
|
1028
|
+
},
|
1029
|
+
{
|
1030
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1031
|
+
"type": "ELSE",
|
1032
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1033
|
+
"data": None,
|
1034
|
+
},
|
1021
1035
|
],
|
1022
1036
|
"version": "2",
|
1023
1037
|
},
|
1024
1038
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1025
1039
|
"definition": {
|
1040
|
+
"name": "SimpleConditionalNode",
|
1041
|
+
"module": [
|
1042
|
+
"tests",
|
1043
|
+
"workflows",
|
1044
|
+
"basic_conditional_node",
|
1045
|
+
"workflow_with_only_one_conditional_node",
|
1046
|
+
],
|
1026
1047
|
"bases": [
|
1027
1048
|
{
|
1049
|
+
"name": "ConditionalNode",
|
1028
1050
|
"module": [
|
1029
1051
|
"vellum",
|
1030
1052
|
"workflows",
|
@@ -1033,16 +1055,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1033
1055
|
"conditional_node",
|
1034
1056
|
"node",
|
1035
1057
|
],
|
1036
|
-
"name": "ConditionalNode",
|
1037
1058
|
}
|
1038
1059
|
],
|
1039
|
-
"module": [
|
1040
|
-
"tests",
|
1041
|
-
"workflows",
|
1042
|
-
"basic_conditional_node",
|
1043
|
-
"workflow_with_only_one_conditional_node",
|
1044
|
-
],
|
1045
|
-
"name": "SimpleConditionalNode",
|
1046
1060
|
},
|
1047
1061
|
},
|
1048
1062
|
conditional_node,
|
@@ -1084,8 +1098,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1084
1098
|
"type": "CONDITIONAL",
|
1085
1099
|
"inputs": [
|
1086
1100
|
{
|
1087
|
-
"id": "
|
1088
|
-
"key": "
|
1101
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1102
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
1089
1103
|
"value": {
|
1090
1104
|
"rules": [
|
1091
1105
|
{
|
@@ -1109,13 +1123,13 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1109
1123
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1110
1124
|
"rules": [
|
1111
1125
|
{
|
1112
|
-
"id": "
|
1126
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1113
1127
|
"rules": None,
|
1114
1128
|
"combinator": None,
|
1115
1129
|
"negated": False,
|
1116
|
-
"field_node_input_id": "
|
1130
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1117
1131
|
"operator": f"{operator}",
|
1118
|
-
"value_node_input_id":
|
1132
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1119
1133
|
}
|
1120
1134
|
],
|
1121
1135
|
"combinator": "AND",
|
@@ -1124,14 +1138,28 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1124
1138
|
"operator": None,
|
1125
1139
|
"value_node_input_id": None,
|
1126
1140
|
},
|
1127
|
-
}
|
1141
|
+
},
|
1142
|
+
{
|
1143
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1144
|
+
"type": "ELSE",
|
1145
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1146
|
+
"data": None,
|
1147
|
+
},
|
1128
1148
|
],
|
1129
1149
|
"version": "2",
|
1130
1150
|
},
|
1131
1151
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1132
1152
|
"definition": {
|
1153
|
+
"name": "SimpleConditionalNode",
|
1154
|
+
"module": [
|
1155
|
+
"tests",
|
1156
|
+
"workflows",
|
1157
|
+
"basic_conditional_node",
|
1158
|
+
"workflow_with_only_one_conditional_node",
|
1159
|
+
],
|
1133
1160
|
"bases": [
|
1134
1161
|
{
|
1162
|
+
"name": "ConditionalNode",
|
1135
1163
|
"module": [
|
1136
1164
|
"vellum",
|
1137
1165
|
"workflows",
|
@@ -1140,16 +1168,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1140
1168
|
"conditional_node",
|
1141
1169
|
"node",
|
1142
1170
|
],
|
1143
|
-
"name": "ConditionalNode",
|
1144
1171
|
}
|
1145
1172
|
],
|
1146
|
-
"module": [
|
1147
|
-
"tests",
|
1148
|
-
"workflows",
|
1149
|
-
"basic_conditional_node",
|
1150
|
-
"workflow_with_only_one_conditional_node",
|
1151
|
-
],
|
1152
|
-
"name": "SimpleConditionalNode",
|
1153
1173
|
},
|
1154
1174
|
},
|
1155
1175
|
conditional_node,
|
@@ -1195,8 +1215,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1195
1215
|
"type": "CONDITIONAL",
|
1196
1216
|
"inputs": [
|
1197
1217
|
{
|
1198
|
-
"id": "
|
1199
|
-
"key": "
|
1218
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1219
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
1200
1220
|
"value": {
|
1201
1221
|
"rules": [
|
1202
1222
|
{
|
@@ -1208,8 +1228,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1208
1228
|
},
|
1209
1229
|
},
|
1210
1230
|
{
|
1211
|
-
"id": "
|
1212
|
-
"key": "
|
1231
|
+
"id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1232
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
|
1213
1233
|
"value": {
|
1214
1234
|
"rules": [
|
1215
1235
|
{
|
@@ -1233,13 +1253,13 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1233
1253
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1234
1254
|
"rules": [
|
1235
1255
|
{
|
1236
|
-
"id": "
|
1256
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1237
1257
|
"rules": None,
|
1238
1258
|
"combinator": None,
|
1239
1259
|
"negated": False,
|
1240
|
-
"field_node_input_id": "
|
1260
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1241
1261
|
"operator": f"{operator}",
|
1242
|
-
"value_node_input_id": "
|
1262
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1243
1263
|
}
|
1244
1264
|
],
|
1245
1265
|
"combinator": "AND",
|
@@ -1248,14 +1268,28 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1248
1268
|
"operator": None,
|
1249
1269
|
"value_node_input_id": None,
|
1250
1270
|
},
|
1251
|
-
}
|
1271
|
+
},
|
1272
|
+
{
|
1273
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1274
|
+
"type": "ELSE",
|
1275
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1276
|
+
"data": None,
|
1277
|
+
},
|
1252
1278
|
],
|
1253
1279
|
"version": "2",
|
1254
1280
|
},
|
1255
1281
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1256
1282
|
"definition": {
|
1283
|
+
"name": "SimpleConditionalNode",
|
1284
|
+
"module": [
|
1285
|
+
"tests",
|
1286
|
+
"workflows",
|
1287
|
+
"basic_conditional_node",
|
1288
|
+
"workflow_with_only_one_conditional_node",
|
1289
|
+
],
|
1257
1290
|
"bases": [
|
1258
1291
|
{
|
1292
|
+
"name": "ConditionalNode",
|
1259
1293
|
"module": [
|
1260
1294
|
"vellum",
|
1261
1295
|
"workflows",
|
@@ -1264,16 +1298,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1264
1298
|
"conditional_node",
|
1265
1299
|
"node",
|
1266
1300
|
],
|
1267
|
-
"name": "ConditionalNode",
|
1268
1301
|
}
|
1269
1302
|
],
|
1270
|
-
"module": [
|
1271
|
-
"tests",
|
1272
|
-
"workflows",
|
1273
|
-
"basic_conditional_node",
|
1274
|
-
"workflow_with_only_one_conditional_node",
|
1275
|
-
],
|
1276
|
-
"name": "SimpleConditionalNode",
|
1277
1303
|
},
|
1278
1304
|
},
|
1279
1305
|
conditional_node,
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
from deepdiff import DeepDiff
|
2
2
|
|
3
|
-
from tests.workflows.basic_guardrail_node.workflow import BasicGuardrailNodeWorkflow
|
4
3
|
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
5
4
|
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
6
5
|
|
6
|
+
from tests.workflows.basic_guardrail_node.workflow import BasicGuardrailNodeWorkflow
|
7
|
+
|
7
8
|
|
8
9
|
def test_serialize_workflow():
|
9
10
|
# GIVEN a workflow that uses a guardrail node
|
@@ -26,17 +27,17 @@ def test_serialize_workflow():
|
|
26
27
|
"id": "eb1b1913-9fb8-4b8c-8901-09d9b9edc1c3",
|
27
28
|
"key": "actual",
|
28
29
|
"type": "STRING",
|
29
|
-
"required":
|
30
|
+
"required": True,
|
30
31
|
"default": None,
|
31
|
-
"extensions": None,
|
32
|
+
"extensions": { "color": None },
|
32
33
|
},
|
33
34
|
{
|
34
35
|
"id": "545ff95e-e86f-4d06-a991-602781e72605",
|
35
36
|
"key": "expected",
|
36
37
|
"type": "STRING",
|
37
|
-
"required":
|
38
|
+
"required": True,
|
38
39
|
"default": None,
|
39
|
-
"extensions": None,
|
40
|
+
"extensions": { "color": None },
|
40
41
|
},
|
41
42
|
],
|
42
43
|
input_variables,
|