vellum-ai 1.1.5__py3-none-any.whl → 1.2.0__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 (26) hide show
  1. vellum/client/core/client_wrapper.py +2 -2
  2. vellum/workflows/sandbox.py +22 -5
  3. {vellum_ai-1.1.5.dist-info → vellum_ai-1.2.0.dist-info}/METADATA +1 -1
  4. {vellum_ai-1.1.5.dist-info → vellum_ai-1.2.0.dist-info}/RECORD +26 -26
  5. vellum_ee/workflows/display/nodes/base_node_display.py +2 -2
  6. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +4 -0
  7. vellum_ee/workflows/display/nodes/vellum/retry_node.py +1 -1
  8. vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py +1 -1
  9. vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +75 -1
  10. vellum_ee/workflows/display/nodes/vellum/try_node.py +1 -1
  11. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py +9 -9
  12. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py +9 -9
  13. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py +3 -3
  14. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py +14 -15
  15. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py +58 -3
  16. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +1 -1
  17. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py +4 -0
  18. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +1 -1
  19. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_inline_workflow_serialization.py +2 -2
  20. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py +1 -1
  21. vellum_ee/workflows/display/utils/expressions.py +5 -1
  22. vellum_ee/workflows/display/workflows/base_workflow_display.py +20 -0
  23. vellum_ee/workflows/tests/test_serialize_module.py +31 -0
  24. {vellum_ai-1.1.5.dist-info → vellum_ai-1.2.0.dist-info}/LICENSE +0 -0
  25. {vellum_ai-1.1.5.dist-info → vellum_ai-1.2.0.dist-info}/WHEEL +0 -0
  26. {vellum_ai-1.1.5.dist-info → vellum_ai-1.2.0.dist-info}/entry_points.txt +0 -0
@@ -27,10 +27,10 @@ class BaseClientWrapper:
27
27
 
28
28
  def get_headers(self) -> typing.Dict[str, str]:
29
29
  headers: typing.Dict[str, str] = {
30
- "User-Agent": "vellum-ai/1.1.5",
30
+ "User-Agent": "vellum-ai/1.2.0",
31
31
  "X-Fern-Language": "Python",
32
32
  "X-Fern-SDK-Name": "vellum-ai",
33
- "X-Fern-SDK-Version": "1.1.5",
33
+ "X-Fern-SDK-Version": "1.2.0",
34
34
  **(self.get_custom_headers() or {}),
35
35
  }
36
36
  if self._api_version is not None:
@@ -1,4 +1,4 @@
1
- from typing import Generic, Sequence
1
+ from typing import Generic, Optional, Sequence
2
2
 
3
3
  import dotenv
4
4
 
@@ -10,12 +10,29 @@ from vellum.workflows.workflows.event_filters import root_workflow_event_filter
10
10
 
11
11
 
12
12
  class WorkflowSandboxRunner(Generic[WorkflowType]):
13
- def __init__(self, workflow: WorkflowType, inputs: Sequence[BaseInputs]):
14
- if not inputs:
15
- raise ValueError("Inputs are required to have at least one defined inputs")
13
+ def __init__(
14
+ self,
15
+ workflow: WorkflowType,
16
+ inputs: Optional[Sequence[BaseInputs]] = None, # DEPRECATED - remove in v2.0.0
17
+ dataset: Optional[Sequence[BaseInputs]] = None,
18
+ ):
19
+ if dataset is not None and inputs is not None:
20
+ raise ValueError(
21
+ "Cannot specify both 'dataset' and 'inputs' parameters. " "Use 'dataset' as 'inputs' is deprecated."
22
+ )
23
+
24
+ if dataset is not None:
25
+ actual_inputs = dataset
26
+ elif inputs is not None:
27
+ actual_inputs = inputs
28
+ else:
29
+ raise ValueError("Either 'dataset' or 'inputs' parameter is required")
30
+
31
+ if not actual_inputs:
32
+ raise ValueError("Dataset/inputs are required to have at least one defined input")
16
33
 
17
34
  self._workflow = workflow
18
- self._inputs = inputs
35
+ self._inputs = actual_inputs
19
36
 
20
37
  dotenv.load_dotenv()
21
38
  self._logger = load_logger()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 1.1.5
3
+ Version: 1.2.0
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.9,<4.0
@@ -28,7 +28,7 @@ vellum_ee/workflows/display/editor/__init__.py,sha256=MSAgY91xCEg2neH5d8jXx5wRdR
28
28
  vellum_ee/workflows/display/editor/types.py,sha256=x-tOOCJ6CF4HmiKDfCmcc3bOVfc1EBlP5o6u5WEfLoY,567
29
29
  vellum_ee/workflows/display/exceptions.py,sha256=Oys39dHoW-s-1dnlRSZxTntMq8_macj-b2CT_6dqzJs,355
30
30
  vellum_ee/workflows/display/nodes/__init__.py,sha256=jI1aPBQf8DkmrYoZ4O-wR1duqZByOf5mDFmo_wFJPE4,307
31
- vellum_ee/workflows/display/nodes/base_node_display.py,sha256=EoAeFrfo8bk4ad0G6ZXeco8iRmfi6rLgvAEQ40Ald4U,17975
31
+ vellum_ee/workflows/display/nodes/base_node_display.py,sha256=chHNgngguwtjUAf3uJR6FF4TdcYAmkRHLBJRP4WfPW4,17961
32
32
  vellum_ee/workflows/display/nodes/get_node_display_class.py,sha256=jI_kUi9LnNLDpY63QtlC4TfN8P571VN4LpzH0I1ZtLk,1149
33
33
  vellum_ee/workflows/display/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  vellum_ee/workflows/display/nodes/tests/test_base_node_display.py,sha256=wBoCqULS4XO3s9Vwhd9v4g10opfBFqeZgRqB8CoFz0c,3015
@@ -42,13 +42,13 @@ vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=OEw8QRPliL4P
42
42
  vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=YhMsi2TG1zSR8E7IpxzzSncOyVLcvqTuGa3mr4RqHd8,2364
43
43
  vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=zo-nalsuayMqeb2GwR2OB9SFK3y2U5aG-rtwrsjdasQ,3089
44
44
  vellum_ee/workflows/display/nodes/vellum/guardrail_node.py,sha256=IniO5KvO0Rw9zghFg3RFvbXBTv6Zi1iuQhaA1DLazqU,2331
45
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=9zLM81RU2FHNaKcrtZkQ-Wez5IaSJ1HuxCBC_BM4CZI,11094
45
+ vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=6gbDSw1N74gATXkPvRNSZFd__OncCJP0PPgT-timzwA,11259
46
46
  vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py,sha256=f7MeoxgKrdyb1dSJsvdDtZPlp1J2Pa4njPvN3qHVktA,6028
47
47
  vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=uaZ2wcZR1J9C9iI0QWAsgNK9IlcuCz1808oxXmiYsLY,3908
48
48
  vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=RTP_raQWL8ZKoRKLpxLfpyXzw61TZeTCkTuM1uRLIkI,3274
49
49
  vellum_ee/workflows/display/nodes/vellum/note_node.py,sha256=6xf8MJ684KecKPJrGlCJuJYLPtYImXmqN85Y_6KPjW4,1141
50
50
  vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py,sha256=cT5qT7Nd2v6rSsIErpSAWaxta7txGOSFOZz2AQYQmWE,3536
