vellum-ai 0.14.49__py3-none-any.whl → 0.14.51__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.
Files changed (35) hide show
  1. vellum/__init__.py +6 -2
  2. vellum/client/core/client_wrapper.py +1 -1
  3. vellum/client/types/__init__.py +6 -2
  4. vellum/client/types/deployment_read.py +1 -1
  5. vellum/client/types/slim_workflow_execution_read.py +2 -2
  6. vellum/client/types/workflow_event_execution_read.py +2 -2
  7. vellum/client/types/{workflow_execution_usage_calculation_fulfilled_body.py → workflow_execution_usage_calculation_error.py} +5 -6
  8. vellum/client/types/workflow_execution_usage_calculation_error_code_enum.py +7 -0
  9. vellum/client/types/workflow_execution_usage_result.py +24 -0
  10. vellum/types/{workflow_execution_usage_calculation_fulfilled_body.py → workflow_execution_usage_calculation_error.py} +1 -1
  11. vellum/types/workflow_execution_usage_calculation_error_code_enum.py +3 -0
  12. vellum/types/workflow_execution_usage_result.py +3 -0
  13. vellum/workflows/nodes/core/map_node/node.py +74 -87
  14. vellum/workflows/nodes/core/map_node/tests/test_node.py +49 -0
  15. vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +1 -2
  16. vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py +3 -3
  17. vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py +1 -1
  18. vellum/workflows/nodes/experimental/__init__.py +3 -0
  19. vellum/workflows/nodes/experimental/tool_calling_node/tests/test_tool_calling_node.py +53 -0
  20. vellum/workflows/nodes/experimental/tool_calling_node/utils.py +12 -5
  21. vellum/workflows/state/encoder.py +4 -0
  22. vellum/workflows/workflows/base.py +8 -0
  23. {vellum_ai-0.14.49.dist-info → vellum_ai-0.14.51.dist-info}/METADATA +1 -1
  24. {vellum_ai-0.14.49.dist-info → vellum_ai-0.14.51.dist-info}/RECORD +35 -29
  25. vellum_ee/workflows/display/nodes/base_node_display.py +31 -2
  26. vellum_ee/workflows/display/nodes/get_node_display_class.py +1 -24
  27. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +29 -12
  28. vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py +33 -1
  29. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py +177 -0
  30. vellum_ee/workflows/display/utils/expressions.py +1 -1
  31. vellum_ee/workflows/display/workflows/base_workflow_display.py +3 -24
  32. vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +3 -3
  33. {vellum_ai-0.14.49.dist-info → vellum_ai-0.14.51.dist-info}/LICENSE +0 -0
  34. {vellum_ai-0.14.49.dist-info → vellum_ai-0.14.51.dist-info}/WHEEL +0 -0
  35. {vellum_ai-0.14.49.dist-info → vellum_ai-0.14.51.dist-info}/entry_points.txt +0 -0
@@ -26,8 +26,8 @@ vellum_ee/workflows/display/base.py,sha256=EqlQFD56kpqMY02ZBJBQajzJKh33Dwi60Wo77
26
26
  vellum_ee/workflows/display/editor/__init__.py,sha256=MSAgY91xCEg2neH5d8jXx5wRdR962ftZVa6vO9BGq9k,167
27
27
  vellum_ee/workflows/display/editor/types.py,sha256=x-tOOCJ6CF4HmiKDfCmcc3bOVfc1EBlP5o6u5WEfLoY,567
28
28
  vellum_ee/workflows/display/nodes/__init__.py,sha256=jI1aPBQf8DkmrYoZ4O-wR1duqZByOf5mDFmo_wFJPE4,307
29
- vellum_ee/workflows/display/nodes/base_node_display.py,sha256=1VoNyAw9MzgGePI2wrOShsNccrbS4bTuu3bnTii0Wu4,15480
30
- vellum_ee/workflows/display/nodes/get_node_display_class.py,sha256=gKAZfc7JBLzcwYPchnpHy2nMVMPmltAszOwLyXDrro0,2085
29
+ vellum_ee/workflows/display/nodes/base_node_display.py,sha256=2VyAk9SjBpt_b2fp81KlFxS5ddk2JhcldEI1S4crPj0,16921
30
+ vellum_ee/workflows/display/nodes/get_node_display_class.py,sha256=jI_kUi9LnNLDpY63QtlC4TfN8P571VN4LpzH0I1ZtLk,1149
31
31
  vellum_ee/workflows/display/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  vellum_ee/workflows/display/nodes/tests/test_base_node_display.py,sha256=Z4Mf7xLCNiblSbpKI0BrV5modQr-ZcFzhfir_OSyTTs,2997
33
33
  vellum_ee/workflows/display/nodes/types.py,sha256=St1BB6no528OyELGiyRabWao0GGw6mLhstQAvEACbGk,247
@@ -40,7 +40,7 @@ vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=MrvyiYD0qgQf
40
40
  vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=m2DmOXm9-jiiIl6zwkXHNfsYp5PTpBHEdt5xaIsabWo,2363
41
41
  vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=jUDI2FwVaw0Or4zJL58J_g0S--i59Hzik60s_Es_M-8,3098
42
42
  vellum_ee/workflows/display/nodes/vellum/guardrail_node.py,sha256=5_5D5PMzBOeUdVtRlANbfEsu7Gv3r37dLvpfjGAqYac,2330
43
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=gVwQwycEPNtCs8tWbFyIMLpCA7zXnqcmuuhFqRWNxZM,10368
43
+ vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=-6Ru9W_vfNdLKLStB40qicMx6WvdejPM3PE54Onqk5w,10943
44
44
  vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py,sha256=fQV5o83BPTwGX6o-ThN4r7BcIhySyqwpW1JGYWpvSJI,5625
45
45
  vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=CiklGf5_tDbqE1XQm2mnbtoL01_2JYjcnB4FDTpMImQ,3824
46
46
  vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=yBWeN4T_lOsDVnNOKWRiT7JYKu0IR5Fx2z99iq6QKSA,3273
@@ -55,7 +55,7 @@ vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py,sha25
55
55
  vellum_ee/workflows/display/nodes/vellum/tests/test_error_node.py,sha256=540FoWMpJ3EN_DPjHsr9ODJWCRVcUa5hZBn-5T2GiHU,1665
56
56
  vellum_ee/workflows/display/nodes/vellum/tests/test_note_node.py,sha256=uiMB0cOxKZzos7YKnj4ef4DFa2bOvZJWIv-hfbUV6Go,1218
