vellum-ai 0.14.70__py3-none-any.whl → 0.14.72__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/plugins/vellum_mypy.py +1 -1
- vellum/workflows/environment/environment.py +5 -2
- vellum/workflows/events/__init__.py +2 -0
- vellum/workflows/events/stream.py +28 -0
- vellum/workflows/events/workflow.py +3 -2
- vellum/workflows/nodes/displayable/code_execution_node/node.py +8 -1
- vellum/workflows/nodes/displayable/code_execution_node/tests/test_node.py +53 -0
- vellum/workflows/nodes/experimental/tool_calling_node/node.py +1 -1
- vellum/workflows/nodes/experimental/tool_calling_node/utils.py +2 -2
- vellum/workflows/references/environment_variable.py +11 -8
- vellum/workflows/runner/runner.py +21 -3
- vellum/workflows/utils/functions.py +55 -1
- vellum/workflows/utils/tests/test_functions.py +151 -1
- vellum/workflows/utils/tests/test_vellum_variables.py +25 -1
- vellum/workflows/utils/vellum_variables.py +30 -0
- vellum/workflows/workflows/base.py +11 -5
- {vellum_ai-0.14.70.dist-info → vellum_ai-0.14.72.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.70.dist-info → vellum_ai-0.14.72.dist-info}/RECORD +34 -31
- vellum_cli/image_push.py +1 -5
- vellum_cli/push.py +7 -0
- vellum_cli/tests/test_image_push.py +1 -2
- vellum_cli/tests/test_push.py +33 -2
- vellum_ee/workflows/display/nodes/utils.py +2 -2
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +7 -3
- vellum_ee/workflows/display/nodes/vellum/search_node.py +69 -6
- vellum_ee/workflows/display/nodes/vellum/tests/test_search_node.py +104 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py +82 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_serialization.py +4 -4
- vellum_ee/workflows/display/tests/workflow_serialization/test_workflow_input_parameterization_error.py +37 -0
- vellum_ee/workflows/display/utils/expressions.py +10 -1
- {vellum_ai-0.14.70.dist-info → vellum_ai-0.14.72.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.70.dist-info → vellum_ai-0.14.72.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.70.dist-info → vellum_ai-0.14.72.dist-info}/entry_points.txt +0 -0
@@ -3,22 +3,22 @@ vellum_cli/README.md,sha256=2NudRoLzWxNKqnuVy1JuQ7DerIaxWGYkrH8kMd-asIE,90
|
|
3
3
|
vellum_cli/__init__.py,sha256=oi-vvNVepu23IBBjhA5uUIDVYBPqQ3EzxWZAPn2S64c,12700
|
4
4
|
vellum_cli/aliased_group.py,sha256=ugW498j0yv4ALJ8vS9MsO7ctDW7Jlir9j6nE_uHAP8c,3363
|
5
5
|
vellum_cli/config.py,sha256=v5BmZ-t_v4Jmqd7KVuQMZF2pRI-rbMspSkVYXIRoTmI,9448
|
6
|
-
vellum_cli/image_push.py,sha256=
|
6
|
+
vellum_cli/image_push.py,sha256=rPeSfTlFpdTzwTdnXRL82OVd61qMoGFGLxnLjZLU98Q,10596
|
7
7
|
vellum_cli/init.py,sha256=WpnMXPItPmh0f0bBGIer3p-e5gu8DUGwSArT_FuoMEw,5093
|
8
8
|
vellum_cli/logger.py,sha256=dcM_OmgqXLo93vDYswO5ylyUQQcTfnA5GTd5tbIt3wM,1446
|
9
9
|
vellum_cli/ping.py,sha256=p_BCCRjgPhng6JktuECtkDQLbhopt6JpmrtGoLnLJT8,1161
|
10
10
|
vellum_cli/pull.py,sha256=udYyPlJ6VKDdh78rApNJOZgxHl82fcV6iGnRPSdX1LY,14750
|
11
|
-
vellum_cli/push.py,sha256=
|
11
|
+
vellum_cli/push.py,sha256=TqzaJrI_ty_1GuB3HX3EKfAnbMUF14FWfMMTD06vn2I,10428
|
12
12
|
vellum_cli/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
vellum_cli/tests/conftest.py,sha256=AFYZryKA2qnUuCPBxBKmHLFoPiE0WhBFFej9tNwSHdc,1526
|
14
14
|
vellum_cli/tests/test_config.py,sha256=uvKGDc8BoVyT9_H0Z-g8469zVxomn6Oi3Zj-vK7O_wU,2631
|
15
|
-
vellum_cli/tests/test_image_push.py,sha256=
|
15
|
+
vellum_cli/tests/test_image_push.py,sha256=xXZjI-CDp166cmk5P1NTa-aogergeIbcdfK4_KBsoHc,9095
|
16
16
|
vellum_cli/tests/test_image_push_error_handling.py,sha256=_Wjfkn1orI2K4Ahzqz4u8T13or7NOX01K4BtcTuTIOM,7107
|
17
17
|
vellum_cli/tests/test_init.py,sha256=8UOc_ThfouR4ja5cCl_URuLk7ohr9JXfCnG4yka1OUQ,18754
|
18
18
|
vellum_cli/tests/test_main.py,sha256=qDZG-aQauPwBwM6A2DIu1494n47v3pL28XakTbLGZ-k,272
|
19
19
|
vellum_cli/tests/test_ping.py,sha256=3ucVRThEmTadlV9LrJdCCrr1Ofj3rOjG6ue0BNR2UC0,2523
|
20
20
|
vellum_cli/tests/test_pull.py,sha256=hxMbW_j0weDDrkzVGpvLpFcwNQdn-fxTv4wBHeYizzc,49904
|
21
|
-
vellum_cli/tests/test_push.py,sha256=
|
21
|
+
vellum_cli/tests/test_push.py,sha256=uyWknZ1CBkxxfKVdwcyv7fkGSxvvSNRdJegp5cV-_V4,35167
|
22
22
|
vellum_ee/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
vellum_ee/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
vellum_ee/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -32,7 +32,7 @@ vellum_ee/workflows/display/nodes/get_node_display_class.py,sha256=jI_kUi9LnNLDp
|
|
32
32
|
vellum_ee/workflows/display/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
vellum_ee/workflows/display/nodes/tests/test_base_node_display.py,sha256=Z4Mf7xLCNiblSbpKI0BrV5modQr-ZcFzhfir_OSyTTs,2997
|
34
34
|
vellum_ee/workflows/display/nodes/types.py,sha256=St1BB6no528OyELGiyRabWao0GGw6mLhstQAvEACbGk,247
|
35
|
-
vellum_ee/workflows/display/nodes/utils.py,sha256=
|
35
|
+
vellum_ee/workflows/display/nodes/utils.py,sha256=sloya5TpXsnot1HURc9L51INwflRqUzHxRVnCS9Cd-4,973
|
36
36
|
vellum_ee/workflows/display/nodes/vellum/__init__.py,sha256=nUIgH2s0-7IbQRNrBhLPyRNe8YIrx3Yo9HeeW-aXXFk,1668
|
37
37
|
vellum_ee/workflows/display/nodes/vellum/api_node.py,sha256=5Uq8x08F64yrBcqbfsVeuoGnTa9eoOPumYzZZrDPmr0,8847
|
38
38
|
vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py,sha256=rJbHZBg9A_v2bjk-R6MfWzShcrS2gcKIOyYGoqwTx8s,6353
|
@@ -41,14 +41,14 @@ vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=9GtbvSJUNF62
|
|
41
41
|
vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=YhMsi2TG1zSR8E7IpxzzSncOyVLcvqTuGa3mr4RqHd8,2364
|
42
42
|
vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=zo-nalsuayMqeb2GwR2OB9SFK3y2U5aG-rtwrsjdasQ,3089
|
43
43
|
vellum_ee/workflows/display/nodes/vellum/guardrail_node.py,sha256=IniO5KvO0Rw9zghFg3RFvbXBTv6Zi1iuQhaA1DLazqU,2331
|
44
|
-
vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=
|
44
|
+
vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=1ydd1-SXCuJdPDquMrvV5JXIIhf7eBdvY2dXqDz_r5o,11035
|
45
45
|
vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py,sha256=f7MeoxgKrdyb1dSJsvdDtZPlp1J2Pa4njPvN3qHVktA,6028
|
46
46
|
vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=uaZ2wcZR1J9C9iI0QWAsgNK9IlcuCz1808oxXmiYsLY,3908
|
47
47
|
vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=RTP_raQWL8ZKoRKLpxLfpyXzw61TZeTCkTuM1uRLIkI,3274
|
48
48
|
vellum_ee/workflows/display/nodes/vellum/note_node.py,sha256=6xf8MJ684KecKPJrGlCJuJYLPtYImXmqN85Y_6KPjW4,1141
|
49
49
|
vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py,sha256=cT5qT7Nd2v6rSsIErpSAWaxta7txGOSFOZz2AQYQmWE,3536
|
50
50
|
vellum_ee/workflows/display/nodes/vellum/retry_node.py,sha256=Gos8F1yKN69GmegDO2q3NlGTamibd4rpuTasSU0mK8c,3281
|
51
|
-
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=
|
51
|
+
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=bF07csUFSQlAeOayPPws5pz3tBTp1PdwgHb8WItgXmY,12319
|
52
52
|
vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py,sha256=Ub6XDdVtVarqoqQrIXpJxNbp3xvz37vwpuf93DhLvX8,2670
|
53
53
|
vellum_ee/workflows/display/nodes/vellum/templating_node.py,sha256=TdIJWh2l8p4tw7ejRexGOFQKnviirUqie3WYwsrVQ4g,3339
|
54
54
|
vellum_ee/workflows/display/nodes/vellum/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -59,6 +59,7 @@ vellum_ee/workflows/display/nodes/vellum/tests/test_note_node.py,sha256=uiMB0cOx
|
|
59
59
|
vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py,sha256=G-qJyTNJkpqJiEZ3kCJl86CXJINLeFyf2lM0bQHCCOs,3822
|
60
60
|
vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=TtzUj3Zk3ZhwtXE_WyctCC-CmcLB1RxntyF7u-a3i6I,10077
|
61
61
|
vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py,sha256=h93ysolmbo2viisyhRnXKHPxiDK0I_dSAbYoHFYIoO4,1953
|
62
|
+
vellum_ee/workflows/display/nodes/vellum/tests/test_search_node.py,sha256=KvByxgbUkVyfPIVxTUBUk6a92JiJMi8eReZWxzfPExU,3864
|
62
63
|
vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py,sha256=BUzHJgjdWnPeZxjFjHfDBKnbFjYjnbXPjc-1hne1B2Y,3965
|
63
64
|
vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py,sha256=LSk2gx9TpGXbAqKe8dggQW8yJZqj-Cf0EGJFeGGlEcw,3321
|
64
65
|
vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py,sha256=ZsLIGnJ9QKrXjYeDW8LEN8M9FnWRQ9TohHFyB6144HY,7970
|
@@ -83,12 +84,12 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_default_stat
|
|
83
84
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py,sha256=MNnQ51ZWOQGVfBdpIqvr4OZF0tWdfrh2bsHP3xkTwQw,5841
|
84
85
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_generic_node_serialization.py,sha256=kLOnUNn-r1w1JXNQcVKe-Vp-fKhSfuDBuDqrjGkFZ3U,5544
|
85
86
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py,sha256=v07cILUzS5iFYDrSOAXK93yz50-FtxLaMYMwoaPOv20,7374
|
86
|
-
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py,sha256=
|
87
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py,sha256=glOPy9y_GOLGMxc7glfo7IGq5iuCDbz9-TE_6Krha2U,18426
|
87
88
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py,sha256=1ND_6lfPNUQjSc72k_sxydeeOU5f_kHkRXO65boYFok,21631
|
88
89
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py,sha256=3gZuNM8sT6ovVaeoAvd2JoyKwuxokvowlhH8kwDUoZ8,16559
|
89
90
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py,sha256=IIJt7YZBzkhNtbmaMwCX4ENs58QtSIIoBHlMR6OwGU8,8342
|
90
91
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py,sha256=QXiRjwtiTPeMUl40Pvh_geeU99C3mv1aVS85oeIUwY4,21052
|
91
|
-
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_serialization.py,sha256=
|
92
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_serialization.py,sha256=JuosR1Xvyy2-0UKuCxx0P_3QH3OXgU88llxpyQ7NScM,12936
|
92
93
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py,sha256=KkYZc_bZuq1lmDcvUz3QxIqJLpQPCZioD1FHUNsMJY8,11211
|
93
94
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py,sha256=aZaqRDrkO3ytcmdM2eKJqHSt60MF070NMj6M2vgzOKc,7711
|
94
95
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py,sha256=r748dpS13HtwY7t_KQFExFssxRy0xI2d-wxmhiUHRe0,3850
|
@@ -96,11 +97,12 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling
|
|
96
97
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=Cx3oY6vPVap0xm_mChqfQw4zzR4pqV36o_SyD8g6jPY,8727
|
97
98
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=EL5kfakuoEcwD85dGjhMta-J-PpCHRSDoc80SdbBrQk,2769
|
98
99
|
vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=RmFUDx8dYdfsOE2CGLvdXqNNRtLLpVzXDN8dqZyMcZ8,5822
|
100
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_workflow_input_parameterization_error.py,sha256=vAdmn3YTBDpo55znbydQxsgg9ASqHcvsUPwiBR_7wfo,1461
|
99
101
|
vellum_ee/workflows/display/types.py,sha256=i4T7ElU5b5h-nA1i3scmEhO1BqmNDc4eJDHavATD88w,2821
|
100
102
|
vellum_ee/workflows/display/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
103
|
vellum_ee/workflows/display/utils/auto_layout.py,sha256=R_BLSZjdanj3UIR4cS6WVT6ek0i7AKJyHSjK1wPiois,3877
|
102
104
|
vellum_ee/workflows/display/utils/exceptions.py,sha256=LSwwxCYNxFkf5XMUcFkaZKpQ13OSrI7y_bpEUwbKVk0,169
|
103
|
-
vellum_ee/workflows/display/utils/expressions.py,sha256=
|
105
|
+
vellum_ee/workflows/display/utils/expressions.py,sha256=bSZ-sRByLCsut8XcRkCFbbqYvw9p7tlIeF-HFnEm664,14354
|
104
106
|
vellum_ee/workflows/display/utils/registry.py,sha256=fWIm5Jj-10gNFjgn34iBu4RWv3Vd15ijtSN0V97bpW8,1513
|
105
107
|
vellum_ee/workflows/display/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
106
108
|
vellum_ee/workflows/display/utils/tests/test_auto_layout.py,sha256=vfXI769418s9vda5Gb5NFBH747WMOwSgHRXeLCTLVm8,2356
|
@@ -140,7 +142,7 @@ vellum/client/README.md,sha256=CuGUYnaE0Imt0KqQ4sIPaUghCjLHkF3DdEvZWu14-8s,4807
|
|
140
142
|
vellum/client/__init__.py,sha256=AYopGv2ZRVn3zsU8_km6KOvEHDbXiTPCVuYVI7bWvdA,120166
|
141
143
|
vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
142
144
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
143
|
-
vellum/client/core/client_wrapper.py,sha256=
|
145
|
+
vellum/client/core/client_wrapper.py,sha256=TaQmB_GjRpi-KMiR3qBKQTy1uf4a2n9roQbenkHDwBQ,1869
|
144
146
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
145
147
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
146
148
|
vellum/client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
|
@@ -828,7 +830,7 @@ vellum/evaluations/utils/paginator.py,sha256=rEED_BJAXAM6tM1yMwHePNzszjq_tTq4NbQ
|
|
828
830
|
vellum/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
829
831
|
vellum/plugins/pydantic.py,sha256=j4ApZ5WyaoCX6v54qNoShhMFyft_uKWTkyAFz5wbcgg,3619
|
830
832
|
vellum/plugins/utils.py,sha256=cPmxE9R2CK1bki2jKE8rB-G9zMf2pzHjSPDHFPXwd3Q,878
|
831
|
-
vellum/plugins/vellum_mypy.py,sha256=
|
833
|
+
vellum/plugins/vellum_mypy.py,sha256=hfjC2rIxNdQuJa6fIN4PDgODnQ3YaUszyaV2eNbLJlE,27952
|
832
834
|
vellum/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
833
835
|
vellum/prompts/blocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
834
836
|
vellum/prompts/blocks/compilation.py,sha256=qeC_4La5auQkm4EyzCMpN34F5R8mjiGcLV7IxKgVf3k,9973
|
@@ -1504,15 +1506,16 @@ vellum/workflows/edges/edge.py,sha256=N0SnY3gKVuxImPAdCbPMPlHJIXbkQ3fwq_LbJRvVMF
|
|
1504
1506
|
vellum/workflows/emitters/__init__.py,sha256=YyOgaoLtVW8eFNEWODzCYb0HzL0PoSeNRf4diJ1Y0dk,80
|
1505
1507
|
vellum/workflows/emitters/base.py,sha256=D5SADKIvnbgKwIBgYm77jaqvpo1o0rz4MmuX_muRqQU,359
|
1506
1508
|
vellum/workflows/environment/__init__.py,sha256=TJz0m9dwIs6YOwCTeuN0HHsU-ecyjc1OJXx4AFy83EQ,121
|
1507
|
-
vellum/workflows/environment/environment.py,sha256=
|
1509
|
+
vellum/workflows/environment/environment.py,sha256=Ck3RPKXJvtMGx_toqYQQQF-ZwXm5ijVwJpEPTeIJ4_Q,471
|
1508
1510
|
vellum/workflows/errors/__init__.py,sha256=tWGPu5xyAU8gRb8_bl0fL7OfU3wxQ9UH6qVwy4X4P_Q,113
|
1509
1511
|
vellum/workflows/errors/types.py,sha256=nUWuniEfrhdtb-_2GzoDGlYnSJ_yuNUGjVkaKLNr-rM,4049
|
1510
|
-
vellum/workflows/events/__init__.py,sha256=
|
1512
|
+
vellum/workflows/events/__init__.py,sha256=V4mh766fyA70WvHelm9kfVZGrUgEKcJ9tJt8EepfQYU,832
|
1511
1513
|
vellum/workflows/events/node.py,sha256=TaawUxKaZG8cv_GkiKnJmjOmC4Ic0wMlsxUduF2Rbpw,5446
|
1514
|
+
vellum/workflows/events/stream.py,sha256=xhXJTZirFi0xad5neAQNogrIQ4h47fpnKbVC3vCM5Js,889
|
1512
1515
|
vellum/workflows/events/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1513
1516
|
vellum/workflows/events/tests/test_event.py,sha256=elg5j3MOdWQe-JjshopqVwd716Jrvtr9P_V2JUGZC60,17866
|
1514
1517
|
vellum/workflows/events/types.py,sha256=LwgFlMRbptJvdPtPO1POUtGtbhGw7BSuvgHxNSgS7N8,4652
|
1515
|
-
vellum/workflows/events/workflow.py,sha256=
|
1518
|
+
vellum/workflows/events/workflow.py,sha256=7rb1evKsTCRUdCnisAM5Anc19ZKGxnsmzwOOv6jwWEI,7761
|
1516
1519
|
vellum/workflows/exceptions.py,sha256=NiBiR3ggfmPxBVqD-H1SqmjI-7mIn0EStSN1BqApvCM,1213
|
1517
1520
|
vellum/workflows/expressions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1518
1521
|
vellum/workflows/expressions/accessor.py,sha256=1kY0sYfednQ_u0kh1Df2WTsDREVIOzU7UuZc5jvj5xw,2861
|
@@ -1608,11 +1611,11 @@ vellum/workflows/nodes/displayable/bases/tests/test_utils.py,sha256=eqdqbKNRWVMD
|
|
1608
1611
|
vellum/workflows/nodes/displayable/bases/types.py,sha256=C37B2Qh2YP7s7pUjd-EYKc2Zl1TbnCgI_mENuUSb8bo,1706
|
1609
1612
|
vellum/workflows/nodes/displayable/bases/utils.py,sha256=ckMUenSsNkiYmSw6FmjSMHYaCk8Y8_sUjL6lkFFEqts,5412
|
1610
1613
|
vellum/workflows/nodes/displayable/code_execution_node/__init__.py,sha256=0FLWMMktpzSnmBMizQglBpcPrP80fzVsoJwJgf822Cg,76
|
1611
|
-
vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=
|
1614
|
+
vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=Qh4SPafzdRKbVKQH3h9SgH4vKeQQjvHAfP8ttUxLA2M,10304
|
1612
1615
|
vellum/workflows/nodes/displayable/code_execution_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1613
1616
|
vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1614
1617
|
vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/main.py,sha256=5QsbmkzSlSbcbWTG_JmIqcP-JNJzOPTKxGzdHos19W4,79
|
1615
|
-
vellum/workflows/nodes/displayable/code_execution_node/tests/test_node.py,sha256=
|
1618
|
+
vellum/workflows/nodes/displayable/code_execution_node/tests/test_node.py,sha256=47W5fPLpDcaKhCVuauKOwcivx1NfhpbsRMPrs-WBnlY,38441
|
1616
1619
|
vellum/workflows/nodes/displayable/code_execution_node/utils.py,sha256=VRTKms59vrSR9mDk99cojParZVAP4lzjEeDwDNXU1tk,3837
|
1617
1620
|
vellum/workflows/nodes/displayable/conditional_node/__init__.py,sha256=AS_EIqFdU1F9t8aLmbZU-rLh9ry6LCJ0uj0D8F0L5Uw,72
|
1618
1621
|
vellum/workflows/nodes/displayable/conditional_node/node.py,sha256=71ZUNfTiD7t2Kai2ypw0tmv1lSf1brQaHAQD-SeUrGE,1101
|
@@ -1656,9 +1659,9 @@ vellum/workflows/nodes/experimental/__init__.py,sha256=_tpZGWAZLydcKxfrj1-plrZeT
|
|
1656
1659
|
vellum/workflows/nodes/experimental/openai_chat_completion_node/__init__.py,sha256=lsyD9laR9p7kx5-BXGH2gUTM242UhKy8SMV0SR6S2iE,90
|
1657
1660
|
vellum/workflows/nodes/experimental/openai_chat_completion_node/node.py,sha256=cKI2Ls25L-JVt4z4a2ozQa-YBeVy21Z7BQ32Sj7iBPE,10460
|
1658
1661
|
vellum/workflows/nodes/experimental/tool_calling_node/__init__.py,sha256=S7OzT3I4cyOU5Beoz87nPwCejCMP2FsHBFL8OcVmxJ4,118
|
1659
|
-
vellum/workflows/nodes/experimental/tool_calling_node/node.py,sha256=
|
1662
|
+
vellum/workflows/nodes/experimental/tool_calling_node/node.py,sha256=1Sp-Jnziz8lK5t7snBIwhMk_wKzsXu_aqW7xAeHKc_w,5797
|
1660
1663
|
vellum/workflows/nodes/experimental/tool_calling_node/tests/test_node.py,sha256=7x_o81vT7gWtVw3zDppcWnlJbakgxx_oI1esqhs2gpI,4551
|
1661
|
-
vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=
|
1664
|
+
vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=UiQ1o2tDl7EYLHY9HRWLa-MeuYPYfXp8lo2qNFakh2Q,9955
|
1662
1665
|
vellum/workflows/nodes/mocks.py,sha256=a1FjWEIocseMfjzM-i8DNozpUsaW0IONRpZmXBoWlyc,10455
|
1663
1666
|
vellum/workflows/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1664
1667
|
vellum/workflows/nodes/tests/test_mocks.py,sha256=mfPvrs75PKcsNsbJLQAN6PDFoVqs9TmQxpdyFKDdO60,7837
|
@@ -1672,7 +1675,7 @@ vellum/workflows/ports/port.py,sha256=j_qiZlpx-a1cK5E7sxXwPcb_9NS-KUM-JoP8mgqg32
|
|
1672
1675
|
vellum/workflows/ports/utils.py,sha256=cWJ9xX1KrHBTiU3xe6t7Rs0yaOy9RV18GMtHaAshAsc,3094
|
1673
1676
|
vellum/workflows/references/__init__.py,sha256=glHFC1VfXmcbNvH5VzFbkT03d8_D7MMcvEcsUBrzLIs,591
|
1674
1677
|
vellum/workflows/references/constant.py,sha256=6yUT4q1sMj1hkI_tzzQ9AYcmeeDYFUNCqUq_W2DN0S8,540
|
1675
|
-
vellum/workflows/references/environment_variable.py,sha256
|
1678
|
+
vellum/workflows/references/environment_variable.py,sha256=evpxiBKzBk74JzxBXWkfTrZe4Kx-fuUG1W6XjtXzaUw,700
|
1676
1679
|
vellum/workflows/references/execution_count.py,sha256=JILHqt8ELdc9ct-WsVCA5X-rKiP1rmJODw-XTf4kpHI,722
|
1677
1680
|
vellum/workflows/references/external_input.py,sha256=c_4SojTpykCSbGS1Pjmx9FfquyYGMPksoj0AbrWv7Go,2064
|
1678
1681
|
vellum/workflows/references/input.py,sha256=3INu-TLTi4dziWmva6LO3WvgDlPzsjayUx61cVvqLJA,325
|
@@ -1686,7 +1689,7 @@ vellum/workflows/references/workflow_input.py,sha256=W3rOK1EPd2gYHb04WJwmNm1CUSd
|
|
1686
1689
|
vellum/workflows/resolvers/__init__.py,sha256=eH6hTvZO4IciDaf_cf7aM2vs-DkBDyJPycOQevJxQnI,82
|
1687
1690
|
vellum/workflows/resolvers/base.py,sha256=WHra9LRtlTuB1jmuNqkfVE2JUgB61Cyntn8f0b0WZg4,411
|
1688
1691
|
vellum/workflows/runner/__init__.py,sha256=i1iG5sAhtpdsrlvwgH6B-m49JsINkiWyPWs8vyT-bqM,72
|
1689
|
-
vellum/workflows/runner/runner.py,sha256=
|
1692
|
+
vellum/workflows/runner/runner.py,sha256=itKhjnJBIXrKcI3nKbKsAwcmeP4pn5BowX-LaTPu_VU,33911
|
1690
1693
|
vellum/workflows/sandbox.py,sha256=GVJzVjMuYzOBnSrboB0_6MMRZWBluAyQ2o7syeaeBd0,2235
|
1691
1694
|
vellum/workflows/state/__init__.py,sha256=yUUdR-_Vl7UiixNDYQZ-GEM_kJI9dnOia75TtuNEsnE,60
|
1692
1695
|
vellum/workflows/state/base.py,sha256=WIMJYyuHUrP4zt0Nudk66HAK1L6GgGmsU_GQp7BGE2U,22189
|
@@ -1708,24 +1711,24 @@ vellum/workflows/types/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
1708
1711
|
vellum/workflows/types/tests/test_utils.py,sha256=UnZog59tR577mVwqZRqqWn2fScoOU1H6up0EzS8zYhw,2536
|
1709
1712
|
vellum/workflows/types/utils.py,sha256=axxHbPLsnjhEOnMZrc5YarFd-P2bnsacBDQGNCvY8OY,6367
|
1710
1713
|
vellum/workflows/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1711
|
-
vellum/workflows/utils/functions.py,sha256=
|
1714
|
+
vellum/workflows/utils/functions.py,sha256=Gw9akY-_xU_kJpbkYvQ-07hOOLJpqq0rtch_3FbgFQ0,7169
|
1712
1715
|
vellum/workflows/utils/names.py,sha256=QLUqfJ1tmSEeUwBKTTiv_Qk3QGbInC2RSmlXfGXc8Wo,380
|
1713
1716
|
vellum/workflows/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1714
|
-
vellum/workflows/utils/tests/test_functions.py,sha256=
|
1717
|
+
vellum/workflows/utils/tests/test_functions.py,sha256=4mhIhZdlZdiboq1NUhJlOvDeRrpG-Oa_HrstvSbjg64,18368
|
1715
1718
|
vellum/workflows/utils/tests/test_names.py,sha256=aOqpyvMsOEK_9mg_-yaNxQDW7QQfwqsYs37PseyLhxw,402
|
1716
1719
|
vellum/workflows/utils/tests/test_uuids.py,sha256=i77ABQ0M3S-aFLzDXHJq_yr5FPkJEWCMBn1HJ3DObrE,437
|
1717
|
-
vellum/workflows/utils/tests/test_vellum_variables.py,sha256=
|
1720
|
+
vellum/workflows/utils/tests/test_vellum_variables.py,sha256=vbnKgm41aB5OXlO-ZIPbhQ6xDiZkT8KMxCLqz4zocWY,1791
|
1718
1721
|
vellum/workflows/utils/uuids.py,sha256=DFzPv9RCvsKhvdTEIQyfSek2A31D6S_QcmeLPbgrgTY,739
|
1719
|
-
vellum/workflows/utils/vellum_variables.py,sha256=
|
1722
|
+
vellum/workflows/utils/vellum_variables.py,sha256=tDWGyE8CfxYaCQQfMwTHqQNgK5V5sJMuhjLsliT8Ar4,4286
|
1720
1723
|
vellum/workflows/vellum_client.py,sha256=xkfoucodxNK5JR2-lbRqZx3xzDgExWkP6kySrpi_Ubc,1079
|
1721
1724
|
vellum/workflows/workflows/__init__.py,sha256=KY45TqvavCCvXIkyCFMEc0dc6jTMOUci93U2DUrlZYc,66
|
1722
|
-
vellum/workflows/workflows/base.py,sha256=
|
1725
|
+
vellum/workflows/workflows/base.py,sha256=ehJSHDf1vuNjJtKryqKgb5HKGtx_D-wWUiJNBWZ50JU,24347
|
1723
1726
|
vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnadGsrSZGa7t7LpJA,2008
|
1724
1727
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1725
1728
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=fROqff6AZpCIzaSwOKSdtYy4XR0UZQ6ejxL3RJOSJVs,20447
|
1726
1729
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1727
|
-
vellum_ai-0.14.
|
1728
|
-
vellum_ai-0.14.
|
1729
|
-
vellum_ai-0.14.
|
1730
|
-
vellum_ai-0.14.
|
1731
|
-
vellum_ai-0.14.
|
1730
|
+
vellum_ai-0.14.72.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1731
|
+
vellum_ai-0.14.72.dist-info/METADATA,sha256=5rmPI1o0CHUiw7gPjZq2ZSjkiaWzLTbWTxG0pCyP3WA,5556
|
1732
|
+
vellum_ai-0.14.72.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1733
|
+
vellum_ai-0.14.72.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1734
|
+
vellum_ai-0.14.72.dist-info/RECORD,,
|
vellum_cli/image_push.py
CHANGED
@@ -30,12 +30,8 @@ def image_push_command(
|
|
30
30
|
if not os.path.exists(source):
|
31
31
|
handle_cli_error(logger, "Dockerfile not found", f"Dockerfile does not exist: {source}")
|
32
32
|
|
33
|
-
source_dir = os.path.dirname(source)
|
34
|
-
dockerfile_name = os.path.basename(source)
|
35
|
-
|
36
33
|
build_result = subprocess.run(
|
37
|
-
["docker", "buildx", "build", "-f",
|
38
|
-
cwd=source_dir,
|
34
|
+
["docker", "buildx", "build", "-f", source, "--platform=linux/amd64", "-t", image, "."],
|
39
35
|
stdout=subprocess.PIPE,
|
40
36
|
stderr=subprocess.PIPE,
|
41
37
|
)
|
vellum_cli/push.py
CHANGED
@@ -242,6 +242,13 @@ def push_command(
|
|
242
242
|
{json.dumps(response.proposed_diffs, indent=2)}
|
243
243
|
"""
|
244
244
|
) # type: ignore[attr-defined]
|
245
|
+
|
246
|
+
error_list = list(workflow_display.errors)
|
247
|
+
has_errors = len(error_list) > 0
|
248
|
+
has_diffs = response.proposed_diffs is not None and response.proposed_diffs
|
249
|
+
|
250
|
+
if has_errors or has_diffs:
|
251
|
+
exit(1)
|
245
252
|
else:
|
246
253
|
default_api_url = client._client_wrapper._environment.default
|
247
254
|
base_url = default_api_url.split("/v1")[0].replace("//api.", "//app.")
|
@@ -209,13 +209,12 @@ def test_image_push_with_source_success(
|
|
209
209
|
"buildx",
|
210
210
|
"build",
|
211
211
|
"-f",
|
212
|
-
|
212
|
+
dockerfile_path,
|
213
213
|
"--platform=linux/amd64",
|
214
214
|
"-t",
|
215
215
|
"myimage:latest",
|
216
216
|
".",
|
217
217
|
]
|
218
|
-
assert build_call[1]["cwd"] == mock_temp_dir
|
219
218
|
|
220
219
|
assert "Docker build completed successfully" in result.output
|
221
220
|
assert "Image successfully pushed" in result.output
|
vellum_cli/tests/test_push.py
CHANGED
@@ -444,8 +444,8 @@ class ExampleWorkflow(BaseWorkflow):
|
|
444
444
|
runner = CliRunner(mix_stderr=True)
|
445
445
|
result = runner.invoke(cli_main, ["push", module, "--dry-run"])
|
446
446
|
|
447
|
-
# THEN it should
|
448
|
-
assert result.exit_code ==
|
447
|
+
# THEN it should fail with exit code 1 due to errors
|
448
|
+
assert result.exit_code == 1
|
449
449
|
|
450
450
|
# AND we should have called the push API with the dry-run option
|
451
451
|
vellum_client.workflows.push.assert_called_once()
|
@@ -459,6 +459,37 @@ class ExampleWorkflow(BaseWorkflow):
|
|
459
459
|
assert "iterable_item_added" in result.output
|
460
460
|
|
461
461
|
|
462
|
+
def test_push__dry_run_option_no_errors_returns_success(mock_module, vellum_client):
|
463
|
+
"""Test that dry-run returns exit code 0 when there are no errors or diffs"""
|
464
|
+
# GIVEN a workflow module with a valid workflow (using the same pattern as happy path test)
|
465
|
+
temp_dir = mock_module.temp_dir
|
466
|
+
module = mock_module.module
|
467
|
+
_ensure_workflow_py(temp_dir, module)
|
468
|
+
|
469
|
+
# AND the push API call returns successfully with no errors and no diffs
|
470
|
+
vellum_client.workflows.push.return_value = WorkflowPushResponse(
|
471
|
+
workflow_sandbox_id=str(uuid4()),
|
472
|
+
proposed_diffs=None,
|
473
|
+
)
|
474
|
+
|
475
|
+
# WHEN calling `vellum push` with dry-run
|
476
|
+
runner = CliRunner(mix_stderr=True)
|
477
|
+
result = runner.invoke(cli_main, ["push", module, "--dry-run"])
|
478
|
+
|
479
|
+
# THEN it should succeed with exit code 0
|
480
|
+
assert result.exit_code == 0
|
481
|
+
|
482
|
+
# AND we should have called the push API with the dry-run option
|
483
|
+
vellum_client.workflows.push.assert_called_once()
|
484
|
+
call_args = vellum_client.workflows.push.call_args.kwargs
|
485
|
+
assert call_args["dry_run"] is True
|
486
|
+
|
487
|
+
# AND the report should be in the output
|
488
|
+
assert "## Errors" in result.output
|
489
|
+
assert "No errors found." in result.output
|
490
|
+
assert "## Proposed Diffs" in result.output
|
491
|
+
|
492
|
+
|
462
493
|
def test_push__strict_option_returns_diffs(mock_module, vellum_client):
|
463
494
|
# GIVEN a single workflow configured
|
464
495
|
temp_dir = mock_module.temp_dir
|
@@ -8,11 +8,11 @@ _T = TypeVar("_T")
|
|
8
8
|
|
9
9
|
|
10
10
|
@overload
|
11
|
-
def raise_if_descriptor(
|
11
|
+
def raise_if_descriptor(node_attr: BaseDescriptor[_T]) -> _T: ...
|
12
12
|
|
13
13
|
|
14
14
|
@overload
|
15
|
-
def raise_if_descriptor(
|
15
|
+
def raise_if_descriptor(node_attr: _T) -> _T: ...
|
16
16
|
|
17
17
|
|
18
18
|
def raise_if_descriptor(node_attr: Union[NodeReference[_T], _T]) -> Optional[_T]:
|
@@ -2,6 +2,7 @@ from uuid import UUID
|
|
2
2
|
from typing import Callable, Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union
|
3
3
|
|
4
4
|
from vellum import FunctionDefinition, PromptBlock, RichTextChildBlock, VellumVariable
|
5
|
+
from vellum.workflows.descriptors.base import BaseDescriptor
|
5
6
|
from vellum.workflows.nodes import InlinePromptNode
|
6
7
|
from vellum.workflows.types.core import JsonObject
|
7
8
|
from vellum.workflows.utils.functions import compile_function_definition
|
@@ -18,9 +19,10 @@ _InlinePromptNodeType = TypeVar("_InlinePromptNodeType", bound=InlinePromptNode)
|
|
18
19
|
|
19
20
|
|
20
21
|
class BaseInlinePromptNodeDisplay(BaseNodeDisplay[_InlinePromptNodeType], Generic[_InlinePromptNodeType]):
|
21
|
-
__serializable_inputs__ = {
|
22
|
+
__serializable_inputs__ = {
|
23
|
+
InlinePromptNode.prompt_inputs,
|
24
|
+
}
|
22
25
|
__unserializable_attributes__ = {
|
23
|
-
InlinePromptNode.blocks,
|
24
26
|
InlinePromptNode.parameters,
|
25
27
|
InlinePromptNode.settings,
|
26
28
|
InlinePromptNode.expand_meta,
|
@@ -45,7 +47,9 @@ class BaseInlinePromptNodeDisplay(BaseNodeDisplay[_InlinePromptNodeType], Generi
|
|
45
47
|
ml_model = str(raise_if_descriptor(node.ml_model))
|
46
48
|
|
47
49
|
blocks: list = [
|
48
|
-
self._generate_prompt_block(block, input_variable_id_by_name, [i])
|
50
|
+
self._generate_prompt_block(block, input_variable_id_by_name, [i])
|
51
|
+
for i, block in enumerate(node_blocks)
|
52
|
+
if not isinstance(block, BaseDescriptor)
|
49
53
|
]
|
50
54
|
|
51
55
|
functions = (
|
@@ -7,6 +7,7 @@ from vellum import (
|
|
7
7
|
VellumValueLogicalConditionGroupRequest,
|
8
8
|
VellumValueLogicalConditionRequest,
|
9
9
|
)
|
10
|
+
from vellum.workflows.nodes.displayable.bases.types import MetadataLogicalCondition, MetadataLogicalConditionGroup
|
10
11
|
from vellum.workflows.nodes.displayable.search_node import SearchNode
|
11
12
|
from vellum.workflows.references import OutputReference
|
12
13
|
from vellum.workflows.types.core import JsonArray, JsonObject
|
@@ -88,7 +89,8 @@ class BaseSearchNodeDisplay(BaseNodeDisplay[_SearchNodeType], Generic[_SearchNod
|
|
88
89
|
node_inputs: Dict[str, NodeInput] = {}
|
89
90
|
|
90
91
|
options = raise_if_descriptor(node.options)
|
91
|
-
|
92
|
+
raw_filters = raise_if_descriptor(node.filters)
|
93
|
+
filters = raw_filters if raw_filters else options.filters if options else None
|
92
94
|
|
93
95
|
external_id_filters = filters.external_ids if filters else None
|
94
96
|
|
@@ -104,17 +106,21 @@ class BaseSearchNodeDisplay(BaseNodeDisplay[_SearchNodeType], Generic[_SearchNod
|
|
104
106
|
raw_metadata_filters, display_context=display_context
|
105
107
|
)
|
106
108
|
|
107
|
-
|
109
|
+
raw_result_merging = raise_if_descriptor(node.result_merging)
|
110
|
+
result_merging = raw_result_merging if raw_result_merging else options.result_merging if options else None
|
108
111
|
result_merging_enabled = True if result_merging and result_merging.enabled else False
|
109
112
|
|
110
113
|
raw_weights = raise_if_descriptor(node.weights)
|
111
114
|
weights = raw_weights if raw_weights is not None else options.weights if options is not None else None
|
112
115
|
|
116
|
+
raw_limit = raise_if_descriptor(node.limit)
|
117
|
+
limit = raw_limit if raw_limit is not None else options.limit if options is not None else None
|
118
|
+
|
113
119
|
node_input_names_and_values = [
|
114
120
|
("query", node.query),
|
115
121
|
("document_index_id", node.document_index),
|
116
122
|
("weights", weights.dict() if weights else None),
|
117
|
-
("limit",
|
123
|
+
("limit", limit),
|
118
124
|
("separator", raise_if_descriptor(node.chunk_separator)),
|
119
125
|
(
|
120
126
|
"result_merging_enabled",
|
@@ -141,7 +147,12 @@ class BaseSearchNodeDisplay(BaseNodeDisplay[_SearchNodeType], Generic[_SearchNod
|
|
141
147
|
|
142
148
|
def _serialize_logical_expression(
|
143
149
|
self,
|
144
|
-
logical_expression: Union[
|
150
|
+
logical_expression: Union[
|
151
|
+
VellumValueLogicalConditionGroupRequest,
|
152
|
+
VellumValueLogicalConditionRequest,
|
153
|
+
MetadataLogicalConditionGroup,
|
154
|
+
MetadataLogicalCondition,
|
155
|
+
],
|
145
156
|
display_context: WorkflowDisplayContext,
|
146
157
|
path: List[int] = [],
|
147
158
|
) -> Tuple[JsonObject, List[NodeInput]]:
|
@@ -175,10 +186,10 @@ class BaseSearchNodeDisplay(BaseNodeDisplay[_SearchNodeType], Generic[_SearchNod
|
|
175
186
|
|
176
187
|
lhs_query_input_id: UUID = self.metadata_filter_input_id_by_operand_id.get(
|
177
188
|
UUID(lhs_variable_id)
|
178
|
-
) or uuid4_from_hash(f"{self.node_id}|{hash(tuple(path))}")
|
189
|
+
) or uuid4_from_hash(f"{self.node_id}|lhs|{hash(tuple(path))}")
|
179
190
|
rhs_query_input_id: UUID = self.metadata_filter_input_id_by_operand_id.get(
|
180
191
|
UUID(rhs_variable_id)
|
181
|
-
) or uuid4_from_hash(f"{self.node_id}|{hash(tuple(path))}")
|
192
|
+
) or uuid4_from_hash(f"{self.node_id}|rhs|{hash(tuple(path))}")
|
182
193
|
|
183
194
|
return (
|
184
195
|
{
|
@@ -206,5 +217,57 @@ class BaseSearchNodeDisplay(BaseNodeDisplay[_SearchNodeType], Generic[_SearchNod
|
|
206
217
|
),
|
207
218
|
],
|
208
219
|
)
|
220
|
+
|
221
|
+
elif isinstance(logical_expression, MetadataLogicalConditionGroup):
|
222
|
+
conditions = []
|
223
|
+
variables = []
|
224
|
+
for idx, metadata_condition in enumerate(logical_expression.conditions):
|
225
|
+
serialized_condition, serialized_variables = self._serialize_logical_expression(
|
226
|
+
metadata_condition, display_context=display_context, path=path + [idx]
|
227
|
+
)
|
228
|
+
conditions.append(serialized_condition)
|
229
|
+
variables.extend(serialized_variables)
|
230
|
+
|
231
|
+
return (
|
232
|
+
{
|
233
|
+
"type": "LOGICAL_CONDITION_GROUP",
|
234
|
+
"combinator": logical_expression.combinator,
|
235
|
+
"conditions": conditions,
|
236
|
+
"negated": logical_expression.negated,
|
237
|
+
},
|
238
|
+
variables,
|
239
|
+
)
|
240
|
+
|
241
|
+
elif isinstance(logical_expression, MetadataLogicalCondition):
|
242
|
+
lhs_variable = logical_expression.lhs_variable
|
243
|
+
rhs_variable = logical_expression.rhs_variable
|
244
|
+
|
245
|
+
lhs_query_input_id = uuid4_from_hash(f"{self.node_id}|lhs|{hash(tuple(path))}")
|
246
|
+
rhs_query_input_id = uuid4_from_hash(f"{self.node_id}|rhs|{hash(tuple(path))}")
|
247
|
+
|
248
|
+
return (
|
249
|
+
{
|
250
|
+
"type": "LOGICAL_CONDITION",
|
251
|
+
"lhs_variable_id": str(lhs_query_input_id),
|
252
|
+
"operator": logical_expression.operator,
|
253
|
+
"rhs_variable_id": str(rhs_query_input_id),
|
254
|
+
},
|
255
|
+
[
|
256
|
+
create_node_input(
|
257
|
+
self.node_id,
|
258
|
+
f"vellum-query-builder-variable-{lhs_query_input_id}",
|
259
|
+
lhs_variable,
|
260
|
+
display_context,
|
261
|
+
input_id=lhs_query_input_id,
|
262
|
+
),
|
263
|
+
create_node_input(
|
264
|
+
self.node_id,
|
265
|
+
f"vellum-query-builder-variable-{rhs_query_input_id}",
|
266
|
+
rhs_variable,
|
267
|
+
display_context,
|
268
|
+
input_id=rhs_query_input_id,
|
269
|
+
),
|
270
|
+
],
|
271
|
+
)
|
209
272
|
else:
|
210
273
|
raise ValueError(f"Unsupported logical expression type: {type(logical_expression)}")
|
@@ -0,0 +1,104 @@
|
|
1
|
+
from vellum.workflows import BaseWorkflow
|
2
|
+
from vellum.workflows.inputs import BaseInputs
|
3
|
+
from vellum.workflows.nodes.displayable import SearchNode
|
4
|
+
from vellum.workflows.nodes.displayable.bases.types import (
|
5
|
+
MetadataLogicalCondition,
|
6
|
+
MetadataLogicalConditionGroup,
|
7
|
+
SearchFilters,
|
8
|
+
)
|
9
|
+
from vellum.workflows.state.base import BaseState
|
10
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
11
|
+
|
12
|
+
|
13
|
+
def test_search_filters_with_input_reference():
|
14
|
+
"""Test that SearchFilters with MetadataLogicalCondition using input references can be serialized"""
|
15
|
+
|
16
|
+
# GIVEN a search node with a metadata filter that uses an input reference
|
17
|
+
class TestInputs(BaseInputs):
|
18
|
+
file_id: str
|
19
|
+
|
20
|
+
class MySearchNode(SearchNode):
|
21
|
+
query = "my query"
|
22
|
+
document_index = "document_index"
|
23
|
+
filters = SearchFilters(
|
24
|
+
external_ids=None,
|
25
|
+
metadata=MetadataLogicalConditionGroup(
|
26
|
+
combinator="AND",
|
27
|
+
negated=False,
|
28
|
+
conditions=[MetadataLogicalCondition(lhs_variable="ID", operator="=", rhs_variable=TestInputs.file_id)],
|
29
|
+
),
|
30
|
+
)
|
31
|
+
|
32
|
+
# AND a workflow with the Search Node
|
33
|
+
class Workflow(BaseWorkflow[TestInputs, BaseState]):
|
34
|
+
graph = MySearchNode
|
35
|
+
|
36
|
+
# WHEN the workflow is serialized
|
37
|
+
workflow_display = get_workflow_display(workflow_class=Workflow)
|
38
|
+
serialized_workflow: dict = workflow_display.serialize()
|
39
|
+
|
40
|
+
# THEN the node should properly serialize the filter reference
|
41
|
+
serialized_search_node = next(
|
42
|
+
node for node in serialized_workflow["workflow_raw_data"]["nodes"] if node["id"] == str(MySearchNode.__id__)
|
43
|
+
)
|
44
|
+
|
45
|
+
serialized_metadata_filter = next(
|
46
|
+
inp for inp in serialized_search_node["inputs"] if inp["key"] == "metadata_filters"
|
47
|
+
)
|
48
|
+
|
49
|
+
assert serialized_metadata_filter == {
|
50
|
+
"id": "4a9f96aa-ba3b-4c4e-9ce4-370fe64f717f",
|
51
|
+
"key": "metadata_filters",
|
52
|
+
"value": {
|
53
|
+
"combinator": "OR",
|
54
|
+
"rules": [
|
55
|
+
{
|
56
|
+
"data": {
|
57
|
+
"type": "JSON",
|
58
|
+
"value": {
|
59
|
+
"combinator": "AND",
|
60
|
+
"conditions": [
|
61
|
+
{
|
62
|
+
"lhs_variable_id": "9aedaffa-c2a4-4c37-9969-184e1ff43ded",
|
63
|
+
"operator": "=",
|
64
|
+
"rhs_variable_id": "c2151ef1-ad98-4940-b0e9-28dabe47a951",
|
65
|
+
"type": "LOGICAL_CONDITION",
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"negated": False,
|
69
|
+
"type": "LOGICAL_CONDITION_GROUP",
|
70
|
+
},
|
71
|
+
},
|
72
|
+
"type": "CONSTANT_VALUE",
|
73
|
+
}
|
74
|
+
],
|
75
|
+
},
|
76
|
+
}
|
77
|
+
|
78
|
+
# AND the LHS filter references should be present as node inputs
|
79
|
+
serialized_lhs_input = next(
|
80
|
+
inp for inp in serialized_search_node["inputs"] if inp["id"] == "9aedaffa-c2a4-4c37-9969-184e1ff43ded"
|
81
|
+
)
|
82
|
+
assert serialized_lhs_input["value"] == {
|
83
|
+
"combinator": "OR",
|
84
|
+
"rules": [
|
85
|
+
{
|
86
|
+
"data": {"type": "STRING", "value": "ID"},
|
87
|
+
"type": "CONSTANT_VALUE",
|
88
|
+
}
|
89
|
+
],
|
90
|
+
}
|
91
|
+
|
92
|
+
# AND the RHS filter references should be present as node inputs
|
93
|
+
serialized_rhs_input = next(
|
94
|
+
inp for inp in serialized_search_node["inputs"] if inp["id"] == "c2151ef1-ad98-4940-b0e9-28dabe47a951"
|
95
|
+
)
|
96
|
+
assert serialized_rhs_input["value"] == {
|
97
|
+
"combinator": "OR",
|
98
|
+
"rules": [
|
99
|
+
{
|
100
|
+
"data": {"input_variable_id": "e2f4fff9-1277-47cb-8988-12f8ada450ba"},
|
101
|
+
"type": "INPUT_VARIABLE",
|
102
|
+
}
|
103
|
+
],
|
104
|
+
}
|