51
- vellum_ee/workflows/display/nodes/vellum/retry_node.py,sha256=Gos8F1yKN69GmegDO2q3NlGTamibd4rpuTasSU0mK8c,3281
51
+ vellum_ee/workflows/display/nodes/vellum/retry_node.py,sha256=3tkrZu7LczrD6KwdtU3g3xGOyVR3KKSbG5_H3Lbqvho,3274
52
52
  vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=bF07csUFSQlAeOayPPws5pz3tBTp1PdwgHb8WItgXmY,12319
53
53
  vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py,sha256=wr2MaqoGFtkL1o7B-4GXgF1gEEOTWsUEiX8l_g7e1qs,2958
54
54
  vellum_ee/workflows/display/nodes/vellum/templating_node.py,sha256=TdIJWh2l8p4tw7ejRexGOFQKnviirUqie3WYwsrVQ4g,3339
@@ -60,34 +60,34 @@ vellum_ee/workflows/display/nodes/vellum/tests/test_inline_subworkflow_node.py,s
60
60
  vellum_ee/workflows/display/nodes/vellum/tests/test_note_node.py,sha256=uiMB0cOxKZzos7YKnj4ef4DFa2bOvZJWIv-hfbUV6Go,1218
61
61
  vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py,sha256=G-qJyTNJkpqJiEZ3kCJl86CXJINLeFyf2lM0bQHCCOs,3822
62
62
  vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=h3rXIfB349w11cMgNpqEWCI3ucTsTb30cWskXN8FoV0,14053
63
- vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py,sha256=h93ysolmbo2viisyhRnXKHPxiDK0I_dSAbYoHFYIoO4,1953
63
+ vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py,sha256=WyqX_g-jN4BOVHIto_HDRVb-uWCmDTaiCwHho4uYKOM,1954
64
64
  vellum_ee/workflows/display/nodes/vellum/tests/test_search_node.py,sha256=KvByxgbUkVyfPIVxTUBUk6a92JiJMi8eReZWxzfPExU,3864
65
65
  vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py,sha256=BUzHJgjdWnPeZxjFjHfDBKnbFjYjnbXPjc-1hne1B2Y,3965
66
66
  vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py,sha256=LSk2gx9TpGXbAqKe8dggQW8yJZqj-Cf0EGJFeGGlEcw,3321
67
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py,sha256=KF31033chAPfMOC_YOWJH_92ZoNfCdavNWzrEeB0QUc,13819
67
+ vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py,sha256=CPKDOM5Qzk4ETP_onbEmUmEqzNYPru_OgsQG2LAS_Vg,16430
68
68
  vellum_ee/workflows/display/nodes/vellum/tests/test_try_node.py,sha256=Khjsb53PKpZuyhKoRMgKAL45eGp5hZqXvHmVeQWRw4w,2289
69
69
  vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py,sha256=rHybfUAWwa0LlstQTNthGb-zYXrUCLADFtn_4SGsbw8,4807
70
- vellum_ee/workflows/display/nodes/vellum/try_node.py,sha256=z9Omo676RRc7mQjLoL7hjiHhUj0OWVLhrrb97YTN4QA,4086
70
+ vellum_ee/workflows/display/nodes/vellum/try_node.py,sha256=47fOnSCEFnY8th9m2yTYlgnoUuzgyRZdjg-SXwn--lk,4079
71
71
  vellum_ee/workflows/display/nodes/vellum/utils.py,sha256=oICunzyaXPs0tYnW5zH1r93Bx35MSH7mcD-n0DEWRok,4978
72
72
  vellum_ee/workflows/display/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  vellum_ee/workflows/display/tests/test_base_workflow_display.py,sha256=NTtZltrBqA0BlbDvCOJaBWABMmns74StnisA9icBZ8U,10602
74
74
  vellum_ee/workflows/display/tests/workflow_serialization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py,sha256=Y-ajeT65b5varmrZCw6L3hir4hJCFq-eO0jZfRcrs7g,1886
77
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py,sha256=aEmF6zpmmHdFgiG4V81EweOk5qO6cfukR782dYSE960,14060
78
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py,sha256=tZ_YK1NpMd8_2ADcbF3PKM2i7fIbSyjUMsP8MCWx2g0,26643
79
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py,sha256=s6_mnk0pkztU59wYpSfOFpMhAJaRjmyfxM6WJGtnD4Y,6456
80
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py,sha256=PkSgghJDz0fpDB72HHPjLjo8LkZk-HpUkCQzRLX-iVw,40611
81
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py,sha256=dsJr8I9AdPwMOGszirfNDzZP2Ychd94aAKuPXAzknMk,4632
77
+ vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py,sha256=bD9AtBo7Pz1Drbh420NR0VSiHBfExw_UtNRPCiAqki0,13967
78
+ vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py,sha256=iqTbPYVSrMgIls7vKdPgr7ZEbdpztDjlOWvexPU-zqc,26240
79
+ vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py,sha256=O1CIKMmRTaMaT3IhjwCAiMz1ZThPg9lAUbSiZkx_E8c,6321
80
+ vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py,sha256=fPXcX-tWQ0UMuEyOFAylgi7pWiE7lZWk9vrShlTExik,40053
81
+ vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py,sha256=FLvcD8eoABHUPv08oSpIp_P-65sw2gl4whMXEJJj4f8,6785
82
82
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py,sha256=a05Uh47ZRyy7P2ffZC3yieplFGqmlnjx1sGwY80ZLVU,16189
83
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py,sha256=B4DC2e5nqEk5NZeUwR4vKmBoEyToHkAuq4cCqbsidFo,29708
83
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py,sha256=moLDV23iXN7ngg6DRJqcttWE2v2UfziLIMUZ_2Amjp0,29709
84
84
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py,sha256=oKO8KGlkl505TSW5v0retJF4FS8TfwxxuAzqY9Adr8k,53608
85
85
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_default_state_serialization.py,sha256=E1ww97BFoGbnRkxf84TScat5NQhP8nLVrdaOlpGnSKU,8615
86
86
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py,sha256=w1BYEZXIMjWmcKGQXzhelHnKFlEAXmsgjkI9fcgqKXA,5850
87
87
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_generic_node_serialization.py,sha256=-T0cd2jx1bC0ZNtAESF78fnYD_0nOqo8zMMLwRHUTRM,6227
88
88
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py,sha256=PZ9Yec8D6e9wM2kh5eWtNvK5BghTf1RdvoSW5_pw3FM,7384
89
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py,sha256=vVqxXHieRUPP1Rt4ITnjMxuGU52WBfifoEzPyHQnd7w,25618
90
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py,sha256=3Djct7lIr2TPW-wDd_t6eoNdsE0hBOj9OwKWRroXMUo,21659
89
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py,sha256=zOv-CzFZs_9NqlINQ7hzJmd4o8ArDBKB7Eyr1Rfd-BU,25767
90
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py,sha256=cCfOGFe1TL8X9-gorbHA0xND3_OuQtKUCGWkYukNQ14,21660
91
91
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py,sha256=91u9FWLErrNGfUkZ22ifk6IazGtaYoDFbZYjhxEESgI,16579
92
92
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py,sha256=rtkAQw5awOFX3pWh0qz3f766-tTnPhToGsXVSHO4M4U,8352
93
93
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py,sha256=RgJw9lwI7ihqngEbdWbxfIsO1q0asi2JrBx1PRebndU,21076
@@ -96,9 +96,9 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_
96
96
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py,sha256=V8b6gKghLlO7PJI8xeNdnfn8aII0W_IFQvSQBQM62UQ,7721
97
97
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py,sha256=hDWtKXmGI1CKhTwTNqpu_d5RkE5n7SolMLtgd87KqTI,3856
98
98
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_composio_serialization.py,sha256=AUfULtIangNYkvLH3jd2Ar8X5ulW4tGmezeCfMmXFUU,3697
99
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_inline_workflow_serialization.py,sha256=K_Wx8QLFeigziK8KvbRFm5M_bBSmVzcsmQnagC97DWo,26363
99
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_inline_workflow_serialization.py,sha256=Sg82qV5NCzQDy-RD90hA6QaHgFHOq6ESNkbWXygsnNw,26367
100
100
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py,sha256=9ORex-okcpwbbkxEDJyyRlbPid6zLSDduK0fBfrp8kk,2415
101
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=txiUpg0BrGJiP2hrTVpwoT4bGqoo0rImSFFvOpigX8c,10082
101
+ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=-7NvpYUZEl2T15AS9MPt_scyhKmUmS3wEPa320sgWOI,10085
102
102
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py,sha256=XIZZr5POo2NLn2uEWm9EC3rejeBMoO4X-JtzTH6mvp4,4074
103
103
  vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=pLCyMScV88DTBXRH7jXaXOEA1GBq8NIipCUFwIAWnwI,2771