57
57
  vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py,sha256=G-qJyTNJkpqJiEZ3kCJl86CXJINLeFyf2lM0bQHCCOs,3822
58
- vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=RPpromm0y9y-MukL8cmxpl9hYaw-JuNo8vFDOcLI4V4,8801
58
+ vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=9bNpdCBUSLTUmCh04Z-kgXxJ5dKWFJ53V6xrQMEVxyU,9942
59
59
  vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py,sha256=h93ysolmbo2viisyhRnXKHPxiDK0I_dSAbYoHFYIoO4,1953
60
60
  vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py,sha256=BUzHJgjdWnPeZxjFjHfDBKnbFjYjnbXPjc-1hne1B2Y,3965
61
61
  vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py,sha256=LSk2gx9TpGXbAqKe8dggQW8yJZqj-Cf0EGJFeGGlEcw,3321
@@ -89,19 +89,20 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_
89
89
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py,sha256=KkYZc_bZuq1lmDcvUz3QxIqJLpQPCZioD1FHUNsMJY8,11211
90
90
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py,sha256=aZaqRDrkO3ytcmdM2eKJqHSt60MF070NMj6M2vgzOKc,7711
91
91
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py,sha256=r748dpS13HtwY7t_KQFExFssxRy0xI2d-wxmhiUHRe0,3850
92
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=rp9suYcwVZPpIQ3ChlWWvahMlaUd7u-31VmesR0Mn8w,7683
92
93
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=EL5kfakuoEcwD85dGjhMta-J-PpCHRSDoc80SdbBrQk,2769
93
94
  vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=RmFUDx8dYdfsOE2CGLvdXqNNRtLLpVzXDN8dqZyMcZ8,5822
94
95
  vellum_ee/workflows/display/types.py,sha256=i4T7ElU5b5h-nA1i3scmEhO1BqmNDc4eJDHavATD88w,2821
95
96
  vellum_ee/workflows/display/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
97
  vellum_ee/workflows/display/utils/exceptions.py,sha256=LSwwxCYNxFkf5XMUcFkaZKpQ13OSrI7y_bpEUwbKVk0,169
97
- vellum_ee/workflows/display/utils/expressions.py,sha256=gbc_UDogJEI1juSNPfR3a-OXu2sIH7w3vLLw4YjOqDc,12416
98
+ vellum_ee/workflows/display/utils/expressions.py,sha256=qsKRgxm9zKFgAgjc9LqKEWP1rtdzXA1NDsXu9kyhf60,12416
98
99
  vellum_ee/workflows/display/utils/registry.py,sha256=fWIm5Jj-10gNFjgn34iBu4RWv3Vd15ijtSN0V97bpW8,1513
99
100
  vellum_ee/workflows/display/utils/vellum.py,sha256=mtoXmSYwR7rvrq-d6CzCW_auaJXTct0Mi1F0xpRCiNQ,5627
100
101
  vellum_ee/workflows/display/vellum.py,sha256=o7mq_vk2Yapu9DDKRz5l76h8EmCAypWGQYe6pryrbB8,3576
101
102
  vellum_ee/workflows/display/workflows/__init__.py,sha256=kapXsC67VJcgSuiBMa86FdePG5A9kMB5Pi4Uy1O2ob4,207
102
- vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=NuWlnGNe3Htcfh-l_8e37uitdUsy6WZNB7W7dYcCoUg,33355
103
+ vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=DbjLChDtlNAs86sWL5-ojYYzwFsOjACAGfquxM3VYcw,32563
103
104
  vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=gxz76AeCqgAZ9D2lZeTiZzxY9eMgn3qOSfVgiqYcOh8,2028
104
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=gTKddCTGzjWHJ8v4E0XqCLgxKuSXaFveoN2IT1LxrPw,29472
105
+ vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=rRwXLgsXqiaSn3jzP7lc--pytRW3Jmnj2-zNq5l-FQ4,29472
105
106
  vellum_ee/workflows/display/workflows/vellum_workflow_display.py,sha256=aaKdmWrgEe5YyV4zuDY_4E3y-l59rIHQnNGiPj2OWxQ,359
106
107
  vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
108
  vellum_ee/workflows/server/virtual_file_loader.py,sha256=7JphJcSO3H85qiC2DpFfBWjC3JjrbRmoynBC6KKHVsA,2710
@@ -127,12 +128,12 @@ vellum_ee/workflows/tests/local_workflow/workflow.py,sha256=A4qOzOPNwePYxWbcAgIP
127
128
  vellum_ee/workflows/tests/test_display_meta.py,sha256=C25dErwghPNXio49pvSRxyOuc96srH6eYEwTAWdE2zY,2258
128
129
  vellum_ee/workflows/tests/test_server.py,sha256=SsOkS6sGO7uGC4mxvk4iv8AtcXs058P9hgFHzTWmpII,14519
129
130
  vellum_ee/workflows/tests/test_virtual_files.py,sha256=TJEcMR0v2S8CkloXNmCHA0QW0K6pYNGaIjraJz7sFvY,2762
130
- vellum/__init__.py,sha256=4UwLVTlKBQ0cTIJ3NTqxw51aEFNUPfmJ-rVYP1yVUU0,41758
131
+ vellum/__init__.py,sha256=Hqfl49WZJzzqOKzVsTGi-j9twIqFOoRmACJsrEsjL44,41918
131
132
  vellum/client/README.md,sha256=qmaVIP42MnxAu8jV7u-CsgVFfs3-pHQODrXdZdFxtaw,4749
132
133
  vellum/client/__init__.py,sha256=PEnFl7LbXQcvAi3bVN2qyt5xm2FtVtq7xWKkcWM3Tg4,120166
133
134
  vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
134
135
  vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
135
- vellum/client/core/client_wrapper.py,sha256=fgLMgzbjkk4zz3CHZ_Wdqz6Sz1JL4L0v7uiNheKIcZA,1869
136
+ vellum/client/core/client_wrapper.py,sha256=0O1XpnpyuPVD86JFBVwkbpWYMkAmrvehoYpQg2THQRM,1869
136
137
  vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
137
138
  vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
138
139
  vellum/client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -200,7 +201,7 @@ vellum/client/resources/workspace_secrets/__init__.py,sha256=FTtvy8EDg9nNNg9WCat
200
201
  vellum/client/resources/workspace_secrets/client.py,sha256=zlBdbeTP6sqvtyl_DlrpfG-W5hSP7tJ1NYLSygi4CLU,8205
