vellum-ai 0.10.4__py3-none-any.whl → 0.10.7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +2 -0
- vellum/client/README.md +7 -52
- vellum/client/__init__.py +16 -136
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/resources/ad_hoc/client.py +14 -104
- vellum/client/resources/metric_definitions/client.py +113 -0
- vellum/client/resources/test_suites/client.py +8 -16
- vellum/client/resources/workflows/client.py +0 -32
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/metric_definition_history_item.py +39 -0
- vellum/types/metric_definition_history_item.py +3 -0
- vellum/workflows/events/node.py +36 -3
- vellum/workflows/events/tests/test_event.py +89 -9
- vellum/workflows/nodes/__init__.py +6 -7
- vellum/workflows/nodes/bases/base.py +0 -1
- vellum/workflows/nodes/core/inline_subworkflow_node/node.py +1 -1
- vellum/workflows/nodes/core/templating_node/node.py +5 -1
- vellum/workflows/nodes/core/try_node/node.py +65 -27
- vellum/workflows/nodes/core/try_node/tests/test_node.py +17 -10
- 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/conditional_node/node.py +2 -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/ports/node_ports.py +2 -2
- vellum/workflows/ports/port.py +14 -0
- vellum/workflows/references/__init__.py +2 -0
- vellum/workflows/runner/runner.py +46 -33
- vellum/workflows/runner/types.py +1 -3
- vellum/workflows/state/encoder.py +2 -1
- vellum/workflows/types/tests/test_utils.py +15 -3
- vellum/workflows/types/utils.py +4 -1
- vellum/workflows/utils/vellum_variables.py +13 -1
- vellum/workflows/workflows/base.py +24 -1
- {vellum_ai-0.10.4.dist-info → vellum_ai-0.10.7.dist-info}/METADATA +8 -6
- {vellum_ai-0.10.4.dist-info → vellum_ai-0.10.7.dist-info}/RECORD +76 -69
- 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/final_output_node.py +4 -2
- 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 +23 -51
- 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 +1 -1
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +2 -2
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +1 -1
- 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 +122 -107
- 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 +15 -11
- 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/utils/vellum.py +3 -2
- 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.4.dist-info → vellum_ai-0.10.7.dist-info}/LICENSE +0 -0
- {vellum_ai-0.10.4.dist-info → vellum_ai-0.10.7.dist-info}/WHEEL +0 -0
- {vellum_ai-0.10.4.dist-info → vellum_ai-0.10.7.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
|
@@ -24,18 +13,20 @@ from vellum.workflows.expressions.does_not_equal import DoesNotEqualExpression
|
|
24
13
|
from vellum.workflows.expressions.ends_with import EndsWithExpression
|
25
14
|
from vellum.workflows.expressions.equals import EqualsExpression
|
26
15
|
from vellum.workflows.expressions.greater_than import GreaterThanExpression
|
27
|
-
from vellum.workflows.expressions.greater_than_or_equal_to import
|
28
|
-
GreaterThanOrEqualToExpression,
|
29
|
-
)
|
16
|
+
from vellum.workflows.expressions.greater_than_or_equal_to import GreaterThanOrEqualToExpression
|
30
17
|
from vellum.workflows.expressions.in_ import InExpression
|
31
18
|
from vellum.workflows.expressions.is_not_null import IsNotNullExpression
|
32
19
|
from vellum.workflows.expressions.is_null import IsNullExpression
|
33
20
|
from vellum.workflows.expressions.less_than import LessThanExpression
|
34
|
-
from vellum.workflows.expressions.less_than_or_equal_to import
|
35
|
-
LessThanOrEqualToExpression,
|
36
|
-
)
|
21
|
+
from vellum.workflows.expressions.less_than_or_equal_to import LessThanOrEqualToExpression
|
37
22
|
from vellum.workflows.expressions.not_between import NotBetweenExpression
|
38
23
|
from vellum.workflows.expressions.not_in import NotInExpression
|
24
|
+
from vellum_ee.workflows.display.nodes.base_node_vellum_display import BaseNodeVellumDisplay
|
25
|
+
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
26
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
27
|
+
|
28
|
+
from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
|
29
|
+
from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import create_simple_workflow
|
39
30
|
|
40
31
|
|
41
32
|
def test_serialize_workflow():
|
@@ -67,9 +58,9 @@ def test_serialize_workflow():
|
|
67
58
|
"id": "eece050a-432e-4a2c-8c87-9480397e4cbf",
|
68
59
|
"key": "category",
|
69
60
|
"type": "STRING",
|
70
|
-
"required":
|
61
|
+
"required": True,
|
71
62
|
"default": None,
|
72
|
-
"extensions": None,
|
63
|
+
"extensions": {"color": None},
|
73
64
|
},
|
74
65
|
],
|
75
66
|
input_variables,
|
@@ -150,8 +141,8 @@ def test_serialize_workflow():
|
|
150
141
|
"type": "CONDITIONAL",
|
151
142
|
"inputs": [
|
152
143
|
{
|
153
|
-
"id": "
|
154
|
-
"key": "
|
144
|
+
"id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
|
145
|
+
"key": "e0490a35-c863-422b-a12a-f18858d75241.field",
|
155
146
|
"value": {
|
156
147
|
"rules": [
|
157
148
|
{
|
@@ -165,8 +156,8 @@ def test_serialize_workflow():
|
|
165
156
|
},
|
166
157
|
},
|
167
158
|
{
|
168
|
-
"id": "
|
169
|
-
"key": "
|
159
|
+
"id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
|
160
|
+
"key": "e0490a35-c863-422b-a12a-f18858d75241.value",
|
170
161
|
"value": {
|
171
162
|
"rules": [
|
172
163
|
{
|
@@ -178,8 +169,8 @@ def test_serialize_workflow():
|
|
178
169
|
},
|
179
170
|
},
|
180
171
|
{
|
181
|
-
"id": "
|
182
|
-
"key": "
|
172
|
+
"id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
|
173
|
+
"key": "f7818d41-3f66-42c7-8218-de5c30379906.field",
|
183
174
|
"value": {
|
184
175
|
"rules": [
|
185
176
|
{
|
@@ -193,8 +184,8 @@ def test_serialize_workflow():
|
|
193
184
|
},
|
194
185
|
},
|
195
186
|
{
|
196
|
-
"id": "
|
197
|
-
"key": "
|
187
|
+
"id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
|
188
|
+
"key": "f7818d41-3f66-42c7-8218-de5c30379906.value",
|
198
189
|
"value": {
|
199
190
|
"rules": [
|
200
191
|
{
|
@@ -206,8 +197,8 @@ def test_serialize_workflow():
|
|
206
197
|
},
|
207
198
|
},
|
208
199
|
{
|
209
|
-
"id": "
|
210
|
-
"key": "
|
200
|
+
"id": "a593293c-9c17-45c5-8c99-fc867aad580e",
|
201
|
+
"key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.field",
|
211
202
|
"value": {
|
212
203
|
"rules": [
|
213
204
|
{
|
@@ -221,8 +212,8 @@ def test_serialize_workflow():
|
|
221
212
|
},
|
222
213
|
},
|
223
214
|
{
|
224
|
-
"id": "
|
225
|
-
"key": "
|
215
|
+
"id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
|
216
|
+
"key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.value",
|
226
217
|
"value": {
|
227
218
|
"rules": [
|
228
219
|
{
|
@@ -234,8 +225,8 @@ def test_serialize_workflow():
|
|
234
225
|
},
|
235
226
|
},
|
236
227
|
{
|
237
|
-
"id": "
|
238
|
-
"key": "
|
228
|
+
"id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
|
229
|
+
"key": "aa692069-9672-4adb-b874-74da98745f24.field",
|
239
230
|
"value": {
|
240
231
|
"rules": [
|
241
232
|
{
|
@@ -249,8 +240,8 @@ def test_serialize_workflow():
|
|
249
240
|
},
|
250
241
|
},
|
251
242
|
{
|
252
|
-
"id": "
|
253
|
-
"key": "
|
243
|
+
"id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
|
244
|
+
"key": "aa692069-9672-4adb-b874-74da98745f24.value",
|
254
245
|
"value": {
|
255
246
|
"rules": [
|
256
247
|
{
|
@@ -262,8 +253,8 @@ def test_serialize_workflow():
|
|
262
253
|
},
|
263
254
|
},
|
264
255
|
{
|
265
|
-
"id": "
|
266
|
-
"key": "
|
256
|
+
"id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
|
257
|
+
"key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.field",
|
267
258
|
"value": {
|
268
259
|
"rules": [
|
269
260
|
{
|
@@ -277,8 +268,8 @@ def test_serialize_workflow():
|
|
277
268
|
},
|
278
269
|
},
|
279
270
|
{
|
280
|
-
"id": "
|
281
|
-
"key": "
|
271
|
+
"id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
|
272
|
+
"key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.value",
|
282
273
|
"value": {
|
283
274
|
"rules": [
|
284
275
|
{
|
@@ -290,8 +281,8 @@ def test_serialize_workflow():
|
|
290
281
|
},
|
291
282
|
},
|
292
283
|
{
|
293
|
-
"id": "
|
294
|
-
"key": "
|
284
|
+
"id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
|
285
|
+
"key": "e59504e1-4134-46dc-8055-114c6a606af8.field",
|
295
286
|
"value": {
|
296
287
|
"rules": [
|
297
288
|
{
|
@@ -305,8 +296,8 @@ def test_serialize_workflow():
|
|
305
296
|
},
|
306
297
|
},
|
307
298
|
{
|
308
|
-
"id": "
|
309
|
-
"key": "
|
299
|
+
"id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
|
300
|
+
"key": "e59504e1-4134-46dc-8055-114c6a606af8.value",
|
310
301
|
"value": {
|
311
302
|
"rules": [
|
312
303
|
{
|
@@ -330,13 +321,13 @@ def test_serialize_workflow():
|
|
330
321
|
"id": "2ccd0730-26d1-4fb4-baa9-1a2a182dd9a0",
|
331
322
|
"rules": [
|
332
323
|
{
|
333
|
-
"id": "
|
324
|
+
"id": "e0490a35-c863-422b-a12a-f18858d75241",
|
334
325
|
"rules": None,
|
335
326
|
"combinator": None,
|
336
327
|
"negated": False,
|
337
|
-
"field_node_input_id": "
|
328
|
+
"field_node_input_id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
|
338
329
|
"operator": "=",
|
339
|
-
"value_node_input_id": "
|
330
|
+
"value_node_input_id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
|
340
331
|
}
|
341
332
|
],
|
342
333
|
"combinator": "AND",
|
@@ -354,13 +345,13 @@ def test_serialize_workflow():
|
|
354
345
|
"id": "cc3f0d92-b603-42cc-b2e9-83e3b23b3bcb",
|
355
346
|
"rules": [
|
356
347
|
{
|
357
|
-
"id": "
|
348
|
+
"id": "f7818d41-3f66-42c7-8218-de5c30379906",
|
358
349
|
"rules": None,
|
359
350
|
"combinator": None,
|
360
351
|
"negated": False,
|
361
|
-
"field_node_input_id": "
|
352
|
+
"field_node_input_id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
|
362
353
|
"operator": "=",
|
363
|
-
"value_node_input_id": "
|
354
|
+
"value_node_input_id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
|
364
355
|
}
|
365
356
|
],
|
366
357
|
"combinator": "AND",
|
@@ -378,13 +369,13 @@ def test_serialize_workflow():
|
|
378
369
|
"id": "a5a0f391-7052-452f-9fe1-a5781a491591",
|
379
370
|
"rules": [
|
380
371
|
{
|
381
|
-
"id": "
|
372
|
+
"id": "38483416-c474-4e50-bfbc-7e92de2b4c2c",
|
382
373
|
"rules": None,
|
383
374
|
"combinator": None,
|
384
375
|
"negated": False,
|
385
|
-
"field_node_input_id": "
|
376
|
+
"field_node_input_id": "a593293c-9c17-45c5-8c99-fc867aad580e",
|
386
377
|
"operator": "=",
|
387
|
-
"value_node_input_id": "
|
378
|
+
"value_node_input_id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
|
388
379
|
}
|
389
380
|
],
|
390
381
|
"combinator": "AND",
|
@@ -402,34 +393,34 @@ def test_serialize_workflow():
|
|
402
393
|
"id": "efe7a851-2a67-4189-99ec-bc193242b270",
|
403
394
|
"rules": [
|
404
395
|
{
|
405
|
-
"id": "
|
396
|
+
"id": "aa692069-9672-4adb-b874-74da98745f24",
|
406
397
|
"rules": None,
|
407
398
|
"combinator": None,
|
408
399
|
"negated": False,
|
409
|
-
"field_node_input_id": "
|
400
|
+
"field_node_input_id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
|
410
401
|
"operator": "=",
|
411
|
-
"value_node_input_id": "
|
402
|
+
"value_node_input_id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
|
412
403
|
},
|
413
404
|
{
|
414
405
|
"id": "2c78817b-8b73-43fd-8dab-a8923018da9d",
|
415
406
|
"rules": [
|
416
407
|
{
|
417
|
-
"id": "
|
408
|
+
"id": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658",
|
418
409
|
"rules": None,
|
419
410
|
"combinator": None,
|
420
411
|
"negated": False,
|
421
|
-
"field_node_input_id": "
|
412
|
+
"field_node_input_id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
|
422
413
|
"operator": "=",
|
423
|
-
"value_node_input_id": "
|
414
|
+
"value_node_input_id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
|
424
415
|
},
|
425
416
|
{
|
426
|
-
"id": "
|
417
|
+
"id": "e59504e1-4134-46dc-8055-114c6a606af8",
|
427
418
|
"rules": None,
|
428
419
|
"combinator": None,
|
429
420
|
"negated": False,
|
430
|
-
"field_node_input_id": "
|
421
|
+
"field_node_input_id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
|
431
422
|
"operator": "=",
|
432
|
-
"value_node_input_id": "
|
423
|
+
"value_node_input_id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
|
433
424
|
},
|
434
425
|
],
|
435
426
|
"combinator": "AND",
|
@@ -446,6 +437,12 @@ def test_serialize_workflow():
|
|
446
437
|
"value_node_input_id": None,
|
447
438
|
},
|
448
439
|
},
|
440
|
+
{
|
441
|
+
"id": "c2fa8a44-923b-462a-b0d2-fa800a152e52",
|
442
|
+
"type": "ELSE",
|
443
|
+
"source_handle_id": "493024f4-8010-4e1a-abae-b6adbc6fb208",
|
444
|
+
"data": None,
|
445
|
+
},
|
449
446
|
],
|
450
447
|
"version": "2",
|
451
448
|
},
|
@@ -964,8 +961,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
964
961
|
"type": "CONDITIONAL",
|
965
962
|
"inputs": [
|
966
963
|
{
|
967
|
-
"id": "
|
968
|
-
"key": "
|
964
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
965
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
969
966
|
"value": {
|
970
967
|
"rules": [
|
971
968
|
{
|
@@ -977,8 +974,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
977
974
|
},
|
978
975
|
},
|
979
976
|
{
|
980
|
-
"id": "
|
981
|
-
"key": "
|
977
|
+
"id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
978
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
|
982
979
|
"value": {
|
983
980
|
"rules": [
|
984
981
|
{
|
@@ -1002,13 +999,13 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1002
999
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1003
1000
|
"rules": [
|
1004
1001
|
{
|
1005
|
-
"id": "
|
1002
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1006
1003
|
"rules": None,
|
1007
1004
|
"combinator": None,
|
1008
1005
|
"negated": False,
|
1009
|
-
"field_node_input_id": "
|
1006
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1010
1007
|
"operator": f"{operator}",
|
1011
|
-
"value_node_input_id": "
|
1008
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1012
1009
|
}
|
1013
1010
|
],
|
1014
1011
|
"combinator": "AND",
|
@@ -1017,14 +1014,28 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1017
1014
|
"operator": None,
|
1018
1015
|
"value_node_input_id": None,
|
1019
1016
|
},
|
1020
|
-
}
|
1017
|
+
},
|
1018
|
+
{
|
1019
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1020
|
+
"type": "ELSE",
|
1021
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1022
|
+
"data": None,
|
1023
|
+
},
|
1021
1024
|
],
|
1022
1025
|
"version": "2",
|
1023
1026
|
},
|
1024
1027
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1025
1028
|
"definition": {
|
1029
|
+
"name": "SimpleConditionalNode",
|
1030
|
+
"module": [
|
1031
|
+
"tests",
|
1032
|
+
"workflows",
|
1033
|
+
"basic_conditional_node",
|
1034
|
+
"workflow_with_only_one_conditional_node",
|
1035
|
+
],
|
1026
1036
|
"bases": [
|
1027
1037
|
{
|
1038
|
+
"name": "ConditionalNode",
|
1028
1039
|
"module": [
|
1029
1040
|
"vellum",
|
1030
1041
|
"workflows",
|
@@ -1033,16 +1044,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
|
1033
1044
|
"conditional_node",
|
1034
1045
|
"node",
|
1035
1046
|
],
|
1036
|
-
"name": "ConditionalNode",
|
1037
1047
|
}
|
1038
1048
|
],
|
1039
|
-
"module": [
|
1040
|
-
"tests",
|
1041
|
-
"workflows",
|
1042
|
-
"basic_conditional_node",
|
1043
|
-
"workflow_with_only_one_conditional_node",
|
1044
|
-
],
|
1045
|
-
"name": "SimpleConditionalNode",
|
1046
1049
|
},
|
1047
1050
|
},
|
1048
1051
|
conditional_node,
|
@@ -1084,8 +1087,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1084
1087
|
"type": "CONDITIONAL",
|
1085
1088
|
"inputs": [
|
1086
1089
|
{
|
1087
|
-
"id": "
|
1088
|
-
"key": "
|
1090
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1091
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
1089
1092
|
"value": {
|
1090
1093
|
"rules": [
|
1091
1094
|
{
|
@@ -1109,13 +1112,13 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1109
1112
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1110
1113
|
"rules": [
|
1111
1114
|
{
|
1112
|
-
"id": "
|
1115
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1113
1116
|
"rules": None,
|
1114
1117
|
"combinator": None,
|
1115
1118
|
"negated": False,
|
1116
|
-
"field_node_input_id": "
|
1119
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1117
1120
|
"operator": f"{operator}",
|
1118
|
-
"value_node_input_id":
|
1121
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1119
1122
|
}
|
1120
1123
|
],
|
1121
1124
|
"combinator": "AND",
|
@@ -1124,14 +1127,28 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1124
1127
|
"operator": None,
|
1125
1128
|
"value_node_input_id": None,
|
1126
1129
|
},
|
1127
|
-
}
|
1130
|
+
},
|
1131
|
+
{
|
1132
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1133
|
+
"type": "ELSE",
|
1134
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1135
|
+
"data": None,
|
1136
|
+
},
|
1128
1137
|
],
|
1129
1138
|
"version": "2",
|
1130
1139
|
},
|
1131
1140
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1132
1141
|
"definition": {
|
1142
|
+
"name": "SimpleConditionalNode",
|
1143
|
+
"module": [
|
1144
|
+
"tests",
|
1145
|
+
"workflows",
|
1146
|
+
"basic_conditional_node",
|
1147
|
+
"workflow_with_only_one_conditional_node",
|
1148
|
+
],
|
1133
1149
|
"bases": [
|
1134
1150
|
{
|
1151
|
+
"name": "ConditionalNode",
|
1135
1152
|
"module": [
|
1136
1153
|
"vellum",
|
1137
1154
|
"workflows",
|
@@ -1140,16 +1157,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1140
1157
|
"conditional_node",
|
1141
1158
|
"node",
|
1142
1159
|
],
|
1143
|
-
"name": "ConditionalNode",
|
1144
1160
|
}
|
1145
1161
|
],
|
1146
|
-
"module": [
|
1147
|
-
"tests",
|
1148
|
-
"workflows",
|
1149
|
-
"basic_conditional_node",
|
1150
|
-
"workflow_with_only_one_conditional_node",
|
1151
|
-
],
|
1152
|
-
"name": "SimpleConditionalNode",
|
1153
1162
|
},
|
1154
1163
|
},
|
1155
1164
|
conditional_node,
|
@@ -1195,8 +1204,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1195
1204
|
"type": "CONDITIONAL",
|
1196
1205
|
"inputs": [
|
1197
1206
|
{
|
1198
|
-
"id": "
|
1199
|
-
"key": "
|
1207
|
+
"id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1208
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
|
1200
1209
|
"value": {
|
1201
1210
|
"rules": [
|
1202
1211
|
{
|
@@ -1208,8 +1217,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1208
1217
|
},
|
1209
1218
|
},
|
1210
1219
|
{
|
1211
|
-
"id": "
|
1212
|
-
"key": "
|
1220
|
+
"id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1221
|
+
"key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
|
1213
1222
|
"value": {
|
1214
1223
|
"rules": [
|
1215
1224
|
{
|
@@ -1233,13 +1242,13 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1233
1242
|
"id": "650e7105-3e76-43ca-858f-b290970b438b",
|
1234
1243
|
"rules": [
|
1235
1244
|
{
|
1236
|
-
"id": "
|
1245
|
+
"id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
|
1237
1246
|
"rules": None,
|
1238
1247
|
"combinator": None,
|
1239
1248
|
"negated": False,
|
1240
|
-
"field_node_input_id": "
|
1249
|
+
"field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
|
1241
1250
|
"operator": f"{operator}",
|
1242
|
-
"value_node_input_id": "
|
1251
|
+
"value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
|
1243
1252
|
}
|
1244
1253
|
],
|
1245
1254
|
"combinator": "AND",
|
@@ -1248,14 +1257,28 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1248
1257
|
"operator": None,
|
1249
1258
|
"value_node_input_id": None,
|
1250
1259
|
},
|
1251
|
-
}
|
1260
|
+
},
|
1261
|
+
{
|
1262
|
+
"id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
|
1263
|
+
"type": "ELSE",
|
1264
|
+
"source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
|
1265
|
+
"data": None,
|
1266
|
+
},
|
1252
1267
|
],
|
1253
1268
|
"version": "2",
|
1254
1269
|
},
|
1255
1270
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
1256
1271
|
"definition": {
|
1272
|
+
"name": "SimpleConditionalNode",
|
1273
|
+
"module": [
|
1274
|
+
"tests",
|
1275
|
+
"workflows",
|
1276
|
+
"basic_conditional_node",
|
1277
|
+
"workflow_with_only_one_conditional_node",
|
1278
|
+
],
|
1257
1279
|
"bases": [
|
1258
1280
|
{
|
1281
|
+
"name": "ConditionalNode",
|
1259
1282
|
"module": [
|
1260
1283
|
"vellum",
|
1261
1284
|
"workflows",
|
@@ -1264,16 +1287,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
|
1264
1287
|
"conditional_node",
|
1265
1288
|
"node",
|
1266
1289
|
],
|
1267
|
-
"name": "ConditionalNode",
|
1268
1290
|
}
|
1269
1291
|
],
|
1270
|
-
"module": [
|
1271
|
-
"tests",
|
1272
|
-
"workflows",
|
1273
|
-
"basic_conditional_node",
|
1274
|
-
"workflow_with_only_one_conditional_node",
|
1275
|
-
],
|
1276
|
-
"name": "SimpleConditionalNode",
|
1277
1292
|
},
|
1278
1293
|
},
|
1279
1294
|
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,
|