104
104
  vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=J4ouI8KxbMfxQP2Zq_9cWMGYgbjCWmKzjCJEtnSJb0I,5829
@@ -107,14 +107,14 @@ vellum_ee/workflows/display/types.py,sha256=cyZruu4sXAdHjwuFc7dydM4DcFNf-pp_Cmul
107
107
  vellum_ee/workflows/display/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  vellum_ee/workflows/display/utils/auto_layout.py,sha256=f4GiLn_LazweupfqTpubcdtdfE_vrOcmZudSsnYIY9E,3906
109
109
  vellum_ee/workflows/display/utils/exceptions.py,sha256=LSwwxCYNxFkf5XMUcFkaZKpQ13OSrI7y_bpEUwbKVk0,169
110
- vellum_ee/workflows/display/utils/expressions.py,sha256=vzytRJ46iGHgOEiBio05EZ0XgXSSdEazRS37S4EYVhQ,16601
110
+ vellum_ee/workflows/display/utils/expressions.py,sha256=EPpdnG4esGVjQVYYWJT1G5LWRLhWN_s45LIPQvy_ge4,16772
111
111
  vellum_ee/workflows/display/utils/registry.py,sha256=fWIm5Jj-10gNFjgn34iBu4RWv3Vd15ijtSN0V97bpW8,1513
112
112
  vellum_ee/workflows/display/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  vellum_ee/workflows/display/utils/tests/test_auto_layout.py,sha256=vfXI769418s9vda5Gb5NFBH747WMOwSgHRXeLCTLVm8,2356
114
114
  vellum_ee/workflows/display/utils/vellum.py,sha256=mtoXmSYwR7rvrq-d6CzCW_auaJXTct0Mi1F0xpRCiNQ,5627
115
115
  vellum_ee/workflows/display/vellum.py,sha256=J2mdJZ1sdLW535DDUkq_Vm8Z572vhuxHxVZF9deKSdk,391
116
116
  vellum_ee/workflows/display/workflows/__init__.py,sha256=JTB9ObEV3l4gGGdtfBHwVJtTTKC22uj-a-XjTVwXCyA,148
117
- vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=mEJPUZIBPjPdYDUW1ZeWiMTLaDKfnNQQ7kvcwiTJ_ac,42041
117
+ vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=StflRnfj2GPYyvg3-kZvzPoNkw5a8hpSjlaMQBzEnAY,43035
118
118
  vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=gxz76AeCqgAZ9D2lZeTiZzxY9eMgn3qOSfVgiqYcOh8,2028
119
119
  vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=pb7BTH-ivRnya1LQU3j-MApWk_m8POpPNOdD0oEK82A,37847
120
120
  vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -139,7 +139,7 @@ vellum_ee/workflows/tests/local_workflow/nodes/final_output.py,sha256=ZX7zBv87zi
139
139
  vellum_ee/workflows/tests/local_workflow/nodes/templating_node.py,sha256=NQwFN61QkHfI3Vssz-B0NKGfupK8PU0FDSAIAhYBLi0,325
140
140
  vellum_ee/workflows/tests/local_workflow/workflow.py,sha256=A4qOzOPNwePYxWbcAgIPLsmrVS_aVEZEc-wULSv787Q,393
141
141
  vellum_ee/workflows/tests/test_display_meta.py,sha256=PkXJVnMZs9GNooDkd59n4YTBAX3XGPQWeSSVbhehVFM,5112
142
- vellum_ee/workflows/tests/test_serialize_module.py,sha256=EVrCRAP0lpvd0GIDlg2tnGfJzDNooNDXPfGFPLAqmbI,1870
142
+ vellum_ee/workflows/tests/test_serialize_module.py,sha256=lk-4dVnG2HcxxywBXxDR1ieH8D9RJt4lvchoZhtQPdU,2892
143
143
  vellum_ee/workflows/tests/test_server.py,sha256=SsOkS6sGO7uGC4mxvk4iv8AtcXs058P9hgFHzTWmpII,14519
144
144
  vellum_ee/workflows/tests/test_virtual_files.py,sha256=TJEcMR0v2S8CkloXNmCHA0QW0K6pYNGaIjraJz7sFvY,2762
145
145
  vellum/__init__.py,sha256=iqkCA7SoYec2cOIyNBQeu7f0reFyxwR4zlSAYg71ncM,43613
@@ -147,7 +147,7 @@ vellum/client/README.md,sha256=gxc7JlJRBrBZpN5LHa2ORxYTRHFLPnWmnIugN8pmQh4,5600
147
147
  vellum/client/__init__.py,sha256=NEcLUhKRIK0OGGXTSQbarRaacFkJWFmM5iY4F9lgIDI,72131
148
148
  vellum/client/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
149
149
  vellum/client/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
150
- vellum/client/core/client_wrapper.py,sha256=DpUpUgjS2uzkAZFSPBjxVkQxUTezxAyRpEypFJZvapU,2840
150
+ vellum/client/core/client_wrapper.py,sha256=TZs53rWMa0VP-FbcYs869Qj_v3-6RgMw_JgLuJoBY0w,2840
151
151
  vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
152
152
  vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
153
153
  vellum/client/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
@@ -1802,7 +1802,7 @@ vellum/workflows/resolvers/__init__.py,sha256=eH6hTvZO4IciDaf_cf7aM2vs-DkBDyJPyc
1802
1802
  vellum/workflows/resolvers/base.py,sha256=WHra9LRtlTuB1jmuNqkfVE2JUgB61Cyntn8f0b0WZg4,411
1803
1803
  vellum/workflows/runner/__init__.py,sha256=i1iG5sAhtpdsrlvwgH6B-m49JsINkiWyPWs8vyT-bqM,72
1804
1804
  vellum/workflows/runner/runner.py,sha256=sADrp593ia4auJ8fIP6jc5na3b5WaTvvBdjpkTthboY,36929
1805
- vellum/workflows/sandbox.py,sha256=GVJzVjMuYzOBnSrboB0_6MMRZWBluAyQ2o7syeaeBd0,2235
1805
+ vellum/workflows/sandbox.py,sha256=xaXjegP1dg1eYEyxjb0iMIBwK4bqzMfi8KPd6lA018k,2854
1806
1806
  vellum/workflows/state/__init__.py,sha256=yUUdR-_Vl7UiixNDYQZ-GEM_kJI9dnOia75TtuNEsnE,60