201
202
  vellum/client/resources/workspaces/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
202
203
  vellum/client/resources/workspaces/client.py,sha256=RthwzN1o-Jxwg5yyNNodavFyNUSxfLoTv26w3mRR5g8,3595
203
- vellum/client/types/__init__.py,sha256=DODWRvaxjqdVCvpr4b6kxku_2WZKSvl7lEl6tSr_gXU,63222
204
+ vellum/client/types/__init__.py,sha256=wFQ3c_Pu8mGQFHIUy5dORq6Afmp5jdl9pnfUizIXjtI,63474
204
205
  vellum/client/types/ad_hoc_execute_prompt_event.py,sha256=bCjujA2XsOgyF3bRZbcEqV2rOIymRgsLoIRtZpB14xg,607
205
206
  vellum/client/types/ad_hoc_expand_meta.py,sha256=1gv-NCsy_6xBYupLvZH979yf2VMdxAU-l0y0ynMKZaw,1331
206
207
  vellum/client/types/ad_hoc_fulfilled_prompt_execution_meta.py,sha256=oDG60TpwK1YNSKhRsBbiP2O3ZF9PKR-M9chGIfKw4R4,1004
@@ -271,7 +272,7 @@ vellum/client/types/create_test_suite_test_case_request.py,sha256=3LmAy6U8tUJ75d
271
272
  vellum/client/types/deployment_history_item.py,sha256=-u7UYEFpVOlFijErPLGO99WYQxAnctZK52W-GM4KJJU,1132
272
273
  vellum/client/types/deployment_provider_payload_response.py,sha256=b0lkt0rK88ARQaMWn9MAHeWtMBsZKofDMlOAUsQvv7g,818
273
274
  vellum/client/types/deployment_provider_payload_response_payload.py,sha256=xHLQnWFN0AZRZdrOiKawwpoKK7BTmnZfp0P7FCc2ZqE,188
274
- vellum/client/types/deployment_read.py,sha256=TYhgfS9rU_pyLfdSq7Ek-6WAMLEiryGJkB6Z-sZaj7A,1975
275
+ vellum/client/types/deployment_read.py,sha256=l6cy00p4y7JncJ-BwVl_NdCVWPNRjZqFz6DdL2vTTqY,1977
275
276
  vellum/client/types/deployment_release_tag_deployment_history_item.py,sha256=df4qKHT1f-z0jnRS4UmP8MQe6u3PwYej_d8KDF7EL88,631
276
277
  vellum/client/types/deployment_release_tag_read.py,sha256=dUrTOz9LH1gAvC_ktMB_7NztkeBnlNSX_9x15Ld3D3I,1278
277
278
  vellum/client/types/docker_service_token.py,sha256=T0icNHBKsIs6TrEiDRjckM_f37hcF1DMwEE8161tTvY,614
@@ -565,7 +566,7 @@ vellum/client/types/slim_document.py,sha256=HJiymYPvRxfxhBUkD8epW0hQ2Vt9PQtv398Q
565
566
  vellum/client/types/slim_document_document_to_document_index.py,sha256=vo7WbRRzbApQxT0MZu_NkjQmsFD8LoezmyeKBeGZpI8,1346
566
567
  vellum/client/types/slim_release_review.py,sha256=7DXmD1AVa_Wj7e0qiR7GUN9cSqwkk1JloYmp_3oluQQ,783
567
568
  vellum/client/types/slim_workflow_deployment.py,sha256=Js-ycMFZ8-kNFPsd4bZew9nI_eN2M_58LzDHeCjkfTg,2009
568
- vellum/client/types/slim_workflow_execution_read.py,sha256=yZvOqC9z9qa3jlnRgrSlSybwPeY-cX-xuTmZXkPVops,1968
569
+ vellum/client/types/slim_workflow_execution_read.py,sha256=Opm1HTYVMz_D2USQCB-5ZoJ4EjKKfrDhoXc0hETldVM,1936
569
570
  vellum/client/types/span_link.py,sha256=2NISI8V94W0MeIdos7aSKFmpVJgEEunuSEnKlWTUH5c,1353
570
571
  vellum/client/types/span_link_type_enum.py,sha256=NaBXnHnOKMZvgHfjhwJJNqM4wuTOxtGkMIXjN2hU-6A,130
571
572
  vellum/client/types/streaming_ad_hoc_execute_prompt_event.py,sha256=NdgmJ3AZMp6io-whZIGnGb49aiqz6__KafsrzjEF_9o,1183
@@ -717,7 +718,7 @@ vellum/client/types/workflow_deployment_release_workflow_deployment.py,sha256=ir
717
718
  vellum/client/types/workflow_deployment_release_workflow_version.py,sha256=V1Eb3goBX2lle851LkhR1tbCFa0z_O-yhMuQWCN6c-g,773
718
719
  vellum/client/types/workflow_error.py,sha256=EQajkEmLS64T0wYm0goHQl0rT7Lguurk8pLwkhjsgAI,282
719
720
  vellum/client/types/workflow_event_error.py,sha256=HIewu_kh3KNPpWegAQArvAGHCp-cBIXqlUAAc_dBZhc,687
720
- vellum/client/types/workflow_event_execution_read.py,sha256=S3o33XQYfo4JPmkXUJ-ZxCqvLfcemFeWrmOc4SGzV74,2040
721
+ vellum/client/types/workflow_event_execution_read.py,sha256=TQaBs2ZkOOJOjCkdmgI9ZX7c4XgIaNIBozCmZlOoZp8,2008
721
722
  vellum/client/types/workflow_execution_actual.py,sha256=YL5WL4O4CyaZWSrxqpE4chJ28EJlyScj5JeaLttegEg,843
722
723
  vellum/client/types/workflow_execution_actual_chat_history_request.py,sha256=L6U8tgM7SiU4qGJMZChFzj6HfHgO-YAlTXfbT7ZIaE4,1993
723
724
  vellum/client/types/workflow_execution_actual_json_request.py,sha256=5QYaPCSOwFnjH_kTrB2bTznTMFExSZdBhTkmelf1h4Q,1931
@@ -741,7 +742,9 @@ vellum/client/types/workflow_execution_span.py,sha256=3vHEx3k31fLacQaV2iMT-vibjw
741
742
  vellum/client/types/workflow_execution_span_attributes.py,sha256=SRW7mD-6uS8eA57EU6q2thBqSFfJSH4tXI9H3szZwYQ,575
