vellum-ai 1.7.10__py3-none-any.whl → 1.7.11__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.
Potentially problematic release.
This version of vellum-ai might be problematic. Click here for more details.
- vellum/client/core/client_wrapper.py +2 -2
- vellum/workflows/events/tests/test_event.py +1 -0
- vellum/workflows/events/workflow.py +3 -0
- vellum/workflows/exceptions.py +3 -0
- vellum/workflows/integrations/mcp_service.py +7 -0
- vellum/workflows/integrations/tests/test_mcp_service.py +48 -0
- vellum/workflows/loaders/__init__.py +3 -0
- vellum/workflows/loaders/base.py +21 -0
- vellum/workflows/tests/triggers/test_vellum_integration_trigger.py +225 -0
- vellum/workflows/triggers/__init__.py +2 -1
- vellum/workflows/triggers/vellum_integration.py +383 -0
- vellum/workflows/types/__init__.py +3 -0
- vellum/workflows/types/tests/test_utils.py +11 -0
- vellum/workflows/types/trigger_exec_config.py +63 -0
- vellum/workflows/types/utils.py +22 -0
- vellum/workflows/utils/names.py +20 -0
- vellum/workflows/workflows/base.py +13 -1
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/METADATA +1 -1
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/RECORD +31 -25
- vellum_cli/pull.py +6 -5
- vellum_cli/push.py +35 -2
- vellum_cli/tests/test_push.py +122 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_list_vellum_document_serialization.py +65 -0
- vellum_ee/workflows/display/utils/events.py +6 -3
- vellum_ee/workflows/display/utils/tests/test_events.py +29 -0
- vellum_ee/workflows/server/virtual_file_loader.py +15 -4
- vellum_ee/workflows/tests/test_serialize_module.py +48 -0
- vellum_ee/workflows/tests/test_server.py +105 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/LICENSE +0 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/WHEEL +0 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/entry_points.txt +0 -0
|
@@ -8,8 +8,8 @@ vellum_cli/init.py,sha256=WpnMXPItPmh0f0bBGIer3p-e5gu8DUGwSArT_FuoMEw,5093
|
|
|
8
8
|
vellum_cli/logger.py,sha256=dcM_OmgqXLo93vDYswO5ylyUQQcTfnA5GTd5tbIt3wM,1446
|
|
9
9
|
vellum_cli/move.py,sha256=lCHQ-U4BspgS512GxFFvUrglitaHkWfuKn1Hpfcn7-Q,2053
|
|
10
10
|
vellum_cli/ping.py,sha256=p_BCCRjgPhng6JktuECtkDQLbhopt6JpmrtGoLnLJT8,1161
|
|
11
|
-
vellum_cli/pull.py,sha256=
|
|
12
|
-
vellum_cli/push.py,sha256=
|
|
11
|
+
vellum_cli/pull.py,sha256=j7ob2s_IO3iMN7y5diI6XjobL8Z4y7l8Vl9dDQlk0vw,14740
|
|
12
|
+
vellum_cli/push.py,sha256=OvrOduwFd0Ez6ifSbPiBdID75SeGBb9gm9siMGCyFlE,13117
|
|
13
13
|
vellum_cli/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
vellum_cli/tests/conftest.py,sha256=wx3PlJjVB0HRf5dr2b_idOIw27WPPl0J0FNbhIJJaVk,1689
|
|
15
15
|
vellum_cli/tests/test_config.py,sha256=uvKGDc8BoVyT9_H0Z-g8469zVxomn6Oi3Zj-vK7O_wU,2631
|
|
@@ -20,7 +20,7 @@ vellum_cli/tests/test_main.py,sha256=qDZG-aQauPwBwM6A2DIu1494n47v3pL28XakTbLGZ-k
|
|
|
20
20
|
vellum_cli/tests/test_move.py,sha256=FIrL1xlH5oFKGX2MugcTKL8JilpopmUC7hP5OaqF5zw,5213
|
|
21
21
|
vellum_cli/tests/test_ping.py,sha256=b3aQLd-N59_8w2rRiWqwpB1rlHaKEYVbAj1Y3hi7A-g,2605
|
|
22
22
|
vellum_cli/tests/test_pull.py,sha256=e2XHzcHIx9k-FyuNAl7wMSNsSSebPGyP6U05JGcddFs,49447
|
|
23
|
-
vellum_cli/tests/test_push.py,sha256
|
|
23
|
+
vellum_cli/tests/test_push.py,sha256=-W8BNA-pdeFM6J0z319LioAkhna6Z0BTYt6BrmL1VGI,49049
|
|
24
24
|
vellum_ee/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
vellum_ee/assets/node-definitions.json,sha256=FHw1RlnD7n8nHBSN9hMsrjBGq9SnM2wga7URiSCDGBY,31408
|
|
26
26
|
vellum_ee/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -110,6 +110,7 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling
|
|
|
110
110
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=pLCyMScV88DTBXRH7jXaXOEA1GBq8NIipCUFwIAWnwI,2771
|
|
111
111
|
vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=exT7U-axwtYgFylagScflSQLJEND51qIAx2UATju6JM,6023
|
|
112
112
|
vellum_ee/workflows/display/tests/workflow_serialization/test_final_output_node_map_reference_serialization.py,sha256=vl3pxUJlrYRA8zzFJ-gRm7fe-5fviLNSIsUC7imnMqk,3502
|
|
113
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_list_vellum_document_serialization.py,sha256=ZRcDhOSVKFHvt_rBkNSL7j3VLeWKQbH-KRoJWrtWD2s,2193
|
|
113
114
|
vellum_ee/workflows/display/tests/workflow_serialization/test_manual_trigger_serialization.py,sha256=L4bJWW94eq5cl6pjIaX7pQrDHoF67Gudfx-41dmmd10,2330
|
|
114
115
|
vellum_ee/workflows/display/tests/workflow_serialization/test_slack_trigger_serialization.py,sha256=HCZKF2_wOrn05s94PKWBP8cLl6Uw8j3y7Ec83xxQfLM,2258
|
|
115
116
|
vellum_ee/workflows/display/tests/workflow_serialization/test_terminal_node_any_serialization.py,sha256=4WAmSEJZlDBLPhsD1f4GwY9ahB9F6qJKGnL6j7ZYlzQ,1740
|
|
@@ -118,13 +119,13 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_workflow_input_par
|
|
|
118
119
|
vellum_ee/workflows/display/types.py,sha256=LgRIZeEtV7bQe-nvrC4A0T6vMooSWT1rFtw-uTn45BQ,3752
|
|
119
120
|
vellum_ee/workflows/display/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
121
|
vellum_ee/workflows/display/utils/auto_layout.py,sha256=f4GiLn_LazweupfqTpubcdtdfE_vrOcmZudSsnYIY9E,3906
|
|
121
|
-
vellum_ee/workflows/display/utils/events.py,sha256=
|
|
122
|
+
vellum_ee/workflows/display/utils/events.py,sha256=WeytIG9znXDrEjOJ-Ls4BAimfV1stnxGWpoycv9UTmg,2031
|
|
122
123
|
vellum_ee/workflows/display/utils/exceptions.py,sha256=E8Lvo7LY1BoZ54M_NR_opDjJsAAiCUfow1HgoHcTHmg,989
|
|
123
124
|
vellum_ee/workflows/display/utils/expressions.py,sha256=9rcpoXhUIxcWy407Ziu-zJfP5OEFq3pHIh7XSZZ1Y6E,21169
|
|
124
125
|
vellum_ee/workflows/display/utils/registry.py,sha256=1qXiBTdsnro6FeCX0FGBEK7CIf6wa--Jt50iZ_nEp_M,3460
|
|
125
126
|
vellum_ee/workflows/display/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
127
|
vellum_ee/workflows/display/utils/tests/test_auto_layout.py,sha256=vfXI769418s9vda5Gb5NFBH747WMOwSgHRXeLCTLVm8,2356
|
|
127
|
-
vellum_ee/workflows/display/utils/tests/test_events.py,sha256=
|
|
128
|
+
vellum_ee/workflows/display/utils/tests/test_events.py,sha256=gjC_p3UuAbRANLbQboRh4J8SL1wgMOB0AOqtpXmIj4w,5581
|
|
128
129
|
vellum_ee/workflows/display/utils/vellum.py,sha256=Bt7kdLdXoBsHn5dVEY2uKcF542VL09jwu8J_30rl2vk,6413
|
|
129
130
|
vellum_ee/workflows/display/vellum.py,sha256=J2mdJZ1sdLW535DDUkq_Vm8Z572vhuxHxVZF9deKSdk,391
|
|
130
131
|
vellum_ee/workflows/display/workflows/__init__.py,sha256=JTB9ObEV3l4gGGdtfBHwVJtTTKC22uj-a-XjTVwXCyA,148
|
|
@@ -132,7 +133,7 @@ vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=rY-mK4dLou
|
|
|
132
133
|
vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=gxz76AeCqgAZ9D2lZeTiZzxY9eMgn3qOSfVgiqYcOh8,2028
|
|
133
134
|
vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=lg-c_3P3ldtqWq2VFsk_2Mkn3pVdXWuT59QpH7QwXVs,39764
|
|
134
135
|
vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
135
|
-
vellum_ee/workflows/server/virtual_file_loader.py,sha256=
|
|
136
|
+
vellum_ee/workflows/server/virtual_file_loader.py,sha256=3egb-Xsfxy6I_AGVH09Fgd74qofDMKtiVzJitW8sRHw,3265
|
|
136
137
|
vellum_ee/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
137
138
|
vellum_ee/workflows/tests/local_files/__init__.py,sha256=UyP6kKkRqr9cTKHQF4MVLdLk5MM9GGcLuqxXsQGm22Y,51
|
|
138
139
|
vellum_ee/workflows/tests/local_files/base_class.py,sha256=UuiC7J68MVr6A4949QYiBpXOLdsvFG_Cw1muEPiHT6I,298
|
|
@@ -154,15 +155,15 @@ vellum_ee/workflows/tests/local_workflow/nodes/templating_node.py,sha256=NQwFN61
|
|
|
154
155
|
vellum_ee/workflows/tests/local_workflow/workflow.py,sha256=A4qOzOPNwePYxWbcAgIPLsmrVS_aVEZEc-wULSv787Q,393
|
|
155
156
|
vellum_ee/workflows/tests/test_display_meta.py,sha256=PkXJVnMZs9GNooDkd59n4YTBAX3XGPQWeSSVbhehVFM,5112
|
|
156
157
|
vellum_ee/workflows/tests/test_registry.py,sha256=B8xRIuEyLWfSqrYoPldNQXhKPfe50PllvtAZoI8-uPs,6066
|
|
157
|
-
vellum_ee/workflows/tests/test_serialize_module.py,sha256=
|
|
158
|
-
vellum_ee/workflows/tests/test_server.py,sha256=
|
|
158
|
+
vellum_ee/workflows/tests/test_serialize_module.py,sha256=thzGsNzYCRXXdaC5yk1ZjtXrIO6uPdSnzdapKLCOsC8,6241
|
|
159
|
+
vellum_ee/workflows/tests/test_server.py,sha256=2_n84q_QZN_zW2rZgDenQUXM3x43TcPsRs1fDA6BK1U,29805
|
|
159
160
|
vellum_ee/workflows/tests/test_virtual_files.py,sha256=TJEcMR0v2S8CkloXNmCHA0QW0K6pYNGaIjraJz7sFvY,2762
|
|
160
161
|
vellum/__init__.py,sha256=6dkyRHmIKuQPzL_z3QLVUrbkAF-HJKDhDSMCnf4ZsKw,49502
|
|
161
162
|
vellum/client/README.md,sha256=flqu57ubZNTfpq60CdLtJC9gp4WEkyjb_n_eZ4OYf9w,6497
|
|
162
163
|
vellum/client/__init__.py,sha256=rMnKRqL5-356SBc-rfm56MkO87PuAi2mtcfBszcJU1M,74316
|
|
163
164
|
vellum/client/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
|
|
164
165
|
vellum/client/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
165
|
-
vellum/client/core/client_wrapper.py,sha256=
|
|
166
|
+
vellum/client/core/client_wrapper.py,sha256=KKrmb0ch50fjF5NTYG5BivGPOkXNmN6adUXv_VzzS9s,2842
|
|
166
167
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
167
168
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
168
169
|
vellum/client/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
|
|
@@ -1818,10 +1819,10 @@ vellum/workflows/events/relational_threads.py,sha256=zmLrBCBYpdpQV0snKH3HleST-_h
|
|
|
1818
1819
|
vellum/workflows/events/stream.py,sha256=xhXJTZirFi0xad5neAQNogrIQ4h47fpnKbVC3vCM5Js,889
|
|
1819
1820
|
vellum/workflows/events/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1820
1821
|
vellum/workflows/events/tests/test_basic_workflow.py,sha256=Pj6orHsXz37jWC5FARi0Sx2Gjf99Owri2Cvr6Chb79k,1765
|
|
1821
|
-
vellum/workflows/events/tests/test_event.py,sha256=
|
|
1822
|
+
vellum/workflows/events/tests/test_event.py,sha256=R9H_W9RuZAY1b_ElnfyekS-Fl6Z02lldOf8EkCJssBE,21476
|
|
1822
1823
|
vellum/workflows/events/types.py,sha256=mVrqAH9Hs9SpXm08Hcxdyap_ImQPwGsxRr56rSNMP34,5043
|
|
1823
|
-
vellum/workflows/events/workflow.py,sha256=
|
|
1824
|
-
vellum/workflows/exceptions.py,sha256=
|
|
1824
|
+
vellum/workflows/events/workflow.py,sha256=zsyCbcM93P9XqRvYoN8e7vIsOe15Bn2sjXuDoSRrwBU,9637
|
|
1825
|
+
vellum/workflows/exceptions.py,sha256=l_ZklQQVvbsIdbmbn89aEeTL7x6x08m5kCwKXXPnTDc,2277
|
|
1825
1826
|
vellum/workflows/executable.py,sha256=um-gLJMVYfGJwGJfZIPlCRHhHIYm6pn8PUEfeqrNx5k,218
|
|
1826
1827
|
vellum/workflows/expressions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1827
1828
|
vellum/workflows/expressions/accessor.py,sha256=3lu1-_-dBfZdJvtX-q66jbmRAZtqIfdsh_3_JNuzg1E,4462
|
|
@@ -1878,11 +1879,13 @@ vellum/workflows/inputs/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
1878
1879
|
vellum/workflows/inputs/tests/test_inputs.py,sha256=E6I2pEfGjCeQg0GAsjvKFEjO32bQ3H9VeRnLv3ry9O0,2828
|
|
1879
1880
|
vellum/workflows/integrations/__init__.py,sha256=KoA7tGX_UiImu6erJKJ5tmLFpNFEqblsWFGPoWNsS1U,220
|
|
1880
1881
|
vellum/workflows/integrations/composio_service.py,sha256=rSliaZtNiBcDSvDxz9k5i1KkyUIrbxyegu0yU9cDByU,6023
|
|
1881
|
-
vellum/workflows/integrations/mcp_service.py,sha256=
|
|
1882
|
+
vellum/workflows/integrations/mcp_service.py,sha256=m2oakuI2jVh9LY34lQvWnULnjjRkwOYmdvKDX4HIEpg,10218
|
|
1882
1883
|
vellum/workflows/integrations/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1883
|
-
vellum/workflows/integrations/tests/test_mcp_service.py,sha256=
|
|
1884
|
+
vellum/workflows/integrations/tests/test_mcp_service.py,sha256=6R5ghZitzYXyHHjmX6oWdce4YNyCSworrktjg9mSLGE,10830
|
|
1884
1885
|
vellum/workflows/integrations/tests/test_vellum_integration_service.py,sha256=QGJmaW5EF7E2fkZotd4rc2HItQc-1z3cpgwaKUFWpgg,11956
|
|
1885
1886
|
vellum/workflows/integrations/vellum_integration_service.py,sha256=qhFoLzHlMli1PC8oh5phvWuSpJ9IqL1g2eaGhypBTqs,5266
|
|
1887
|
+
vellum/workflows/loaders/__init__.py,sha256=qdghamOwKDs8XR5cGTIMn3Bd99pSNAr5DCdXf0bPQk0,95
|
|
1888
|
+
vellum/workflows/loaders/base.py,sha256=ZTnf_1pxSf6i3chiLasMEbACULuuc2EBVyFcOF3OLuM,533
|
|
1886
1889
|
vellum/workflows/logging.py,sha256=_a217XogktV4Ncz6xKFz7WfYmZAzkfVRVuC0rWob8ls,437
|
|
1887
1890
|
vellum/workflows/nodes/__init__.py,sha256=zymtc3_iW2rFmMR-sayTLuN6ZsAw8VnJweWPsjQk2-Q,1197
|
|
1888
1891
|
vellum/workflows/nodes/bases/__init__.py,sha256=cniHuz_RXdJ4TQgD8CBzoiKDiPxg62ErdVpCbWICX64,58
|
|
@@ -2041,7 +2044,8 @@ vellum/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
2041
2044
|
vellum/workflows/tests/test_dataset_row.py,sha256=S8aIiYU9TRzJ8GTl5qCjnJ-fuHdxatHJFGLlKTVHPr4,4174
|
|
2042
2045
|
vellum/workflows/tests/test_sandbox.py,sha256=JKwaluI-lODQo7Ek9sjDstjL_WTdSqUlVik6ZVTfVOA,1826
|
|
2043
2046
|
vellum/workflows/tests/test_undefined.py,sha256=zMCVliCXVNLrlC6hEGyOWDnQADJ2g83yc5FIM33zuo8,353
|
|
2044
|
-
vellum/workflows/triggers/
|
|
2047
|
+
vellum/workflows/tests/triggers/test_vellum_integration_trigger.py,sha256=L1eUKbxgRI09G1tZ2ziVeLsp_CXS_CT5a1Fk6A3YAEQ,8017
|
|
2048
|
+
vellum/workflows/triggers/__init__.py,sha256=_T7PTZpwv9aFitmpGu2Tu_kJpLAwPnNhfh0XGlHBAgw,432
|
|
2045
2049
|
vellum/workflows/triggers/base.py,sha256=sLH0qzfRYbJRQX6ukGzSy6PaXxlDUSobdFSz8G_4v98,10140
|
|
2046
2050
|
vellum/workflows/triggers/integration.py,sha256=hAWQMoIubosKgM56rrsAJVhPnc4MjA5YBPRpDgl6J08,2221
|
|
2047
2051
|
vellum/workflows/triggers/manual.py,sha256=PgbZ92gcK25yz6REXm98zWic1QBfhxLKfGCeHpZEUx4,1266
|
|
@@ -2049,7 +2053,8 @@ vellum/workflows/triggers/slack.py,sha256=NBc4Af3PdnhiqTzeS-zyPf7JkrPG0FHT7uP0qN
|
|
|
2049
2053
|
vellum/workflows/triggers/tests/__init__.py,sha256=R8lag_iCRyulijHMK4e3Gf6YVB5NplfvwZeTkaRj8gQ,30
|
|
2050
2054
|
vellum/workflows/triggers/tests/test_integration.py,sha256=mODupO0eOG4G2ooDH1meWKRtA8NRtsm_fii6tijvSqQ,4046
|
|
2051
2055
|
vellum/workflows/triggers/tests/test_slack.py,sha256=aFTVPj7e3bjblHgbZleKEoh0wayrcC_88nDpXmVowMY,5569
|
|
2052
|
-
vellum/workflows/
|
|
2056
|
+
vellum/workflows/triggers/vellum_integration.py,sha256=03YWZ3UpcZSLzenvuJZqOPYvjaEbcDU9HbYGbTbY_QQ,16866
|
|
2057
|
+
vellum/workflows/types/__init__.py,sha256=P3KhHAeoAj8cQti89o3nyPgCfC4BjK1LOFv58A76ktM,290
|
|
2053
2058
|
vellum/workflows/types/code_execution_node_wrappers.py,sha256=fewX9bqF_4TZuK-gZYIn12s31-k03vHMGRpvFAPm11Y,3206
|
|
2054
2059
|
vellum/workflows/types/core.py,sha256=R7snCd7ci4tiRuHi5ALGh_5DIIF0T9eze3sf6EnJN-c,1126
|
|
2055
2060
|
vellum/workflows/types/definition.py,sha256=Qof2MAjSNB0AN2XkSKmk-owuY59YcxDVHYpno6-StPA,8058
|
|
@@ -2057,12 +2062,13 @@ vellum/workflows/types/generics.py,sha256=8jptbEx1fnJV0Lhj0MpCJOT6yNiEWeTOYOwrEA
|
|
|
2057
2062
|
vellum/workflows/types/stack.py,sha256=h7NE0vXR7l9DevFBIzIAk1Zh59K-kECQtDTKOUunwMY,1314
|
|
2058
2063
|
vellum/workflows/types/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2059
2064
|
vellum/workflows/types/tests/test_definition.py,sha256=QUI9_Wsm2k-ZxQTXogsB0L4csSvVFOvLXHb-asC6K2w,7193
|
|
2060
|
-
vellum/workflows/types/tests/test_utils.py,sha256
|
|
2061
|
-
vellum/workflows/types/
|
|
2065
|
+
vellum/workflows/types/tests/test_utils.py,sha256=-kMF1mxYlW4Njh8fKjbo45Wc-jOJ7GBYKKjIviuzd4I,2837
|
|
2066
|
+
vellum/workflows/types/trigger_exec_config.py,sha256=3KOKAMMz0JylrQpDqo2I4yX081XcWQQXkgwfCoIak0o,2813
|
|
2067
|
+
vellum/workflows/types/utils.py,sha256=pCC3HlnLaT4HcCKA_JSoWLnDB1czB3HwjirTiP9RDQs,7680
|
|
2062
2068
|
vellum/workflows/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2063
2069
|
vellum/workflows/utils/functions.py,sha256=uIg8As0c1BGwXmwectbAQWLWWIWoeHCduGhhoOqQVVU,13157
|
|
2064
2070
|
vellum/workflows/utils/hmac.py,sha256=JJCczc6pyV6DuE1Oa0QVfYPUN_of3zEYmGFib3OZnrE,1135
|
|
2065
|
-
vellum/workflows/utils/names.py,sha256=
|
|
2071
|
+
vellum/workflows/utils/names.py,sha256=kuuDKMILbYrgqmgfTGtkD7VZ6foWwJUfJJjyTxJ3LkI,1221
|
|
2066
2072
|
vellum/workflows/utils/pydantic_schema.py,sha256=eR_bBtY-T0pttJP-ARwagSdCOnwPUtiT3cegm2lzDTQ,1310
|
|
2067
2073
|
vellum/workflows/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2068
2074
|
vellum/workflows/utils/tests/test_functions.py,sha256=J_WEyVX1yE3lUhoX8etgkbPuwQOWHf-tpIQbKYcLKho,25360
|
|
@@ -2074,13 +2080,13 @@ vellum/workflows/utils/vellum_variables.py,sha256=X3lZn-EoWengRWBWRhTNW7hqbj7LkV
|
|
|
2074
2080
|
vellum/workflows/utils/zip.py,sha256=HVg_YZLmBOTXKaDV3Xhaf3V6sYnfqqZXQ8CpuafkbPY,1181
|
|
2075
2081
|
vellum/workflows/vellum_client.py,sha256=3iDR7VV_NgLSm1iZQCKDvrmfEaX1bOJiU15QrxyHpv0,1237
|
|
2076
2082
|
vellum/workflows/workflows/__init__.py,sha256=KY45TqvavCCvXIkyCFMEc0dc6jTMOUci93U2DUrlZYc,66
|
|
2077
|
-
vellum/workflows/workflows/base.py,sha256=
|
|
2083
|
+
vellum/workflows/workflows/base.py,sha256=m9yaLhUPUBdAPR912Rf8lrU5fA8_JwFTM-zDDC46w6g,31620
|
|
2078
2084
|
vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnadGsrSZGa7t7LpJA,2008
|
|
2079
2085
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2080
2086
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=Boa-_m9ii2Qsa1RvVM-VYniF7zCpzGgEGy-OnPZkrHg,23941
|
|
2081
2087
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
|
2082
|
-
vellum_ai-1.7.
|
|
2083
|
-
vellum_ai-1.7.
|
|
2084
|
-
vellum_ai-1.7.
|
|
2085
|
-
vellum_ai-1.7.
|
|
2086
|
-
vellum_ai-1.7.
|
|
2088
|
+
vellum_ai-1.7.11.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
|
2089
|
+
vellum_ai-1.7.11.dist-info/METADATA,sha256=p2zWh-k4nsa4OIxTQD0lXIlEvmphl3BdF0EMszAVpV0,5548
|
|
2090
|
+
vellum_ai-1.7.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
2091
|
+
vellum_ai-1.7.11.dist-info/entry_points.txt,sha256=xVavzAKN4iF_NbmhWOlOkHluka0YLkbN_pFQ9pW3gLI,117
|
|
2092
|
+
vellum_ai-1.7.11.dist-info/RECORD,,
|
vellum_cli/pull.py
CHANGED
|
@@ -7,11 +7,11 @@ import zipfile
|
|
|
7
7
|
from typing import Optional
|
|
8
8
|
|
|
9
9
|
from dotenv import load_dotenv
|
|
10
|
-
from pydash import snake_case
|
|
11
10
|
|
|
12
11
|
from vellum.client.core.api_error import ApiError
|
|
13
12
|
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
|
14
13
|
from vellum.utils.uuid import is_valid_uuid
|
|
14
|
+
from vellum.workflows.utils.names import create_module_name
|
|
15
15
|
from vellum.workflows.vellum_client import create_vellum_client
|
|
16
16
|
from vellum_cli.config import (
|
|
17
17
|
DEFAULT_WORKSPACE_CONFIG,
|
|
@@ -257,10 +257,11 @@ def pull_command(
|
|
|
257
257
|
workflow_config.container_image_tag = "latest"
|
|
258
258
|
if not workflow_config.workflow_sandbox_id and pull_contents_metadata.workflow_sandbox_id:
|
|
259
259
|
workflow_config.workflow_sandbox_id = str(pull_contents_metadata.workflow_sandbox_id)
|
|
260
|
-
if not workflow_config.module
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
if not workflow_config.module:
|
|
261
|
+
deployment_name = pull_contents_metadata.deployment_name if workflow_deployment else None
|
|
262
|
+
workflow_config.module = create_module_name(
|
|
263
|
+
deployment_name=deployment_name, label=pull_contents_metadata.label
|
|
264
|
+
)
|
|
264
265
|
|
|
265
266
|
# Save or update the deployment info when pulling with --workflow-deployment
|
|
266
267
|
if workflow_deployment:
|
vellum_cli/push.py
CHANGED
|
@@ -77,7 +77,20 @@ def push_command(
|
|
|
77
77
|
|
|
78
78
|
logger.info(f"Loading workflow from {workflow_config.module}")
|
|
79
79
|
resolved_workspace = workspace or workflow_config.workspace or DEFAULT_WORKSPACE_CONFIG.name
|
|
80
|
-
workspace_config = next((w for w in config.workspaces if w.name == resolved_workspace),
|
|
80
|
+
workspace_config = next((w for w in config.workspaces if w.name == resolved_workspace), None)
|
|
81
|
+
|
|
82
|
+
if workspace_config is None:
|
|
83
|
+
if resolved_workspace == DEFAULT_WORKSPACE_CONFIG.name:
|
|
84
|
+
workspace_config = DEFAULT_WORKSPACE_CONFIG
|
|
85
|
+
else:
|
|
86
|
+
available_workspaces = sorted(set([w.name for w in config.workspaces] + [DEFAULT_WORKSPACE_CONFIG.name]))
|
|
87
|
+
handle_cli_error(
|
|
88
|
+
logger,
|
|
89
|
+
title=f"Workspace '{resolved_workspace}' not found in config",
|
|
90
|
+
message=f"Available workspaces: {', '.join(available_workspaces)}",
|
|
91
|
+
)
|
|
92
|
+
return
|
|
93
|
+
|
|
81
94
|
api_key = os.getenv(workspace_config.api_key)
|
|
82
95
|
if not api_key:
|
|
83
96
|
raise ValueError(f"No API key value found in environment for workspace '{workspace_config.name}'.")
|
|
@@ -181,12 +194,14 @@ def push_command(
|
|
|
181
194
|
artifact.seek(0)
|
|
182
195
|
artifact.name = f"{workflow_config.module.replace('.', '__')}.tar.gz"
|
|
183
196
|
|
|
197
|
+
provided_id = workflow_config.workflow_sandbox_id or workflow_sandbox_id
|
|
198
|
+
|
|
184
199
|
try:
|
|
185
200
|
response = client.workflows.push(
|
|
186
201
|
# Remove this once we could serialize using the artifact in Vembda
|
|
187
202
|
# https://app.shortcut.com/vellum/story/5585
|
|
188
203
|
exec_config=json.dumps(exec_config),
|
|
189
|
-
workflow_sandbox_id=
|
|
204
|
+
workflow_sandbox_id=provided_id,
|
|
190
205
|
artifact=artifact,
|
|
191
206
|
# We should check with fern if we could auto-serialize typed object fields for us
|
|
192
207
|
# https://app.shortcut.com/vellum/story/5568
|
|
@@ -195,6 +210,24 @@ def push_command(
|
|
|
195
210
|
strict=strict,
|
|
196
211
|
)
|
|
197
212
|
except ApiError as e:
|
|
213
|
+
if e.status_code == 404:
|
|
214
|
+
if provided_id:
|
|
215
|
+
handle_cli_error(
|
|
216
|
+
logger,
|
|
217
|
+
title="Workflow Sandbox not found",
|
|
218
|
+
message=f"Could not find Workflow Sandbox with ID '{provided_id}' "
|
|
219
|
+
f"in workspace '{resolved_workspace}'.",
|
|
220
|
+
)
|
|
221
|
+
else:
|
|
222
|
+
error_detail = e.body.get("detail") if isinstance(e.body, dict) else None
|
|
223
|
+
default_message = "The `/workflows/push` endpoint failed with a 404 response."
|
|
224
|
+
handle_cli_error(
|
|
225
|
+
logger,
|
|
226
|
+
title="Workflow Sandbox not found",
|
|
227
|
+
message=error_detail or default_message,
|
|
228
|
+
)
|
|
229
|
+
return
|
|
230
|
+
|
|
198
231
|
if e.status_code == 400 and isinstance(e.body, dict) and "diffs" in e.body:
|
|
199
232
|
diffs: dict = e.body["diffs"]
|
|
200
233
|
generated_only = diffs.get("generated_only", [])
|
vellum_cli/tests/test_push.py
CHANGED
|
@@ -592,6 +592,84 @@ def test_push__push_fails_due_to_400_error(mock_module, vellum_client):
|
|
|
592
592
|
assert "Traceback" not in result.output
|
|
593
593
|
|
|
594
594
|
|
|
595
|
+
def test_push__push_fails_due_to_404_error_with_id(mock_module, vellum_client):
|
|
596
|
+
"""
|
|
597
|
+
Tests that a 404 error with a workflow sandbox ID shows a helpful error message.
|
|
598
|
+
"""
|
|
599
|
+
|
|
600
|
+
# GIVEN a single workflow configured with a workflow_sandbox_id
|
|
601
|
+
temp_dir = mock_module.temp_dir
|
|
602
|
+
module = mock_module.module
|
|
603
|
+
|
|
604
|
+
# AND a workflow exists in the module successfully
|
|
605
|
+
_ensure_workflow_py(temp_dir, module)
|
|
606
|
+
|
|
607
|
+
# AND the push API call returns a 404 response
|
|
608
|
+
vellum_client.workflows.push.side_effect = ApiError(
|
|
609
|
+
status_code=404,
|
|
610
|
+
body={},
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
# WHEN calling `vellum push`
|
|
614
|
+
runner = CliRunner()
|
|
615
|
+
result = runner.invoke(cli_main, ["push", module])
|
|
616
|
+
|
|
617
|
+
# THEN it should fail with a user error code
|
|
618
|
+
assert result.exit_code == 1
|
|
619
|
+
|
|
620
|
+
# AND the error message should be in the error message
|
|
621
|
+
assert "Workflow Sandbox not found" in result.output
|
|
622
|
+
assert mock_module.workflow_sandbox_id in result.output
|
|
623
|
+
assert "workspace" in result.output
|
|
624
|
+
|
|
625
|
+
# AND the stack trace should not be present
|
|
626
|
+
assert "Traceback" not in result.output
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
def test_push__push_fails_due_to_404_error_without_id(tmp_path, vellum_client, monkeypatch):
|
|
630
|
+
"""
|
|
631
|
+
Tests that a 404 error without a workflow sandbox ID shows a helpful error message.
|
|
632
|
+
"""
|
|
633
|
+
|
|
634
|
+
# GIVEN a workflow module exists but has no workflow_sandbox_id configured
|
|
635
|
+
module = "examples.mock.test_push__404_without_id"
|
|
636
|
+
module_dir = tmp_path / "examples" / "mock" / "test_push__404_without_id"
|
|
637
|
+
module_dir.mkdir(parents=True)
|
|
638
|
+
|
|
639
|
+
# AND a workflow.py file exists
|
|
640
|
+
workflow_file = module_dir / "workflow.py"
|
|
641
|
+
workflow_file.write_text(
|
|
642
|
+
"from vellum.workflows import BaseWorkflow\n\nclass ExampleWorkflow(BaseWorkflow):\n pass\n"
|
|
643
|
+
)
|
|
644
|
+
|
|
645
|
+
# AND the pyproject.toml file exists without workflow_sandbox_id
|
|
646
|
+
pyproject_file = tmp_path / "pyproject.toml"
|
|
647
|
+
pyproject_file.write_text(f'[tool.vellum]\n[[tool.vellum.workflows]]\nmodule = "{module}"\n')
|
|
648
|
+
|
|
649
|
+
monkeypatch.chdir(tmp_path)
|
|
650
|
+
|
|
651
|
+
# AND the push API call returns a 404 response
|
|
652
|
+
vellum_client.workflows.push.side_effect = ApiError(
|
|
653
|
+
status_code=404,
|
|
654
|
+
body={},
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
# WHEN calling `vellum push`
|
|
658
|
+
runner = CliRunner()
|
|
659
|
+
result = runner.invoke(cli_main, ["push", module])
|
|
660
|
+
|
|
661
|
+
# THEN it should fail with a user error code
|
|
662
|
+
assert result.exit_code == 1
|
|
663
|
+
|
|
664
|
+
# AND the error message should be in the output
|
|
665
|
+
assert "Workflow Sandbox not found" in result.output
|
|
666
|
+
assert "/workflows/push" in result.output
|
|
667
|
+
assert "404 response" in result.output
|
|
668
|
+
|
|
669
|
+
# AND the stack trace should not be present
|
|
670
|
+
assert "Traceback" not in result.output
|
|
671
|
+
|
|
672
|
+
|
|
595
673
|
@pytest.mark.parametrize(
|
|
596
674
|
"file_data",
|
|
597
675
|
[
|
|
@@ -1220,3 +1298,47 @@ MY_CUSTOM_VELLUM_API_KEY=custom-key-xyz
|
|
|
1220
1298
|
assert len(lock_file_content["workflows"]) == 1
|
|
1221
1299
|
assert lock_file_content["workflows"][0]["workspace"] == "my_custom_workspace"
|
|
1222
1300
|
assert lock_file_content["workflows"][0]["workflow_sandbox_id"] == workflow_sandbox_id
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
def test_push__workspace_option__nonexistent_workspace_should_fail(mock_module):
|
|
1304
|
+
"""
|
|
1305
|
+
Tests that pushing with a nonexistent workspace that isn't default should fail.
|
|
1306
|
+
"""
|
|
1307
|
+
|
|
1308
|
+
# GIVEN a single workflow configured
|
|
1309
|
+
temp_dir = mock_module.temp_dir
|
|
1310
|
+
module = mock_module.module
|
|
1311
|
+
set_pyproject_toml = mock_module.set_pyproject_toml
|
|
1312
|
+
|
|
1313
|
+
# AND a custom workspace is configured
|
|
1314
|
+
set_pyproject_toml(
|
|
1315
|
+
{
|
|
1316
|
+
"workflows": [
|
|
1317
|
+
{
|
|
1318
|
+
"module": module,
|
|
1319
|
+
}
|
|
1320
|
+
],
|
|
1321
|
+
"workspaces": [
|
|
1322
|
+
{
|
|
1323
|
+
"name": "my_custom_workspace",
|
|
1324
|
+
"api_key": "MY_CUSTOM_VELLUM_API_KEY",
|
|
1325
|
+
}
|
|
1326
|
+
],
|
|
1327
|
+
}
|
|
1328
|
+
)
|
|
1329
|
+
|
|
1330
|
+
# AND a workflow exists in the module successfully
|
|
1331
|
+
_ensure_workflow_py(temp_dir, module)
|
|
1332
|
+
|
|
1333
|
+
# WHEN calling `vellum push` with a nonexistent workspace
|
|
1334
|
+
runner = CliRunner()
|
|
1335
|
+
result = runner.invoke(cli_main, ["push", module, "--workspace", "nonexistent_workspace"])
|
|
1336
|
+
|
|
1337
|
+
# THEN it should exit with an error
|
|
1338
|
+
assert result.exit_code == 1
|
|
1339
|
+
|
|
1340
|
+
# AND the error message should indicate the workspace doesn't exist
|
|
1341
|
+
assert "Workspace 'nonexistent_workspace' not found in config" in result.output
|
|
1342
|
+
assert "Available workspaces:" in result.output
|
|
1343
|
+
assert "default" in result.output
|
|
1344
|
+
assert "my_custom_workspace" in result.output
|
vellum_ee/workflows/display/tests/workflow_serialization/test_list_vellum_document_serialization.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from vellum import VellumDocument
|
|
4
|
+
from vellum.workflows import BaseWorkflow
|
|
5
|
+
from vellum.workflows.inputs import BaseInputs
|
|
6
|
+
from vellum.workflows.nodes.displayable import FinalOutputNode
|
|
7
|
+
from vellum.workflows.outputs import BaseOutputs
|
|
8
|
+
from vellum.workflows.state import BaseState
|
|
9
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Inputs(BaseInputs):
|
|
13
|
+
documents: List[VellumDocument]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MyFinalOutputNode(FinalOutputNode):
|
|
17
|
+
class Outputs(BaseOutputs):
|
|
18
|
+
value = Inputs.documents
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class WorkflowWithListVellumDocument(BaseWorkflow[Inputs, BaseState]):
|
|
22
|
+
"""A workflow that takes a list of VellumDocument as input."""
|
|
23
|
+
|
|
24
|
+
graph = MyFinalOutputNode
|
|
25
|
+
|
|
26
|
+
class Outputs(BaseOutputs):
|
|
27
|
+
result = MyFinalOutputNode.Outputs.value
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_serialize_workflow_with_list_vellum_document():
|
|
31
|
+
"""Tests that we can serialize a workflow with List[VellumDocument] input."""
|
|
32
|
+
|
|
33
|
+
workflow_display = get_workflow_display(workflow_class=WorkflowWithListVellumDocument)
|
|
34
|
+
|
|
35
|
+
# WHEN we serialize it
|
|
36
|
+
serialized_workflow: dict = workflow_display.serialize()
|
|
37
|
+
|
|
38
|
+
# THEN we should get a serialized representation of the Workflow
|
|
39
|
+
assert serialized_workflow.keys() == {
|
|
40
|
+
"workflow_raw_data",
|
|
41
|
+
"input_variables",
|
|
42
|
+
"state_variables",
|
|
43
|
+
"output_variables",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
input_variables = serialized_workflow["input_variables"]
|
|
47
|
+
assert len(input_variables) == 1
|
|
48
|
+
|
|
49
|
+
input_var = input_variables[0]
|
|
50
|
+
assert input_var["key"] == "documents"
|
|
51
|
+
assert input_var["type"] == "JSON"
|
|
52
|
+
# NOTE: Once custom type serialization is supported, we will want to represent this using an openapi spec
|
|
53
|
+
assert input_var["required"] is True
|
|
54
|
+
assert input_var["default"] is None
|
|
55
|
+
assert input_var["extensions"] == {"color": None}
|
|
56
|
+
|
|
57
|
+
output_variables = serialized_workflow["output_variables"]
|
|
58
|
+
assert len(output_variables) == 1
|
|
59
|
+
|
|
60
|
+
output_var = output_variables[0]
|
|
61
|
+
assert output_var["key"] == "result"
|
|
62
|
+
|
|
63
|
+
workflow_raw_data = serialized_workflow["workflow_raw_data"]
|
|
64
|
+
assert len(workflow_raw_data["nodes"]) == 2
|
|
65
|
+
assert len(workflow_raw_data["edges"]) == 1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
3
|
from vellum import Vellum
|
|
4
|
-
from vellum.workflows.events.workflow import WorkflowExecutionInitiatedEvent
|
|
4
|
+
from vellum.workflows.events.workflow import WorkflowEvent, WorkflowExecutionInitiatedEvent
|
|
5
5
|
from vellum_ee.workflows.display.utils.registry import (
|
|
6
6
|
get_parent_display_context_from_event,
|
|
7
7
|
register_workflow_display_class,
|
|
@@ -29,8 +29,8 @@ def _should_mark_workflow_dynamic(event: WorkflowExecutionInitiatedEvent) -> boo
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
def event_enricher(
|
|
32
|
-
event:
|
|
33
|
-
) ->
|
|
32
|
+
event: WorkflowEvent, client: Optional[Vellum] = None, metadata: Optional[dict] = None
|
|
33
|
+
) -> WorkflowEvent:
|
|
34
34
|
if event.name != "workflow.execution.initiated":
|
|
35
35
|
return event
|
|
36
36
|
|
|
@@ -49,4 +49,7 @@ def event_enricher(
|
|
|
49
49
|
workflow_version_exec_config = workflow_display.serialize()
|
|
50
50
|
setattr(event.body, "workflow_version_exec_config", workflow_version_exec_config)
|
|
51
51
|
|
|
52
|
+
if metadata is not None:
|
|
53
|
+
event.body.server_metadata = metadata
|
|
54
|
+
|
|
52
55
|
return event
|
|
@@ -112,6 +112,7 @@ def test_event_enricher_marks_subworkflow_deployment_as_dynamic(vellum_client):
|
|
|
112
112
|
|
|
113
113
|
enriched_event = event_enricher(event, vellum_client)
|
|
114
114
|
|
|
115
|
+
assert enriched_event.name == "workflow.execution.initiated"
|
|
115
116
|
assert hasattr(enriched_event.body, "workflow_version_exec_config")
|
|
116
117
|
assert enriched_event.body.workflow_version_exec_config is not None
|
|
117
118
|
|
|
@@ -119,3 +120,31 @@ def test_event_enricher_marks_subworkflow_deployment_as_dynamic(vellum_client):
|
|
|
119
120
|
assert hasattr(enriched_event.body.display_context, "node_displays")
|
|
120
121
|
assert hasattr(enriched_event.body.display_context, "workflow_inputs")
|
|
121
122
|
assert hasattr(enriched_event.body.display_context, "workflow_outputs")
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def test_event_enricher_with_metadata(vellum_client):
|
|
126
|
+
"""Test that event_enricher attaches metadata to server_metadata field."""
|
|
127
|
+
|
|
128
|
+
# GIVEN a workflow class
|
|
129
|
+
class TestWorkflow(BaseWorkflow):
|
|
130
|
+
is_dynamic = False
|
|
131
|
+
|
|
132
|
+
# AND an event
|
|
133
|
+
event: WorkflowExecutionInitiatedEvent = WorkflowExecutionInitiatedEvent(
|
|
134
|
+
trace_id=uuid4(),
|
|
135
|
+
span_id=uuid4(),
|
|
136
|
+
body=WorkflowExecutionInitiatedBody(
|
|
137
|
+
workflow_definition=TestWorkflow,
|
|
138
|
+
inputs=BaseInputs(),
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# AND some metadata
|
|
143
|
+
metadata = {"custom_key": "custom_value", "another_key": 123}
|
|
144
|
+
|
|
145
|
+
# WHEN the event_enricher is called with metadata
|
|
146
|
+
enriched_event = event_enricher(event, vellum_client, metadata=metadata)
|
|
147
|
+
|
|
148
|
+
# THEN the metadata should be attached to server_metadata
|
|
149
|
+
assert enriched_event.name == "workflow.execution.initiated"
|
|
150
|
+
assert enriched_event.body.server_metadata == metadata
|
|
@@ -4,11 +4,14 @@ import re
|
|
|
4
4
|
import sys
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
|
+
from vellum.workflows.loaders.base import BaseWorkflowFinder
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
class VirtualFileLoader(importlib.abc.Loader):
|
|
9
|
-
def __init__(self, files: dict[str, str], namespace: str):
|
|
11
|
+
def __init__(self, files: dict[str, str], namespace: str, source_module: Optional[str] = None):
|
|
10
12
|
self.files = files
|
|
11
13
|
self.namespace = namespace
|
|
14
|
+
self.source_module = source_module
|
|
12
15
|
|
|
13
16
|
def create_module(self, spec: ModuleSpec):
|
|
14
17
|
"""
|
|
@@ -65,9 +68,17 @@ class VirtualFileLoader(importlib.abc.Loader):
|
|
|
65
68
|
return self.files.get(file_key_name)
|
|
66
69
|
|
|
67
70
|
|
|
68
|
-
class VirtualFileFinder(
|
|
69
|
-
def __init__(self, files: dict[str, str], namespace: str):
|
|
70
|
-
self.loader = VirtualFileLoader(files, namespace)
|
|
71
|
+
class VirtualFileFinder(BaseWorkflowFinder):
|
|
72
|
+
def __init__(self, files: dict[str, str], namespace: str, source_module: Optional[str] = None):
|
|
73
|
+
self.loader = VirtualFileLoader(files, namespace, source_module)
|
|
74
|
+
self.source_module = source_module
|
|
75
|
+
self.namespace = namespace
|
|
76
|
+
|
|
77
|
+
def format_error_message(self, error_message: str) -> str:
|
|
78
|
+
"""Format error message by replacing namespace with source_module."""
|
|
79
|
+
if self.source_module and self.namespace in error_message:
|
|
80
|
+
return error_message.replace(self.namespace, self.source_module)
|
|
81
|
+
return error_message
|
|
71
82
|
|
|
72
83
|
def find_spec(self, fullname: str, path, target=None):
|
|
73
84
|
module_info = self.loader._resolve_module(fullname)
|
|
@@ -96,6 +96,54 @@ def test_serialize_module_includes_additional_files():
|
|
|
96
96
|
assert "CONSTANT_VALUE" in additional_files["utils/constants.py"]
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
def test_serialize_module_with_pydantic_array():
|
|
100
|
+
"""
|
|
101
|
+
Test that serialize_module correctly serializes arrays of Pydantic models in workflow inputs.
|
|
102
|
+
|
|
103
|
+
This test verifies that when a workflow has inputs containing a List[PydanticModel],
|
|
104
|
+
the serialization properly converts the Pydantic models to JSON format.
|
|
105
|
+
"""
|
|
106
|
+
module_path = "tests.workflows.pydantic_array_serialization"
|
|
107
|
+
|
|
108
|
+
# WHEN we serialize it
|
|
109
|
+
result = BaseWorkflowDisplay.serialize_module(module_path)
|
|
110
|
+
|
|
111
|
+
assert hasattr(result, "exec_config")
|
|
112
|
+
assert hasattr(result, "errors")
|
|
113
|
+
assert isinstance(result.exec_config, dict)
|
|
114
|
+
assert isinstance(result.errors, list)
|
|
115
|
+
|
|
116
|
+
input_variables = result.exec_config["input_variables"]
|
|
117
|
+
assert len(input_variables) == 1
|
|
118
|
+
|
|
119
|
+
items_input = input_variables[0]
|
|
120
|
+
assert items_input["key"] == "items"
|
|
121
|
+
assert items_input["type"] == "JSON"
|
|
122
|
+
# TODO: In the future, this should be a custom type based on an OpenAPI schema (important-comment)
|
|
123
|
+
|
|
124
|
+
assert result.dataset is not None
|
|
125
|
+
assert isinstance(result.dataset, list)
|
|
126
|
+
assert len(result.dataset) == 2
|
|
127
|
+
|
|
128
|
+
first_scenario = result.dataset[0]
|
|
129
|
+
assert first_scenario["label"] == "Scenario 1"
|
|
130
|
+
assert "items" in first_scenario["inputs"]
|
|
131
|
+
items = first_scenario["inputs"]["items"]
|
|
132
|
+
assert isinstance(items, list)
|
|
133
|
+
assert len(items) == 3
|
|
134
|
+
assert items[0]["name"] == "item1"
|
|
135
|
+
assert items[0]["value"] == 10
|
|
136
|
+
assert items[0]["is_active"] is True
|
|
137
|
+
|
|
138
|
+
second_scenario = result.dataset[1]
|
|
139
|
+
assert second_scenario["label"] == "Custom Test"
|
|
140
|
+
assert "items" in second_scenario["inputs"]
|
|
141
|
+
test_items = second_scenario["inputs"]["items"]
|
|
142
|
+
assert len(test_items) == 2
|
|
143
|
+
assert test_items[0]["name"] == "test1"
|
|
144
|
+
assert test_items[0]["value"] == 100
|
|
145
|
+
|
|
146
|
+
|
|
99
147
|
def test_serialize_module__with_invalid_nested_set_graph(temp_module_path):
|
|
100
148
|
"""
|
|
101
149
|
Tests that serialize_module raises a clear user-facing exception for workflows with nested sets in graph attribute.
|