1807
1807
  vellum/workflows/state/base.py,sha256=m9fCqbZn21GshCVCjJTD1dPZEQjFrsMXqlg7tM9fIwM,24283
1808
1808
  vellum/workflows/state/context.py,sha256=i9tQKTB2b2SBpNObtb8skTv63lQcwUDW1ZQ0qDTnGJA,5181
@@ -1842,8 +1842,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
1842
1842
  vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1843
1843
  vellum/workflows/workflows/tests/test_base_workflow.py,sha256=ptMntHzVyy8ZuzNgeTuk7hREgKQ5UBdgq8VJFSGaW4Y,20832
1844
1844
  vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
1845
- vellum_ai-1.1.5.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1846
- vellum_ai-1.1.5.dist-info/METADATA,sha256=tyN3xDCmqMqgJmFZweIhi6oIZXIrDFs3Xnac__QYrdI,5547
1847
- vellum_ai-1.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1848
- vellum_ai-1.1.5.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1849
- vellum_ai-1.1.5.dist-info/RECORD,,
1845
+ vellum_ai-1.2.0.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1846
+ vellum_ai-1.2.0.dist-info/METADATA,sha256=DY_XVUAkrUVX6xUGRfjFW_b-L6NC4xIBs83ertamHTQ,5547
1847
+ vellum_ai-1.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1848
+ vellum_ai-1.2.0.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1849
+ vellum_ai-1.2.0.dist-info/RECORD,,
@@ -175,7 +175,7 @@ class BaseNodeDisplay(Generic[NodeType], metaclass=BaseNodeDisplayMeta):
175
175
 
176
176
  adornment: JsonObject = {
177
177
  "id": str(node_id),
178
- "label": node.__qualname__,
178
+ "label": self.label,
179
179
  "base": self.get_base().dict(),
180
180
  "attributes": attributes,
181
181
  }
@@ -205,7 +205,7 @@ class BaseNodeDisplay(Generic[NodeType], metaclass=BaseNodeDisplayMeta):
205
205
 