742
743
  vellum/client/types/workflow_execution_streaming_body.py,sha256=phni9pJKkFGsQ5IcS4ogtG1EjBzpdBiYpN9CPbkjxH8,746
743
744
  vellum/client/types/workflow_execution_streaming_event.py,sha256=_xazehYJ5ZwTDc5cC7rpX7nDir_4glPOnx9c9ZPod1g,1551
744
- vellum/client/types/workflow_execution_usage_calculation_fulfilled_body.py,sha256=TyEIbdTWfvRjS3TGx44Mwttc274gRzLB9YjvkE0BmTw,729
745
+ vellum/client/types/workflow_execution_usage_calculation_error.py,sha256=O44pAaA3pOpn6dqxfsAFx4QnXeVfIggGWbgmTzQV4Ms,754
746
+ vellum/client/types/workflow_execution_usage_calculation_error_code_enum.py,sha256=O8CGCaWKuhnRjmQXTsw4gQn5hfDFiKED8bJYzP8R0LM,258
747
+ vellum/client/types/workflow_execution_usage_result.py,sha256=wZdRqzG_Lwi8gqDHGEU6ayx3pvO9oe8hIPzDDePELz8,928
745
748
  vellum/client/types/workflow_execution_view_online_eval_metric_result.py,sha256=1qxIHqBRhEMfbOhBpztOPhcH3mqe7bfezO7PUHUfDg4,759
746
749
  vellum/client/types/workflow_execution_workflow_result_event.py,sha256=gjyXmojwtAOtAzpILpFkJB9tM02okSXqYRw9-3rTVDA,939
747
750
  vellum/client/types/workflow_expand_meta_request.py,sha256=-6I1Zveo3wFJEWbmSsN9OiOI7ekCJxF4xEL_ApB6XE8,1151
@@ -1415,7 +1418,9 @@ vellum/types/workflow_execution_span.py,sha256=qnyiKgPrKKl0lvVtmpm09zOMTWKDBZ9nD
1415
1418
  vellum/types/workflow_execution_span_attributes.py,sha256=LCyfr-e1lwrTpMge9agbjtVDxt1l1FTZK8koMqxy6VM,172
1416
1419
  vellum/types/workflow_execution_streaming_body.py,sha256=MjkV8RLMtFj1r0yGPIuhf4Dz_EFeVU2tN8Oz6-cPssQ,171
1417
1420
  vellum/types/workflow_execution_streaming_event.py,sha256=XDEyaGRMfR9cpaRJ-WCb0O-o4LAdoMPCbjRLdYI1r-0,172
1418
- vellum/types/workflow_execution_usage_calculation_fulfilled_body.py,sha256=Vabch9oglYZehKyAvOuAKhbASKAoLWqK0dg7pqaa3s4,189
1421
+ vellum/types/workflow_execution_usage_calculation_error.py,sha256=tMF1PYRRKjC0N-GL_Az2A8Mv-1H8tS3oln_NPh6k3zo,180
1422
+ vellum/types/workflow_execution_usage_calculation_error_code_enum.py,sha256=HMqRue9gC5NRgbqt_FhANKGeNz8Vgu9fjZpEvRTek9o,190
1423
+ vellum/types/workflow_execution_usage_result.py,sha256=SrVrcv5xngwbS-6eCWU4XJ9QyyUwGJ1mPfgHPOhNqbs,169
1419
1424
  vellum/types/workflow_execution_view_online_eval_metric_result.py,sha256=dLnk3CfQOAeYIO5kiR0U8SY4JcqFWvVYwkDL-LkA5Co,187
1420
1425
  vellum/types/workflow_execution_workflow_result_event.py,sha256=3bNxtChEfqny5eEazFcGmqQpmC8283Q0J2hxLje-uks,178
1421
1426
  vellum/types/workflow_expand_meta_request.py,sha256=Ahb7gjZekJ5qI0HGHLCbn3hCpkX08EnzeXEH_3ivB4E,166
@@ -1551,9 +1556,9 @@ vellum/workflows/nodes/core/inline_subworkflow_node/node.py,sha256=rgcjc3gaCEX9u
1551
1556
  vellum/workflows/nodes/core/inline_subworkflow_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1552
1557
  vellum/workflows/nodes/core/inline_subworkflow_node/tests/test_node.py,sha256=kUqwcRMMxjTHALbwGUXCJT_aJBrHS1bkg49oL8R0JO8,4337
1553
1558
  vellum/workflows/nodes/core/map_node/__init__.py,sha256=MXpZYmGfhsMJHqqlpd64WiJRtbAtAMQz-_3fCU_cLV0,56
1554
- vellum/workflows/nodes/core/map_node/node.py,sha256=bmI48fv-UAmS14ZVV4VWrIUIYFytYGIVM6Gm7yFz8pM,9288
1559
+ vellum/workflows/nodes/core/map_node/node.py,sha256=rbF7fLAU0vUDEpgtWqeQTZFlhWOhJw38tgxWJ6exud8,9313
1555
1560
  vellum/workflows/nodes/core/map_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1556
- vellum/workflows/nodes/core/map_node/tests/test_node.py,sha256=A_M4WfdThNO5FdB7nyCyyVQBEeJWQaxmIDvvSrtO96A,5324
1561
+ vellum/workflows/nodes/core/map_node/tests/test_node.py,sha256=f3lSPYAU1vJUCLCujNOo0EAeBbOM9hnY5A1Wy58korc,6905
1557
1562
  vellum/workflows/nodes/core/retry_node/__init__.py,sha256=lN2bIy5a3Uzhs_FYCrooADyYU6ZGShtvLKFWpelwPvo,60
1558
1563
  vellum/workflows/nodes/core/retry_node/node.py,sha256=abtGvinLfi1tKqYIsWQKZtBUisF2Qw2yT1YoPw9cVk4,5297
1559
1564
  vellum/workflows/nodes/core/retry_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1577,9 +1582,9 @@ vellum/workflows/nodes/displayable/bases/base_prompt_node/__init__.py,sha256=Org
1577
1582
  vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py,sha256=amBXi7Tv50AbGLhfWbwX83PlOdV1XyYRyQmpa6_afE4,3511
1578
1583
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/__init__.py,sha256=Hl35IAoepRpE-j4cALaXVJIYTYOF3qszyVbxTj4kS1s,82
1579
1584
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/constants.py,sha256=fnjiRWLoRlC4Puo5oQcpZD5Hd-EesxsAo9l5tGAkpZQ,270
1580
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=wqN1EjyjTL6McUmlkHWu3GXVzcNaqDjavvmKUHDaVqg,10623
1585
+ vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=eG_buxb4DlgvBzewseQDiUu7Vc2uaoOariVVsWt1068,10579
1581
1586
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1582
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py,sha256=YPOFoaEBENfOzE_qWo3WdQ_E1dQk78aLCWk8gOMvTjg,16042
1587
+ vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py,sha256=inTS8OyGe_62rV4S77HwhqhlTAeJgZlqieeGhdK_ecs,16030
1583
1588
  vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py,sha256=T99UWACTD9ytVDVHa6W2go00V7HNwDxOyBFyMM2GnhQ,9567
1584
1589
  vellum/workflows/nodes/displayable/bases/search_node.py,sha256=3UtbqY3QO4kzfJHbmUNZGnEEfJmaoiF892u8H6TGjp8,5381
1585
1590
  vellum/workflows/nodes/displayable/bases/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1626,16 +1631,17 @@ vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py,sha256=bi
1626
1631
  vellum/workflows/nodes/displayable/subworkflow_deployment_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1627
1632
  vellum/workflows/nodes/displayable/subworkflow_deployment_node/tests/test_node.py,sha256=2KdPh1TeIeW_3xJq4QzAwfcuqL6PmMTLNPz4nSaDLmY,18030
1628
1633
  vellum/workflows/nodes/displayable/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1629
- vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py,sha256=LaxohBcKfSW2PSiBBlx67FdW_q4YC2BM2ouH-vuGPAA,4700
1634
+ vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py,sha256=MHuIolSsrY9ziwoXWsye3XOODncL9DLZOkNYzQMLhRw,4696
1630
1635
  vellum/workflows/nodes/displayable/tests/test_search_node_wth_text_output.py,sha256=VepO5z1277c1y5N6LLIC31nnWD1aak2m5oPFplfJHHs,6935
1631
1636
  vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py,sha256=dc3EEn1sOICpr3GdS8eyeFtExaGwWWcw9eHSdkRhQJU,2584
1632
1637
  vellum/workflows/nodes/experimental/README.md,sha256=eF6DfIL8t-HbF9-mcofOMymKrraiBHDLKTlnBa51ZiE,284
1633
- vellum/workflows/nodes/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1638
+ vellum/workflows/nodes/experimental/__init__.py,sha256=_tpZGWAZLydcKxfrj1-plrZeTajskVhUr1A6mHoSaWM,78
1634
1639
  vellum/workflows/nodes/experimental/openai_chat_completion_node/__init__.py,sha256=lsyD9laR9p7kx5-BXGH2gUTM242UhKy8SMV0SR6S2iE,90
1635
1640
  vellum/workflows/nodes/experimental/openai_chat_completion_node/node.py,sha256=cKI2Ls25L-JVt4z4a2ozQa-YBeVy21Z7BQ32Sj7iBPE,10460
1636
1641
  vellum/workflows/nodes/experimental/tool_calling_node/__init__.py,sha256=S7OzT3I4cyOU5Beoz87nPwCejCMP2FsHBFL8OcVmxJ4,118
1637
1642
  vellum/workflows/nodes/experimental/tool_calling_node/node.py,sha256=NUC7VZj2D86IDQzjCq_a3-Xeqj_b3BE8T1kOMIfN7V8,4878
1638
- vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=_b4xqs2jEQY9aWCCJsFvZZrvXo74NeYiIkD7uJ9RHeU,4781
1643
+ vellum/workflows/nodes/experimental/tool_calling_node/tests/test_tool_calling_node.py,sha256=sxG26mOwt4N36RLoPJ-ngginPqC5qFzD_kGj9izdCFI,1833
1644
+ vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=cdFR0yeb0mDl5CmH27cYQWIb4STg-ZfqtuI6rW66AHo,5097
1639
1645
  vellum/workflows/nodes/mocks.py,sha256=a1FjWEIocseMfjzM-i8DNozpUsaW0IONRpZmXBoWlyc,10455
1640
1646
  vellum/workflows/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1641
1647
  vellum/workflows/nodes/tests/test_mocks.py,sha256=mfPvrs75PKcsNsbJLQAN6PDFoVqs9TmQxpdyFKDdO60,7837
@@ -1668,7 +1674,7 @@ vellum/workflows/sandbox.py,sha256=GVJzVjMuYzOBnSrboB0_6MMRZWBluAyQ2o7syeaeBd0,2
1668
1674
  vellum/workflows/state/__init__.py,sha256=yUUdR-_Vl7UiixNDYQZ-GEM_kJI9dnOia75TtuNEsnE,60
1669
1675
  vellum/workflows/state/base.py,sha256=ZXDmVafs6sExcbx1azrZjEGQsmuY68mSRWfI7t2PT4c,22330
1670
1676
  vellum/workflows/state/context.py,sha256=KOAI1wEGn8dGmhmAemJaf4SZbitP3jpIBcwKfznQaRE,3076
1671
- vellum/workflows/state/encoder.py,sha256=TnOQojc5lTQ83g9QbpA4UCqShJvutmTMxbpKt-9gNe4,1911
1677
+ vellum/workflows/state/encoder.py,sha256=z7Mk6jQC-92wCj6XTK7VEnJ8px_lU8qy0BINqwGDN4I,2063
1672
1678
  vellum/workflows/state/store.py,sha256=uVe-oN73KwGV6M6YLhwZMMUQhzTQomsVfVnb8V91gVo,1147
1673
1679
  vellum/workflows/state/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1674
1680
  vellum/workflows/state/tests/test_state.py,sha256=YOiC9qZAzkdiqb7nRarNWeDwxo7xHv3y3czlHl81ezg,6741
@@ -1696,13 +1702,13 @@ vellum/workflows/utils/uuids.py,sha256=DFzPv9RCvsKhvdTEIQyfSek2A31D6S_QcmeLPbgrg
1696
1702
  vellum/workflows/utils/vellum_variables.py,sha256=UiGlUh0a8vel2FbW3w-xbHxSv_jNutkDdqMVtP_b42A,3385
1697
1703
  vellum/workflows/vellum_client.py,sha256=xkfoucodxNK5JR2-lbRqZx3xzDgExWkP6kySrpi_Ubc,1079