206
206
  return {
207
207
  "id": str(node_id),
208
- "label": node.__qualname__,
208
+ "label": self.label,
209
209
  "type": "GENERIC",
210
210
  "display_data": self.get_display_data().dict(),
211
211
  "base": self.get_base().dict(),
@@ -100,6 +100,10 @@ class BaseInlinePromptNodeDisplay(BaseNodeDisplay[_InlinePromptNodeType], Generi
100
100
  "display_data": self.get_display_data().dict(),
101
101
  "base": self.get_base().dict(),
102
102
  "definition": self.get_definition().dict(),
103
+ "trigger": {
104
+ "id": str(self.get_target_handle_id()),
105
+ "merge_behavior": node.Trigger.merge_behavior.value,
106
+ },
103
107
  "outputs": [
104
108
  {"id": str(json_display.id), "name": "json", "type": "JSON", "value": None},
105
109
  {"id": str(output_display.id), "name": "text", "type": "STRING", "value": None},
@@ -39,7 +39,7 @@ class BaseRetryNodeDisplay(BaseAdornmentNodeDisplay[_RetryNodeType], Generic[_Re
39
39
 
40
40
  adornment: JsonObject = {
41
41
  "id": str(node_id),
42
- "label": node.__qualname__,
42
+ "label": self.label,
43
43
  "base": self.get_base().dict(),
44
44
  "attributes": attributes,
45
45
  }
@@ -29,7 +29,7 @@ def test_retry_node_parameters():
29
29
  )
30
30
 
31
31
  retry_adornment = next(
32
- adornment for adornment in serialized_node["adornments"] if adornment["label"] == "RetryNode"
32
+ adornment for adornment in serialized_node["adornments"] if adornment["label"] == "Retry Node"
33
33
  )
34
34
 
35
35
  max_attempts_attribute = next(attr for attr in retry_adornment["attributes"] if attr["name"] == "max_attempts")
@@ -1,6 +1,7 @@
1
1
  from vellum.client.types.prompt_parameters import PromptParameters
2
2
  from vellum.workflows import BaseWorkflow
3
3
  from vellum.workflows.inputs import BaseInputs
4
+ from vellum.workflows.nodes.displayable.code_execution_node.node import CodeExecutionNode
4
5
  from vellum.workflows.nodes.displayable.inline_prompt_node.node import InlinePromptNode
5
6
  from vellum.workflows.nodes.displayable.tool_calling_node.node import ToolCallingNode
6
7
  from vellum.workflows.nodes.displayable.tool_calling_node.state import ToolCallingState
@@ -243,7 +244,7 @@ def test_serialize_tool_router_node():
243
244
  },
244
245
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
245
246
  "id": "690c66e1-1e18-4984-b695-84beb0157541",
246
- "label": "RouterNode",
247
+ "label": "Router Node",
247
248
  "outputs": [],
248
249
  "ports": [
249
250
  {
@@ -332,3 +333,76 @@ def test_serialize_tool_router_node():
332
333
  "trigger": {"id": "73a96f44-c2dd-40cc-96f6-49b9f914b166", "merge_behavior": "AWAIT_ATTRIBUTES"},
333
334
  "type": "GENERIC",
334
335
  }
336
+
337
+
338
+ def test_serialize_node__tool_calling_node__subworkflow_with_parent_input_reference():
339
+ """
340
+ Test that a tool calling node with a subworkflow that references parent inputs serializes correctly
341
+ """
342
+
343
+ # GIVEN a workflow inputs class
344
+ class MyInputs(BaseInputs):
345
+ text: str
346
+ greeting: str
347
+
348
+ # AND a code execution node that references parent inputs
349
+ class CodeExecution(CodeExecutionNode[BaseState, str]):
350
+ code = ""
351
+ code_inputs = {
352
+ "text": MyInputs.text,
353
+ }
354
+ runtime = "PYTHON_3_11_6"
355
+ packages = []
356
+
357
+ # AND a subworkflow that uses the code execution node
358
+ class FunctionSubworkflow(BaseWorkflow):
359
+ graph = CodeExecution
360
+
361
+ class Outputs(BaseWorkflow.Outputs):
362
+ output = CodeExecution.Outputs.result
363
+
364
+ # AND a tool calling node that uses the subworkflow
365
+ class MyToolCallingNode(ToolCallingNode):
366
+ ml_model = "gpt-4.1"
367
+ prompt_inputs = {
368
+ "text": MyInputs.text,
369
+ }
370
+ blocks = []
371
+ parameters = PromptParameters()
372
+ functions = [FunctionSubworkflow]
373
+
374
+ # AND a workflow with the tool calling node
375
+ class Workflow(BaseWorkflow[MyInputs, BaseState]):
376
+ graph = MyToolCallingNode
377
+
378
+ # WHEN the workflow is serialized
379
+ workflow_display = get_workflow_display(workflow_class=Workflow)
380
+ serialized_workflow: dict = workflow_display.serialize()
381
+
382
+ # THEN the node should properly serialize the functions with parent input references
383
+ my_tool_calling_node = next(
384
+ node
385
+ for node in serialized_workflow["workflow_raw_data"]["nodes"]
386
+ if node["id"] == str(MyToolCallingNode.__id__)
387
+ )
388
+
389
+ functions_attribute = next(
390
+ attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "functions"
391
+ )
392
+
393
+ data = functions_attribute["value"]["value"]["value"][0]
394
+ nodes = data["exec_config"]["workflow_raw_data"]["nodes"]
395
+ code_exec_node = next((node for node in nodes if node["type"] == "CODE_EXECUTION"), None)
396
+
397
+ assert code_exec_node is not None
398
+ text_input = next((input for input in code_exec_node["inputs"] if input["key"] == "text"), None)
399
+ assert text_input == {
400
+ "id": "da92a1c4-d37c-4008-a1ab-c0bcc0cd20d0",
401
+ "key": "text",
402
+ "value": {
403
+ "rules": [
404
+ {"type": "INPUT_VARIABLE", "data": {"input_variable_id": "6f0c1889-3f08-4c5c-bb24-f7b94169105c"}}
405
+ ],
406
+ "combinator": "OR",
407
+ },
408
+ }
@@ -43,7 +43,7 @@ class BaseTryNodeDisplay(BaseAdornmentNodeDisplay[_TryNodeType], Generic[_TryNod
43
43
 
44
44
  adornment: JsonObject = {
45
45
  "id": str(node_id),
46
- "label": node.__qualname__,
46
+ "label": self.label,
47
47
  "base": self.get_base().dict(),
48
48
  "attributes": attributes,
49
49
  }
@@ -47,7 +47,7 @@ def test_serialize_node__retry(serialize_node):
47
47
  assert not DeepDiff(
48
48
  {
49
49
  "id": "188b50aa-e518-4b7b-a5e0-e2585fb1d7b5",
50
- "label": "test_serialize_node__retry.<locals>.InnerRetryGenericNode",
50
+ "label": "Inner Retry Generic Node",
51
51
  "type": "GENERIC",
52
52
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
53
53
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -68,7 +68,7 @@ def test_serialize_node__retry(serialize_node):
68
68
  "adornments": [
69
69
  {
70
70
  "id": "5be7d260-74f7-4734-b31b-a46a94539586",
71
- "label": "RetryNode",
71
+ "label": "Retry Node",
72
72
  "base": {
73
73
  "name": "RetryNode",
74
74
  "module": ["vellum", "workflows", "nodes", "core", "retry_node", "node"],
@@ -154,7 +154,7 @@ def test_serialize_node__try(serialize_node):
154
154
  assert not DeepDiff(
155
155
  {
156
156
  "id": str(InnerTryGenericNode.__wrapped_node__.__id__),
157
- "label": "test_serialize_node__try.<locals>.InnerTryGenericNode",
157
+ "label": "Inner Try Generic Node",
158
158
  "type": "GENERIC",
159
159
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
160
160
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -175,7 +175,7 @@ def test_serialize_node__try(serialize_node):
175
175
  "adornments": [
176
176
  {
177
177
  "id": "3344083c-a32c-4a32-920b-0fb5093448fa",
178
- "label": "TryNode",
178
+ "label": "Try Node",
179
179
  "base": {
180
180
  "name": "TryNode",
181
181
  "module": ["vellum", "workflows", "nodes", "core", "try_node", "node"],
@@ -248,7 +248,7 @@ def test_serialize_node__stacked():
248
248
  assert not DeepDiff(
249
249
  {
250
250
  "id": "074833b0-e142-4bbc-8dec-209a35e178a3",
251
- "label": "test_serialize_node__stacked.<locals>.InnerStackedGenericNode",
251
+ "label": "Inner Stacked Generic Node",
252
252
  "type": "GENERIC",
253
253
  "display_data": {"position": {"x": 200.0, "y": -50.0}},
254
254
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -272,7 +272,7 @@ def test_serialize_node__stacked():
272
272
  "adornments": [
273
273
  {
274
274
  "id": "3344083c-a32c-4a32-920b-0fb5093448fa",
275
- "label": "TryNode",
275
+ "label": "Try Node",
276
276
  "base": {
277
277
  "name": "TryNode",
278
278
  "module": ["vellum", "workflows", "nodes", "core", "try_node", "node"],
@@ -287,7 +287,7 @@ def test_serialize_node__stacked():
287
287
  },
288
288
  {
289
289
  "id": "5be7d260-74f7-4734-b31b-a46a94539586",
290
- "label": "RetryNode",
290
+ "label": "Retry Node",
291
291
  "base": {
292
292
  "name": "RetryNode",
293
293
  "module": ["vellum", "workflows", "nodes", "core", "retry_node", "node"],
@@ -351,5 +351,5 @@ def test_serialize_node__adornment_order_matches_decorator_order():
351
351
 
352
352
  adornments = cast(List[Dict[str, Any]], my_node["adornments"])
353
353
  assert len(adornments) == 2
354
- assert adornments[0]["label"] == "TryNode"
355
- assert adornments[1]["label"] == "RetryNode"
354
+ assert adornments[0]["label"] == "Try Node"
355
+ assert adornments[1]["label"] == "Retry Node"
@@ -34,7 +34,7 @@ def test_serialize_node__constant_value(serialize_node):
34
34
  assert not DeepDiff(
35
35
  {
36
36
  "id": "67e07859-7f67-4287-9854-06ab4199e576",
37
- "label": "test_serialize_node__constant_value.<locals>.ConstantValueGenericNode",
37
+ "label": "Constant Value Generic Node",
38
38
  "type": "GENERIC",
39
39
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
40
40
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -104,7 +104,7 @@ def test_serialize_node__constant_value_reference(serialize_node):
104
104
  assert not DeepDiff(
105
105
  {
106
106
  "id": "73643f17-e49e-47d2-bd01-bb9c3eab6ae9",
107
- "label": "test_serialize_node__constant_value_reference.<locals>.ConstantValueReferenceGenericNode",
107
+ "label": "Constant Value Reference Generic Node",
108
108
  "type": "GENERIC",
109
109
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
110
110
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -146,7 +146,7 @@ def test_serialize_node__lazy_reference(serialize_node):
146
146
  assert not DeepDiff(
147
147
  {
148
148
  "id": "3d6bfe3b-263a-40a6-8a05-98288e9559a4",
149
- "label": "test_serialize_node__lazy_reference.<locals>.LazyReferenceGenericNode",
149
+ "label": "Lazy Reference Generic Node",
150
150
  "type": "GENERIC",
151
151
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
152
152
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -229,7 +229,7 @@ def test_serialize_node__workflow_input(serialize_node):
229
229
  assert not DeepDiff(
230
230
  {
231
231
  "id": "30116483-6f38-40e0-baf2-32de0e14e9a3",
232
- "label": "test_serialize_node__workflow_input.<locals>.WorkflowInputGenericNode",
232
+ "label": "Workflow Input Generic Node",
233
233
  "type": "GENERIC",
234
234
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
235
235
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -292,7 +292,7 @@ def test_serialize_node__workflow_input_as_nested_chat_history():
292
292
  assert not DeepDiff(
293
293
  {
294
294
  "id": "11be9d37-0069-4695-a317-14a3b6519d4e",
295
- "label": "test_serialize_node__workflow_input_as_nested_chat_history.<locals>.GenericNode",
295
+ "label": "Generic Node",
296
296
  "type": "GENERIC",
297
297
  "display_data": {"position": {"x": 200.0, "y": -50.0}},
298
298
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -362,7 +362,7 @@ def test_serialize_node__node_output(serialize_node):
362
362
  assert not DeepDiff(
363
363
  {
364
364
  "id": "7210742f-8c3e-4379-9800-8b4b7f5dd7ed",
365
- "label": "test_serialize_node__node_output.<locals>.GenericNodeReferencingOutput",
365
+ "label": "Generic Node Referencing Output",
366
366
  "type": "GENERIC",
367
367
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
368
368
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -412,7 +412,7 @@ def test_serialize_node__vellum_secret(serialize_node):
412
412
  assert not DeepDiff(
413
413
  {
414
414
  "id": "0e75bd8f-882e-4ab7-8348-061319b574f7",
415
- "label": "test_serialize_node__vellum_secret.<locals>.VellumSecretGenericNode",
415
+ "label": "Vellum Secret Generic Node",
416
416
  "type": "GENERIC",
417
417
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
418
418
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -465,7 +465,7 @@ def test_serialize_node__node_execution(serialize_node):
465
465
  assert not DeepDiff(
466
466
  {
467
467
  "id": "f42dda6b-e856-49bd-b203-46c9dd66c08b",
468
- "label": "test_serialize_node__node_execution.<locals>.GenericNodeReferencingExecutions",
468
+ "label": "Generic Node Referencing Executions",
469
469
  "type": "GENERIC",
470
470
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
471
471
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -561,7 +561,7 @@ def test_serialize_node__coalesce(serialize_node):
561
561
  assert not DeepDiff(
562
562
  {
563
563
  "id": "bb99f326-7d2a-4b5e-95f3-6039114798da",
564
- "label": "test_serialize_node__coalesce.<locals>.CoalesceNodeFinal",
564
+ "label": "Coalesce Node Final",
565
565
  "type": "GENERIC",
566
566
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
567
567
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -23,7 +23,7 @@ def test_serialize_node__annotated_output(serialize_node):
23
23
  assert not DeepDiff(
24
24
  {
25
25
  "id": "e33ddf79-f48c-4057-ba17-d41a3a60ac98",
26
- "label": "test_serialize_node__annotated_output.<locals>.AnnotatedOutputGenericNode",
26
+ "label": "Annotated Output Generic Node",
27
27
  "type": "GENERIC",
28
28
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
29
29
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -71,7 +71,7 @@ def test_serialize_node__workflow_input(serialize_node):
71
71
  assert not DeepDiff(
72
72
  {
73
73
  "id": "30116483-6f38-40e0-baf2-32de0e14e9a3",
74
- "label": "test_serialize_node__workflow_input.<locals>.WorkflowInputGenericNode",
74
+ "label": "Workflow Input Generic Node",
75
75
  "type": "GENERIC",
76
76
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
77
77
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -134,7 +134,7 @@ def test_serialize_node__node_output_reference(serialize_node):
134
134
  assert not DeepDiff(
135
135
  {
136
136
  "id": "ac067acc-6a6f-44b1-ae84-428e965ce691",
137
- "label": "test_serialize_node__node_output_reference.<locals>.GenericNodeReferencingOutput",
137
+ "label": "Generic Node Referencing Output",
138
138
  "type": "GENERIC",
139
139
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
140
140
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -20,11 +20,10 @@ def test_serialize_node__basic(serialize_node):
20
20
  pass
21
21
 
22
22
  serialized_node = serialize_node(BasicGenericNode)
23
-
24
23
  assert not DeepDiff(
25
24
  {
26
25
  "id": "8d7cbfe4-72ca-4367-a401-8d28723d2f00",
27
- "label": "test_serialize_node__basic.<locals>.BasicGenericNode",
26
+ "label": "Basic Generic Node",
28
27
  "type": "GENERIC",
29
28
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
30
29
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -70,7 +69,7 @@ def test_serialize_node__if(serialize_node):
70
69
  assert not DeepDiff(
71
70
  {
72
71
  "id": "bba4b15a-dea0-48c9-a79b-4e12e99db00f",
73
- "label": "test_serialize_node__if.<locals>.IfGenericNode",
72
+ "label": "If Generic Node",
74
73
  "type": "GENERIC",
75
74
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
76
75
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -132,7 +131,7 @@ def test_serialize_node__if_else(serialize_node):
132
131
  assert not DeepDiff(
133
132
  {
134
133
  "id": "25c9c3f1-4014-47ac-90cf-5216de10d05c",
135
- "label": "test_serialize_node__if_else.<locals>.IfElseGenericNode",
134
+ "label": "If Else Generic Node",
136
135
  "type": "GENERIC",
137
136
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
138
137
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -201,7 +200,7 @@ def test_serialize_node__if_elif_else(serialize_node):
201
200
  assert not DeepDiff(
202
201
  {
203
202
  "id": "7b2b9cfc-12aa-432c-940d-cbe53e71de9c",
204
- "label": "test_serialize_node__if_elif_else.<locals>.IfElifElseGenericNode",
203
+ "label": "If Elif Else Generic Node",
205
204
  "type": "GENERIC",
206
205
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
207
206
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -300,7 +299,7 @@ def test_serialize_node__node_output_reference(serialize_node):
300
299
  assert not DeepDiff(
301
300
  {
302
301
  "id": "ac067acc-6a6f-44b1-ae84-428e965ce691",
303
- "label": "test_serialize_node__node_output_reference.<locals>.GenericNodeReferencingOutput",
302
+ "label": "Generic Node Referencing Output",
304
303
  "type": "GENERIC",
305
304
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
306
305
  "definition": {
@@ -363,7 +362,7 @@ def test_serialize_node__vellum_secret_reference(serialize_node):
363
362
  assert not DeepDiff(
364
363
  {
365
364
  "id": "feb4b331-e25f-4a5c-9840-c5575b1efd5c",
366
- "label": "test_serialize_node__vellum_secret_reference.<locals>.GenericNodeReferencingSecret",
365
+ "label": "Generic Node Referencing Secret",
367
366
  "type": "GENERIC",
368
367
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
369
368
  "definition": {
@@ -429,7 +428,7 @@ def test_serialize_node__execution_count_reference(serialize_node):
429
428
  assert not DeepDiff(
430
429
  {
431
430
  "id": "0b4fe8a6-6d0c-464e-9372-10110e2b0e13",
432
- "label": "test_serialize_node__execution_count_reference.<locals>.GenericNodeReferencingExecutions",
431
+ "label": "Generic Node Referencing Executions",
433
432
  "type": "GENERIC",
434
433
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
435
434
  "definition": {
@@ -490,7 +489,7 @@ def test_serialize_node__null(serialize_node):
490
489
  assert not DeepDiff(
491
490
  {
492
491
  "id": "1838ce1f-9c07-4fd0-9fd4-2a3a841ea402",
493
- "label": "test_serialize_node__null.<locals>.NullGenericNode",
492
+ "label": "Null Generic Node",
494
493
  "type": "GENERIC",
495
494
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
496
495
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -548,7 +547,7 @@ def test_serialize_node__between(serialize_node):
548
547
  assert not DeepDiff(
549
548
  {
550
549
  "id": "f2f5a1f2-a12d-4ce0-bfe9-42190ffe5328",
551
- "label": "test_serialize_node__between.<locals>.BetweenGenericNode",
550
+ "label": "Between Generic Node",
552
551
  "type": "GENERIC",
553
552
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
554
553
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -617,7 +616,7 @@ def test_serialize_node__or(serialize_node):
617
616
  assert not DeepDiff(
618
617
  {
619
618
  "id": "5386abad-3378-4378-b3a8-831b4b77dc23",
620
- "label": "test_serialize_node__or.<locals>.OrGenericNode",
619
+ "label": "Or Generic Node",
621
620
  "type": "GENERIC",
622
621
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
623
622
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -700,7 +699,7 @@ def test_serialize_node__and_then_or(serialize_node):
700
699
  assert not DeepDiff(
701
700
  {
702
701
  "id": "4d3995b1-437b-48d9-8878-9f57a8b725f1",
703
- "label": "test_serialize_node__and_then_or.<locals>.AndThenOrGenericNode",
702
+ "label": "And Then Or Generic Node",
704
703
  "type": "GENERIC",
705
704
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
706
705
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -802,7 +801,7 @@ def test_serialize_node__parenthesized_and_then_or(serialize_node):
802
801
  assert not DeepDiff(
803
802
  {
804
803
  "id": "223864c9-0088-4c05-9b7d-e5b1c9ec936d",
805
- "label": "test_serialize_node__parenthesized_and_then_or.<locals>.ParenthesizedAndThenOrGenericNode",
804
+ "label": "Parenthesized And Then Or Generic Node",
806
805
  "type": "GENERIC",
807
806
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
808
807
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -904,7 +903,7 @@ def test_serialize_node__or_then_and(serialize_node):
904
903
  assert not DeepDiff(
905
904
  {
906
905
  "id": "a946342e-4ede-4e96-8e3d-f396748d9f7c",
907
- "label": "test_serialize_node__or_then_and.<locals>.OrThenAndGenericNode",
906
+ "label": "Or Then And Generic Node",
908
907
  "type": "GENERIC",
909
908
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
910
909
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -1005,7 +1004,7 @@ def test_serialize_node__parse_json(serialize_node):
1005
1004
  assert not DeepDiff(
1006
1005
  {
1007
1006
  "id": "bfc3f81b-242a-4f43-9e1c-648223d77768",
1008
- "label": "test_serialize_node__parse_json.<locals>.ParseJsonGenericNode",
1007
+ "label": "Parse Json Generic Node",
1009
1008
  "type": "GENERIC",
1010
1009
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
1011
1010
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -2,7 +2,11 @@ from deepdiff import DeepDiff
2
2
 
3
3
  from vellum.workflows.inputs.base import BaseInputs
4
4
  from vellum.workflows.nodes.bases.base import BaseNode
5
+ from vellum.workflows.nodes.displayable.inline_prompt_node.node import InlinePromptNode
6
+ from vellum.workflows.state.base import BaseState
5
7
  from vellum.workflows.types.core import MergeBehavior
8
+ from vellum.workflows.workflows.base import BaseWorkflow
9
+ from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
6
10
 
7
11
 
8
12
  class Inputs(BaseInputs):
@@ -17,7 +21,7 @@ def test_serialize_node__basic(serialize_node):
17
21
  assert not DeepDiff(
18
22
  {
19
23
  "id": "8d7cbfe4-72ca-4367-a401-8d28723d2f00",
20
- "label": "test_serialize_node__basic.<locals>.BasicGenericNode",
24
+ "label": "Basic Generic Node",
21
25
  "type": "GENERIC",
22
26
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
23
27
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -59,7 +63,7 @@ def test_serialize_node__await_any(serialize_node):
59
63
  assert not DeepDiff(
60
64
  {
61
65
  "id": "42e17f0e-8496-415f-9c72-f85250ba6f0b",
62
- "label": "test_serialize_node__await_any.<locals>.AwaitAnyGenericNode",
66
+ "label": "Await Any Generic Node",
63
67
  "type": "GENERIC",
64
68
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
65
69
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -101,7 +105,7 @@ def test_serialize_node__await_all(serialize_node):
101
105
  assert not DeepDiff(
102
106
  {
103
107
  "id": "b3e1145a-5f41-456b-9382-6d0a1e828c2f",
104
- "label": "test_serialize_node__await_all.<locals>.AwaitAllGenericNode",
108
+ "label": "Await All Generic Node",
105
109
  "type": "GENERIC",
106
110
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
107
111
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -132,3 +136,54 @@ def test_serialize_node__await_all(serialize_node):
132
136
  serialized_node,
133
137
  ignore_order=True,
134
138
  )
139
+
140
+
141
+ def test_serialize_node__inline_prompt_await_all():
142
+ """
143
+ Tests that InlinePromptNode with AWAIT_ALL merge behavior can be defined and serializes without errors.
144
+ """
145
+
146
+ # GIVEN an InlinePromptNode with AWAIT_ALL merge behavior
147
+ class AwaitAllInlinePromptNode(InlinePromptNode):
148
+ ml_model = "gpt-4o"
149
+ blocks = []
150
+
151
+ class Trigger(InlinePromptNode.Trigger):
152
+ merge_behavior = MergeBehavior.AWAIT_ALL
153
+
154
+ class TestWorkflow(BaseWorkflow[Inputs, BaseState]):
155
+ graph = AwaitAllInlinePromptNode
156
+
157
+ # WHEN we serialize the workflow containing the node
158
+ workflow_display = get_workflow_display(workflow_class=TestWorkflow)
159
+ serialized = workflow_display.serialize()
160
+
161
+ # THEN the workflow should serialize successfully
162
+ assert "workflow_raw_data" in serialized # type: ignore
163
+ assert "nodes" in serialized["workflow_raw_data"] # type: ignore
164
+
165
+ # AND the workflow should contain the InlinePromptNode
166
+ nodes = serialized["workflow_raw_data"]["nodes"] # type: ignore
167
+ prompt_nodes = [node for node in nodes if node["type"] == "PROMPT"] # type: ignore
168
+ assert len(prompt_nodes) == 1
169
+
170
+ prompt_node = prompt_nodes[0]
171
+
172
+ # AND the node should have the correct type and base
173
+ assert prompt_node["type"] == "PROMPT" # type: ignore
174
+ assert prompt_node["base"]["name"] == "InlinePromptNode" # type: ignore
175
+ assert prompt_node["base"]["module"] == [ # type: ignore
176
+ "vellum",
177
+ "workflows",
178
+ "nodes",
179
+ "displayable",
180
+ "inline_prompt_node",
181
+ "node",
182
+ ]
183
+
184
+ # AND the node should have the expected structure (InlinePromptNode doesn't serialize trigger info)
185
+ assert "data" in prompt_node # type: ignore
186
+ assert "ml_model_name" in prompt_node["data"] # type: ignore
187
+ assert prompt_node["data"]["ml_model_name"] == "gpt-4o" # type: ignore
188
+
189
+ assert prompt_node["trigger"]["merge_behavior"] == "AWAIT_ALL" # type: ignore
@@ -591,7 +591,7 @@ def test_serialize_workflow__try_wrapped():
591
591
  "adornments": [
592
592
  {
593
593
  "id": "3344083c-a32c-4a32-920b-0fb5093448fa",
594
- "label": "TryNode",
594
+ "label": "Try Node",
595
595
  "base": {"name": "TryNode", "module": ["vellum", "workflows", "nodes", "core", "try_node", "node"]},
596
596
  "attributes": [
597
597
  {
@@ -165,6 +165,10 @@ def test_serialize_workflow():
165
165
  "name": "ExampleBaseInlinePromptNodeWithFunctions",
166
166
  "module": ["tests", "workflows", "basic_inline_prompt_node_with_functions", "workflow"],
167
167
  },
168
+ "trigger": {
169
+ "id": "c2dccecb-8a41-40a8-95af-325d3ab8bfe5",
170
+ "merge_behavior": "AWAIT_ANY",
171
+ },
168
172
  "outputs": [
169
173
  {"id": "9557bd86-702d-4b45-b8c1-c3980bffe28f", "name": "json", "type": "JSON", "value": None},
170
174
  {"id": "ead0ccb5-092f-4d9b-a9ec-5eb83d498188", "name": "text", "type": "STRING", "value": None},
@@ -129,7 +129,7 @@ def test_serialize_workflow():
129
129
  },
130
130
  {
131
131
  "id": "1381c078-efa2-4255-89a1-7b4cb742c7fc",
132
- "label": "StartNode",
132
+ "label": "Start Node",
133
133
  "type": "GENERIC",
134
134
  "display_data": {"position": {"x": 200.0, "y": -50.0}},
135
135
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
@@ -40,7 +40,7 @@ def test_serialize_workflow():
40
40
  tool_calling_node = workflow_raw_data["nodes"][1]
41
41
  assert tool_calling_node == {
42
42
  "id": "21f29cac-da87-495f-bba1-093d423f4e46",
43
- "label": "GetCurrentWeatherNode",
43
+ "label": "Get Current Weather Node",
44
44
  "type": "GENERIC",
45
45
  "display_data": {
46
46
  "position": {"x": 200.0, "y": -50.0},
@@ -153,7 +153,7 @@ def test_serialize_workflow():
153
153
  },
154
154
  {
155
155
  "id": "1381c078-efa2-4255-89a1-7b4cb742c7fc",
156
- "label": "StartNode",
156
+ "label": "Start Node",
157
157
  "type": "GENERIC",
158
158
  "display_data": {"position": {"x": 200.0, "y": -50.0}},
159
159
  "base": {
@@ -40,7 +40,7 @@ def test_serialize_workflow():
40
40
  tool_calling_node = workflow_raw_data["nodes"][1]
41
41
  assert tool_calling_node == {
42
42
  "id": "21f29cac-da87-495f-bba1-093d423f4e46",
43
- "label": "GetCurrentWeatherNode",
43
+ "label": "Get Current Weather Node",
44
44
  "type": "GENERIC",
45
45
  "display_data": {
46
46
  "position": {"x": 200.0, "y": -50.0},
@@ -349,7 +349,11 @@ def serialize_value(display_context: "WorkflowDisplayContext", value: Any) -> Js
349
349
  if is_workflow_class(value):
350
350
  from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
351
351
 
352
- workflow_display = get_workflow_display(workflow_class=value)
352
+ # Pass the parent display context so the subworkflow can resolve parent workflow inputs
353
+ workflow_display = get_workflow_display(
354
+ workflow_class=value,
355
+ parent_display_context=display_context,
356
+ )
353
357
  serialized_value: dict = workflow_display.serialize()
354
358
  name = serialized_value["workflow_raw_data"]["definition"]["name"]
355
359
  description = value.__doc__ or ""
@@ -3,6 +3,7 @@ import fnmatch
3
3
  from functools import cached_property
4
4
  import importlib
5
5
  import inspect
6
+ import json
6
7
  import logging
7
8
  import os
8
9
  from uuid import UUID
@@ -15,12 +16,14 @@ from vellum.workflows.constants import undefined
15
16
  from vellum.workflows.descriptors.base import BaseDescriptor
16
17
  from vellum.workflows.edges import Edge
17
18
  from vellum.workflows.events.workflow import NodeEventDisplayContext, WorkflowEventDisplayContext
19
+ from vellum.workflows.inputs.base import BaseInputs
18
20
  from vellum.workflows.nodes.bases import BaseNode
19
21
  from vellum.workflows.nodes.displayable.bases.utils import primitive_to_vellum_value
20
22
  from vellum.workflows.nodes.displayable.final_output_node.node import FinalOutputNode
21
23
  from vellum.workflows.nodes.utils import get_unadorned_node, get_unadorned_port, get_wrapped_node
22
24
  from vellum.workflows.ports import Port
23
25
  from vellum.workflows.references import OutputReference, WorkflowInputReference
26
+ from vellum.workflows.state.encoder import DefaultStateEncoder
24
27
  from vellum.workflows.types.core import Json, JsonArray, JsonObject
25
28
  from vellum.workflows.types.generics import WorkflowType
26
29
  from vellum.workflows.types.utils import get_original_base
@@ -72,6 +75,7 @@ IGNORE_PATTERNS = [
72
75
  class WorkflowSerializationResult(UniversalBaseModel):
73
76
  exec_config: Dict[str, Any]
74
77
  errors: List[str]
78
+ dataset: Optional[List[Dict[str, Any]]] = None
75
79
 
76
80
 
77
81
  class BaseWorkflowDisplay(Generic[WorkflowType]):
@@ -892,9 +896,25 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
892
896
  if additional_files:
893
897
  exec_config["module_data"] = {"additional_files": cast(JsonObject, additional_files)}
894
898
 
899
+ dataset = None
900
+ try:
901
+ sandbox_module_path = f"{module}.sandbox"
902
+ sandbox_module = importlib.import_module(sandbox_module_path)
903
+ if hasattr(sandbox_module, "dataset"):
904
+ dataset_attr = getattr(sandbox_module, "dataset")
905
+ if dataset_attr and isinstance(dataset_attr, list):
906
+ dataset = []
907
+ for i, inputs_obj in enumerate(dataset_attr):
908
+ if isinstance(inputs_obj, BaseInputs):
909
+ serialized_inputs = json.loads(json.dumps(inputs_obj, cls=DefaultStateEncoder))
910
+ dataset.append({"label": f"Scenario {i + 1}", "inputs": serialized_inputs})
911
+ except (ImportError, AttributeError):
912
+ pass
913
+
895
914
  return WorkflowSerializationResult(
896
915
  exec_config=exec_config,
897
916
  errors=[str(error) for error in workflow_display.display_context.errors],
917
+ dataset=dataset,
898
918
  )
899
919
 
900
920
  def _gather_additional_module_files(self, module_path: str) -> Dict[str, str]:
@@ -1,6 +1,37 @@
1
1
  from vellum_ee.workflows.display.workflows.base_workflow_display import BaseWorkflowDisplay
2
2
 
3
3
 
4
+ def test_serialize_module_with_dataset():
5
+ """Test that serialize_module correctly serializes dataset from sandbox modules."""
6
+ module_path = "tests.workflows.basic_inputs_and_outputs"
7
+
8
+ result = BaseWorkflowDisplay.serialize_module(module_path)
9
+
10
+ assert hasattr(result, "dataset")
11
+
12
+ assert result.dataset is None
13
+
14
+
15
+ def test_serialize_module_with_actual_dataset():
16
+ """Test that serialize_module correctly serializes dataset when sandbox has dataset attribute."""
17
+ module_path = "tests.workflows.test_dataset_serialization"
18
+
19
+ result = BaseWorkflowDisplay.serialize_module(module_path)
20
+
21
+ assert hasattr(result, "dataset")
22
+
23
+ assert result.dataset is not None
24
+ assert isinstance(result.dataset, list)
25
+ assert len(result.dataset) == 2
26
+
27
+ for i, item in enumerate(result.dataset):
28
+ assert "label" in item
29
+ assert "inputs" in item
30
+ assert item["label"] == f"Scenario {i + 1}"
31
+ assert isinstance(item["inputs"], dict)
32
+ assert "message" in item["inputs"]
33
+
34
+
4
35
  def test_serialize_module_happy_path():
5
36
  """Test that serialize_module works with a valid module path."""
6
37
  module_path = "tests.workflows.trivial"