1698
1704
  vellum/workflows/workflows/__init__.py,sha256=KY45TqvavCCvXIkyCFMEc0dc6jTMOUci93U2DUrlZYc,66
1699
- vellum/workflows/workflows/base.py,sha256=9dGZzoXbVVtw19pVhmawIA1wd1iLQttAKypuVFWb0fU,23793
1705
+ vellum/workflows/workflows/base.py,sha256=V60RZat8mG0XmMuIjprkHnacD_MpUdxGcN9t4TaP_Pg,24044
1700
1706
  vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnadGsrSZGa7t7LpJA,2008
1701
1707
  vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1702
1708
  vellum/workflows/workflows/tests/test_base_workflow.py,sha256=8P5YIsNMO78_CR1NNK6wkEdkMB4b3Q_Ni1qxh78OnHo,20481
1703
1709
  vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
1704
- vellum_ai-0.14.49.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1705
- vellum_ai-0.14.49.dist-info/METADATA,sha256=UnFisKY5VZ2o5md6oV2OU-gTx6Y24oQd4u5Bv_rJfag,5484
1706
- vellum_ai-0.14.49.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1707
- vellum_ai-0.14.49.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1708
- vellum_ai-0.14.49.dist-info/RECORD,,
1710
+ vellum_ai-0.14.51.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1711
+ vellum_ai-0.14.51.dist-info/METADATA,sha256=ngfPkauTzHEOvea_irMQiqBgZSWEPIppPpKxA3VmlA0,5484
1712
+ vellum_ai-0.14.51.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1713
+ vellum_ai-0.14.51.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1714
+ vellum_ai-0.14.51.dist-info/RECORD,,
@@ -44,18 +44,40 @@ if TYPE_CHECKING:
44
44
  _NodeDisplayAttrType = TypeVar("_NodeDisplayAttrType")
45
45
 
46
46
 
47
+ def _get_node_input_ids_by_ref(node_class: Type[BaseNode], path: str, inst: Any):
48
+ if isinstance(inst, dict):
49
+ node_input_ids_by_name: Dict[str, UUID] = {}
50
+ for key, value in inst.items():
51
+ node_input_ids_by_name.update(_get_node_input_ids_by_ref(node_class, f"{path}.{key}", value))
52
+ return node_input_ids_by_name
53
+
54
+ return {path: uuid4_from_hash(f"{node_class.__id__}|{path}")}
55
+
56
+
47
57
  class BaseNodeDisplayMeta(type):
48
58
  def __new__(mcs, name: str, bases: Tuple[Type, ...], dct: Dict[str, Any]) -> Any:
49
59
  cls = cast(Type["BaseNodeDisplay"], super().__new__(mcs, name, bases, dct))
60
+ # This cast shouldn't be necessary, but it's a workaround for a mypy bug
61
+ node_class = cast(Type[BaseNode], cls.infer_node_class() if name != "BaseNodeDisplay" else BaseNode)
50
62
 
51
63
  if not dct.get("output_display"):
52
- node_class = cls.infer_node_class()
53
64
  cls.output_display = {
54
65
  ref: NodeOutputDisplay(id=node_class.__output_ids__[ref.name], name=ref.name)
55
66
  for ref in node_class.Outputs
56
67
  if ref.name in node_class.__output_ids__
57
68
  }
58
69
 
70
+ if not dct.get("node_input_ids_by_name"):
71
+ node_input_ids_by_name: Dict[str, UUID] = {}
72
+ for ref in node_class:
73
+ if ref not in cls.__serializable_inputs__:
74
+ continue
75
+
76
+ node_input_ids_by_name.update(_get_node_input_ids_by_ref(node_class, ref.name, ref.instance))
77
+
78
+ if node_input_ids_by_name:
79
+ cls.node_input_ids_by_name = node_input_ids_by_name
80
+
59
81
  return cls.__annotate_node__()
60
82
 
61
83
  def __annotate_node__(cls):
@@ -111,6 +133,10 @@ class BaseNodeDisplay(Generic[NodeType], metaclass=BaseNodeDisplayMeta):
111
133
  # Used by each class extending BaseNodeDisplay to specify which attributes are meant to be serialized
112
134
  # as the former `"inputs"` field
113
135
  __serializable_inputs__: Set[NodeReference] = set()
136
+ # Used by each class extending BaseNodeDisplay to specify which attributes are meant to be opted out
137
+ # of serialization. It's possible that we keep this one as a user facing api in the future, but
138
+ # don't want to commit to that decision just yet
139
+ __unserializable_attributes__: Set[NodeReference] = set()
114
140
  # END: Attributes for backwards compatible serialization
115
141
 
116
142
  def serialize(self, display_context: "WorkflowDisplayContext", **kwargs: Any) -> JsonObject:
@@ -123,9 +149,12 @@ class BaseNodeDisplay(Generic[NodeType], metaclass=BaseNodeDisplayMeta):
123
149
  # We don't need to serialize generic node attributes containing a subworkflow
124
150
  continue
125
151
 
152
+ if attribute in self.__unserializable_attributes__:
153
+ continue
154
+
126
155
  id = (
127
156
  str(self.attribute_ids_by_name[attribute.name])
128
- if self.attribute_ids_by_name
157
+ if self.attribute_ids_by_name.get(attribute.name)
129
158
  else str(uuid4_from_hash(f"{node_id}|{attribute.name}"))
130
159
  )
131
160
  try:
@@ -1,9 +1,7 @@
1
1
  import types
2
- from uuid import UUID
3
- from typing import TYPE_CHECKING, Any, Dict, Generic, Type, TypeVar
2
+ from typing import TYPE_CHECKING, Generic, Type, TypeVar
4
3
 
5
4
  from vellum.workflows.types.generics import NodeType
6
- from vellum.workflows.utils.uuids import uuid4_from_hash
7
5
  from vellum_ee.workflows.display.utils.registry import get_from_node_display_registry
8
6
 
9
7
  if TYPE_CHECKING:
@@ -22,30 +20,9 @@ def get_node_display_class(node_class: Type[NodeType]) -> Type["BaseNodeDisplay"
22
20
  # `base_node_display_class` is always a Generic class, so it's safe to index into it
23
21
  NodeDisplayBaseClass = base_node_display_class[_NodeClassType] # type: ignore[index]
24
22
 
25
- def _get_node_input_ids_by_ref(path: str, inst: Any):
26
- if isinstance(inst, dict):
27
- node_input_ids_by_name: Dict[str, UUID] = {}
28
- for key, value in inst.items():
29
- node_input_ids_by_name.update(_get_node_input_ids_by_ref(f"{path}.{key}", value))
30
- return node_input_ids_by_name
31
-
32
- return {path: uuid4_from_hash(f"{node_class.__id__}|{path}")}
33
-
34
- def exec_body(ns: Dict):
35
- node_input_ids_by_name: Dict[str, UUID] = {}
36
- for ref in node_class:
37
- if ref not in base_node_display_class.__serializable_inputs__:
38
- continue
39
-
40
- node_input_ids_by_name.update(_get_node_input_ids_by_ref(ref.name, ref.instance))
41
-
42
- if node_input_ids_by_name:
43
- ns["node_input_ids_by_name"] = node_input_ids_by_name
44
-
45
23
  NodeDisplayClass = types.new_class(
46
24
  f"{node_class.__name__}Display",
47
25
  bases=(NodeDisplayBaseClass, Generic[_NodeClassType]),
48
- exec_body=exec_body,
49
26
  )
50
27
 
51
28
  return NodeDisplayClass
@@ -19,6 +19,14 @@ _InlinePromptNodeType = TypeVar("_InlinePromptNodeType", bound=InlinePromptNode)
19
19
 
20
20
  class BaseInlinePromptNodeDisplay(BaseNodeDisplay[_InlinePromptNodeType], Generic[_InlinePromptNodeType]):
21
21
  __serializable_inputs__ = {InlinePromptNode.prompt_inputs}
22
+ __unserializable_attributes__ = {
23
+ InlinePromptNode.blocks,
24
+ InlinePromptNode.functions,
25
+ InlinePromptNode.parameters,
26
+ InlinePromptNode.settings,
27
+ InlinePromptNode.expand_meta,
28
+ InlinePromptNode.request_options,
29
+ }
22
30
 
23
31
  def serialize(
24
32
  self, display_context: WorkflowDisplayContext, error_output_id: Optional[UUID] = None, **kwargs
@@ -219,16 +227,25 @@ class BaseInlinePromptNodeDisplay(BaseNodeDisplay[_InlinePromptNodeType], Generi
219
227
  return block
220
228
 
221
229
  def _serialize_attributes(self, display_context: "WorkflowDisplayContext"):
222
- attribute_instances_by_name = {}
230
+ attributes = []
223
231
  for attribute in self._node:
224
- if attribute.name in self.attribute_ids_by_name:
225
- attribute_instances_by_name[attribute.name] = attribute.instance
226
-
227
- return [
228
- {
229
- "id": str(attr_id),
230
- "name": attr_name,
231
- "value": serialize_value(display_context, attribute_instances_by_name[attr_name]),
232
- }
233
- for attr_name, attr_id in self.attribute_ids_by_name.items()
234
- ]
232
+ if attribute in self.__unserializable_attributes__:
233
+ continue
234
+
235
+ id = (
236
+ str(self.attribute_ids_by_name[attribute.name])
237
+ if self.attribute_ids_by_name.get(attribute.name)
238
+ else str(uuid4_from_hash(f"{self.node_id}|{attribute.name}"))
239
+ )
240
+ try:
241
+ attributes.append(
242
+ {
243
+ "id": id,
244
+ "name": attribute.name,
245
+ "value": serialize_value(display_context, attribute.instance),
246
+ }
247
+ )
248
+ except ValueError as e:
249
+ raise ValueError(f"Failed to serialize attribute '{attribute.name}': {e}")
250
+
251
+ return attributes
@@ -4,6 +4,7 @@ from typing import Type
4
4
 
5
5
  from vellum.client.types.variable_prompt_block import VariablePromptBlock
6
6
  from vellum.workflows import BaseWorkflow
7
+ from vellum.workflows.inputs import BaseInputs
7
8
  from vellum.workflows.nodes import BaseNode
8
9
  from vellum.workflows.nodes.displayable.inline_prompt_node.node import InlinePromptNode
9
10
  from vellum.workflows.ports.port import Port
@@ -145,7 +146,7 @@ def test_serialize_node__prompt_inputs__state_reference():
145
146
  ml_model = "gpt-4o"
146
147
 
147
148
  # AND a workflow with the prompt node
148
- class Workflow(BaseWorkflow):
149
+ class Workflow(BaseWorkflow[BaseInputs, MyState]):
149
150
  graph = MyPromptNode
150
151
 
151
152
  # WHEN the workflow is serialized
@@ -184,6 +185,37 @@ def test_serialize_node__prompt_inputs__state_reference():
184
185
  },
185
186
  ]
186
187
 
188
+ # AND the prompt attributes should include a dictionary reference with the state reference
189
+ prompt_inputs_attribute = next(
190
+ attribute for attribute in my_prompt_node["attributes"] if attribute["name"] == "prompt_inputs"
191
+ )
192
+ assert prompt_inputs_attribute == {
193
+ "id": "3b6e1363-e41b-458e-ad28-95a61fdedac1",
194
+ "name": "prompt_inputs",
195
+ "value": {
196
+ "type": "DICTIONARY_REFERENCE",
197
+ "entries": [
198
+ {
199
+ "key": "foo",
200
+ "value": {
201
+ "type": "STATE_VALUE",
202
+ "state_variable_id": "45649791-c642-4405-aff9-a1fafd780ea1",
203
+ },
204
+ },
205
+ {
206
+ "key": "bar",
207
+ "value": {
208
+ "type": "CONSTANT_VALUE",
209
+ "value": {
210
+ "type": "STRING",
211
+ "value": "baz",
212
+ },
213
+ },
214
+ },
215
+ ],
216
+ },
217
+ }
218
+
187
219
 
188
220
  def test_serialize_node__unreferenced_variable_block__still_serializes():
189
221
  # GIVEN a prompt node with an unreferenced variable block
@@ -0,0 +1,177 @@
1
+ from deepdiff import DeepDiff
2
+
3
+ from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
4
+
5
+ from tests.workflows.basic_tool_calling_node.workflow import BasicToolCallingNodeWorkflow
6
+
7
+
8
+ def test_serialize_workflow():
9
+ # GIVEN a Workflow that uses a generic node
10
+ # WHEN we serialize it
11
+ workflow_display = get_workflow_display(workflow_class=BasicToolCallingNodeWorkflow)
12
+
13
+ serialized_workflow: dict = workflow_display.serialize()
14
+ # THEN we should get a serialized representation of the Workflow
15
+ assert serialized_workflow.keys() == {
16
+ "workflow_raw_data",
17
+ "input_variables",
18
+ "state_variables",
19
+ "output_variables",
20
+ }
21
+
22
+ # AND its input variables should be what we expect
23
+ input_variables = serialized_workflow["input_variables"]
24
+ assert len(input_variables) == 0
25
+
26
+ # AND its output variables should be what we expect
27
+ output_variables = serialized_workflow["output_variables"]
28
+ assert len(output_variables) == 2
29
+ assert not DeepDiff(
30
+ [
31
+ {"id": "8e7c0147-930d-4b7f-b6b1-6d79641cd3eb", "key": "text", "type": "STRING"},
32
+ {"id": "01a07e6d-7269-4f45-8b44-ef0227a2e88d", "key": "chat_history", "type": "CHAT_HISTORY"},
33
+ ],
34
+ output_variables,
35
+ ignore_order=True,
36
+ )
37
+
38
+ # AND its raw data should be what we expect
39
+ workflow_raw_data = serialized_workflow["workflow_raw_data"]
40
+ tool_calling_node = workflow_raw_data["nodes"][1]
41
+ assert tool_calling_node == {
42
+ "id": "21f29cac-da87-495f-bba1-093d423f4e46",
43
+ "label": "GetCurrentWeatherNode",
44
+ "type": "GENERIC",
45
+ "display_data": {
46
+ "position": {"x": 0.0, "y": 0.0},
47
+ "comment": {"value": "\n A tool calling node that calls the get_current_weather function.\n "},
48
+ },
49
+ "base": {
50
+ "name": "ToolCallingNode",
51
+ "module": ["vellum", "workflows", "nodes", "experimental", "tool_calling_node", "node"],
52
+ },
53
+ "definition": {
54
+ "name": "GetCurrentWeatherNode",
55
+ "module": ["tests", "workflows", "basic_tool_calling_node", "workflow"],
56
+ },
57
+ "trigger": {"id": "2414743b-b1dd-4552-8abf-9b7481df9762", "merge_behavior": "AWAIT_ATTRIBUTES"},
58
+ "ports": [{"id": "3cd6d78c-9dad-42aa-ad38-31f67057c379", "name": "default", "type": "DEFAULT"}],
59
+ "adornments": None,
60
+ "attributes": [
61
+ {
62
+ "id": "44420e39-966f-4c59-bdf8-6365a61c5d2a",
63
+ "name": "ml_model",
64
+ "value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "gpt-4o-mini"}},
65
+ },
66
+ {
67
+ "id": "669cfb4b-8c25-460e-8952-b63d91302cbc",
68
+ "name": "blocks",
69
+ "value": {
70
+ "type": "CONSTANT_VALUE",
71
+ "value": {
72
+ "type": "JSON",
73
+ "value": [
74
+ {
75
+ "block_type": "CHAT_MESSAGE",
76
+ "state": None,
77
+ "cache_config": None,
78
+ "chat_role": "SYSTEM",
79
+ "chat_source": None,
80
+ "chat_message_unterminated": None,
81
+ "blocks": [
82
+ {
83
+ "block_type": "RICH_TEXT",
84
+ "state": None,
85
+ "cache_config": None,
86
+ "blocks": [
87
+ {
88
+ "block_type": "PLAIN_TEXT",
89
+ "state": None,
90
+ "cache_config": None,
91
+ "text": "You are a weather expert",
92
+ }
93
+ ],
94
+ }
95
+ ],
96
+ },
97
+ {
98
+ "block_type": "CHAT_MESSAGE",
99
+ "state": None,
100
+ "cache_config": None,
101
+ "chat_role": "USER",
102
+ "chat_source": None,
103
+ "chat_message_unterminated": None,
104
+ "blocks": [
105
+ {
106
+ "block_type": "RICH_TEXT",
107
+ "state": None,
108
+ "cache_config": None,
109
+ "blocks": [
110
+ {
111
+ "block_type": "VARIABLE",
112
+ "state": None,
113
+ "cache_config": None,
114
+ "input_variable": "question",
115
+ }
116
+ ],
117
+ }
118
+ ],
119
+ },
120
+ ],
121
+ },
122
+ },
123
+ },
124
+ {
125
+ "id": "78324739-ff89-47a5-902b-10da0cb95c6d",
126
+ "name": "functions",
127
+ "value": {
128
+ "type": "CONSTANT_VALUE",
129
+ "value": {
130
+ "type": "JSON",
131
+ "value": [
132
+ {
133
+ "state": None,
134
+ "cache_config": None,
135
+ "name": "get_current_weather",
136
+ "description": None,
137
+ "parameters": {
138
+ "type": "object",
139
+ "properties": {"location": {"type": "string"}, "unit": {"type": "string"}},
140
+ "required": ["location", "unit"],
141
+ },
142
+ "forced": None,
143
+ "strict": None,
144
+ }
145
+ ],
146
+ },
147
+ },
148
+ },
149
+ {
150
+ "id": "0f6dc102-3460-4963-91fa-7ba85d65ef7a",
151
+ "name": "prompt_inputs",
152
+ "value": {
153
+ "type": "CONSTANT_VALUE",
154
+ "value": {"type": "JSON", "value": {"question": "What's the weather like in San Francisco?"}},
155
+ },
156
+ },
157
+ {
158
+ "id": "5c041b7d-732c-4773-a93a-32211f2af0b3",
159
+ "name": "max_tool_calls",
160
+ "value": {"type": "CONSTANT_VALUE", "value": {"type": "NUMBER", "value": 1.0}},
161
+ },
162
+ ],
163
+ "outputs": [
164
+ {
165
+ "id": "e62bc785-a914-4066-b79e-8c89a5d0ec6c",
166
+ "name": "text",
167
+ "type": "STRING",
168
+ "value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": ""}},
169
+ },
170
+ {
171
+ "id": "4674f1d9-e3af-411f-8a55-40a3a3ab5394",
172
+ "name": "chat_history",
173
+ "type": "CHAT_HISTORY",
174
+ "value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": []}},
175
+ },
176
+ ],
177
+ }
@@ -253,7 +253,7 @@ def serialize_value(display_context: "WorkflowDisplayContext", value: Any) -> Js
253
253
  "type": "CONSTANT_VALUE",
254
254
  "value": {
255
255
  "type": "JSON",
256
- "items": constant_values,
256
+ "value": constant_values,
257
257
  },
258
258
  }
259
259
  else: