vellum-ai 0.11.4__py3-none-any.whl → 0.11.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/client/core/client_wrapper.py +1 -1
- vellum/workflows/events/types.py +8 -0
- vellum/workflows/nodes/bases/base.py +1 -1
- vellum/workflows/nodes/core/try_node/node.py +1 -0
- vellum/workflows/nodes/displayable/code_execution_node/node.py +3 -1
- vellum/workflows/nodes/displayable/code_execution_node/utils.py +8 -18
- vellum/workflows/ports/port.py +8 -0
- vellum/workflows/runner/runner.py +1 -1
- {vellum_ai-0.11.4.dist-info → vellum_ai-0.11.6.dist-info}/METADATA +1 -1
- {vellum_ai-0.11.4.dist-info → vellum_ai-0.11.6.dist-info}/RECORD +18 -18
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +3 -1
- vellum_ee/workflows/display/nodes/vellum/error_node.py +0 -1
- vellum_ee/workflows/display/nodes/vellum/search_node.py +20 -17
- vellum_ee/workflows/display/nodes/vellum/utils.py +16 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +0 -1
- {vellum_ai-0.11.4.dist-info → vellum_ai-0.11.6.dist-info}/LICENSE +0 -0
- {vellum_ai-0.11.4.dist-info → vellum_ai-0.11.6.dist-info}/WHEEL +0 -0
- {vellum_ai-0.11.4.dist-info → vellum_ai-0.11.6.dist-info}/entry_points.txt +0 -0
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
18
18
|
"X-Fern-Language": "Python",
|
19
19
|
"X-Fern-SDK-Name": "vellum-ai",
|
20
|
-
"X-Fern-SDK-Version": "0.11.
|
20
|
+
"X-Fern-SDK-Version": "0.11.6",
|
21
21
|
}
|
22
22
|
headers["X_API_KEY"] = self.api_key
|
23
23
|
return headers
|
vellum/workflows/events/types.py
CHANGED
@@ -87,6 +87,13 @@ class WorkflowParentContext(BaseParentContext):
|
|
87
87
|
workflow_definition: VellumCodeResourceDefinition
|
88
88
|
|
89
89
|
|
90
|
+
class WorkflowSandboxParentContext(BaseParentContext):
|
91
|
+
type: Literal["WORKFLOW_SANDBOX"] = "WORKFLOW_SANDBOX"
|
92
|
+
sandbox_id: UUID
|
93
|
+
sandbox_history_item_id: UUID
|
94
|
+
scenario_id: UUID
|
95
|
+
|
96
|
+
|
90
97
|
# Define the discriminated union
|
91
98
|
ParentContext = Annotated[
|
92
99
|
Union[
|
@@ -94,6 +101,7 @@ ParentContext = Annotated[
|
|
94
101
|
NodeParentContext,
|
95
102
|
WorkflowDeploymentParentContext,
|
96
103
|
PromptDeploymentParentContext,
|
104
|
+
WorkflowSandboxParentContext,
|
97
105
|
],
|
98
106
|
Field(discriminator="type"),
|
99
107
|
]
|
@@ -160,6 +160,7 @@ Message: {event.error.message}""",
|
|
160
160
|
"__module__": dynamic_module,
|
161
161
|
"on_error_code": _on_error_code,
|
162
162
|
"subworkflow": Subworkflow,
|
163
|
+
"Ports": type("Ports", (TryNode.Ports,), {port.name: port.copy() for port in inner_cls.Ports}),
|
163
164
|
},
|
164
165
|
)
|
165
166
|
return WrappedNode
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import inspect
|
1
2
|
from typing import Any, ClassVar, Dict, Generic, List, Optional, Sequence, Tuple, Type, TypeVar, cast, get_args
|
2
3
|
|
3
4
|
from vellum import (
|
@@ -189,7 +190,8 @@ class CodeExecutionNode(BaseNode[StateType], Generic[StateType, _OutputType], me
|
|
189
190
|
return compiled_inputs
|
190
191
|
|
191
192
|
def _resolve_code(self) -> str:
|
192
|
-
|
193
|
+
root = inspect.getfile(self.__class__)
|
194
|
+
code = read_file_from_path(node_filepath=root, script_filepath=self.filepath)
|
193
195
|
if not code:
|
194
196
|
raise NodeException(
|
195
197
|
message=f"Filepath '{self.filepath}' does not exist",
|
@@ -2,21 +2,11 @@ import os
|
|
2
2
|
from typing import Union
|
3
3
|
|
4
4
|
|
5
|
-
def
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def read_file_from_path(filepath: str) -> Union[str, None]:
|
15
|
-
project_root = get_project_root()
|
16
|
-
relative_filepath = os.path.join(project_root, filepath)
|
17
|
-
|
18
|
-
if not os.path.exists(relative_filepath):
|
19
|
-
return None
|
20
|
-
|
21
|
-
with open(relative_filepath) as file:
|
22
|
-
return file.read()
|
5
|
+
def read_file_from_path(node_filepath: str, script_filepath: str) -> Union[str, None]:
|
6
|
+
node_filepath_dir = os.path.dirname(node_filepath)
|
7
|
+
full_filepath = os.path.join(node_filepath_dir, script_filepath)
|
8
|
+
|
9
|
+
if os.path.isfile(full_filepath):
|
10
|
+
with open(full_filepath) as file:
|
11
|
+
return file.read()
|
12
|
+
return None
|
vellum/workflows/ports/port.py
CHANGED
@@ -40,6 +40,14 @@ class Port:
|
|
40
40
|
def __repr__(self) -> str:
|
41
41
|
return f"{self.node_class}.Ports.{self.name}"
|
42
42
|
|
43
|
+
def copy(self) -> "Port":
|
44
|
+
return Port(
|
45
|
+
default=self.default,
|
46
|
+
fork_state=self._fork_state,
|
47
|
+
condition=self._condition,
|
48
|
+
condition_type=self._condition_type,
|
49
|
+
)
|
50
|
+
|
43
51
|
@property
|
44
52
|
def fork_state(self) -> bool:
|
45
53
|
return self._fork_state
|
@@ -264,7 +264,6 @@ class WorkflowRunner(Generic[StateType]):
|
|
264
264
|
)
|
265
265
|
)
|
266
266
|
|
267
|
-
invoked_ports = ports(outputs, node.state)
|
268
267
|
node.state.meta.node_execution_cache.fulfill_node_execution(node.__class__, span_id)
|
269
268
|
|
270
269
|
for descriptor, output_value in outputs:
|
@@ -275,6 +274,7 @@ class WorkflowRunner(Generic[StateType]):
|
|
275
274
|
|
276
275
|
node.state.meta.node_outputs[descriptor] = output_value
|
277
276
|
|
277
|
+
invoked_ports = ports(outputs, node.state)
|
278
278
|
self._workflow_event_inner_queue.put(
|
279
279
|
NodeExecutionFulfilledEvent(
|
280
280
|
trace_id=node.state.meta.trace_id,
|
@@ -28,9 +28,9 @@ vellum_ee/workflows/display/nodes/types.py,sha256=St1BB6no528OyELGiyRabWao0GGw6m
|
|
28
28
|
vellum_ee/workflows/display/nodes/utils.py,sha256=sloya5TpXsnot1HURc9L51INwflRqUzHxRVnCS9Cd-4,973
|
29
29
|
vellum_ee/workflows/display/nodes/vellum/__init__.py,sha256=nmPLj8vkbVCS46XQqmHq8Xj8Mr36wCK_vWf26A9KIkw,1505
|
30
30
|
vellum_ee/workflows/display/nodes/vellum/api_node.py,sha256=4SSQGecKWHuoGy5YIGJeOZVHGKwTs_8Y-gf3GvsHb0M,8506
|
31
|
-
vellum_ee/workflows/display/nodes/vellum/code_execution_node.py,sha256=
|
31
|
+
vellum_ee/workflows/display/nodes/vellum/code_execution_node.py,sha256=HzB4zQ6MYlRII9GsZcBPzOswFUuwBjn-b3FuDLNyujg,4025
|
32
32
|
vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=gUbSP8_oSAMNIb0CGiefd2FMYgoO6wMoG6iA1FakMjk,13293
|
33
|
-
vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=
|
33
|
+
vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=ygTjSjYDI4DtkxADWub5rhBnRWItMKWF6fezBrgpOKA,1979
|
34
34
|
vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=UezalObmZ3mcg7Nou2RgiI_0cmc7_tSdZLNB591iCcI,2772
|
35
35
|
vellum_ee/workflows/display/nodes/vellum/guardrail_node.py,sha256=3TJvHX_Uuf_gr94VkYc_zmNH8I5p71ChIeoAbJZ3ddY,2158
|
36
36
|
vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py,sha256=sj-pySLVYGt032debhcQhHc5JwrALQrNCEKh3DXc8F8,7386
|
@@ -39,20 +39,20 @@ vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=AqUlItgSZij12qRKguKV
|
|
39
39
|
vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=BM3nfL0-D8x91xW0MGhnJFo45ZgGLXDqdbiSGoSuXN0,3244
|
40
40
|
vellum_ee/workflows/display/nodes/vellum/note_node.py,sha256=9VpC3h0RYOxJuRbjDwidBYlLKakkmlEnDMBh2C7lHcY,1107
|
41
41
|
vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py,sha256=gLRkizwyw21-Z12IyDbdOJpXayiZZd4HWd6qgZQg8sc,3106
|
42
|
-
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=
|
42
|
+
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=BQEqi6_65h7PmP-FhBF0zUB3MBLA65DkZLU9IdS3iyA,8668
|
43
43
|
vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py,sha256=zOp4voBSgB3MR1R93wTOrsiiara_hxEAYFupLl_SvTA,2657
|
44
44
|
vellum_ee/workflows/display/nodes/vellum/templating_node.py,sha256=UNYxoE-89agE8ugK0aWg_uN61jPqlC2VSxWHk568sN4,3324
|
45
45
|
vellum_ee/workflows/display/nodes/vellum/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
46
|
vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py,sha256=ZUp2fmDF4JTni1NjJOIV8dJoxx22eMBskmBJFsjtEvE,3809
|
47
47
|
vellum_ee/workflows/display/nodes/vellum/try_node.py,sha256=m4d6hi6oD-jSW_bjrlN8coVwb6ivC2amPHpePHJ-Htg,2278
|
48
|
-
vellum_ee/workflows/display/nodes/vellum/utils.py,sha256=
|
48
|
+
vellum_ee/workflows/display/nodes/vellum/utils.py,sha256=golxvSM6HIZ4uYKbfcI7muVJuckFZQcGFCAFvfx4Cls,4654
|
49
49
|
vellum_ee/workflows/display/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
vellum_ee/workflows/display/tests/test_vellum_workflow_display.py,sha256=TEg3QbdE7rLbEhml9pMWmay--phsekGlfGVhTblxCGE,1727
|
51
51
|
vellum_ee/workflows/display/tests/workflow_serialization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py,sha256=e__ae2yepB5vlgVT08sr1DDB8pYjax6VQLo5FtRk-nA,17934
|
53
53
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py,sha256=0McMPIPnIwE8iGh7fzFZL3dc6Q7NCQ_wUVFpl14YATo,22846
|
54
54
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py,sha256=d6xWDvi-Uo1KcMHVj_e8TujKhTwMKXAlT8H3P2V0gQU,53693
|
55
|
-
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py,sha256=
|
55
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py,sha256=MGwIwhCBCVYZmE_8Srts3fEs0BcRqXFFVbqiHiBQ55Q,6798
|
56
56
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py,sha256=vA8cd7PJYhf949OUGeYP_moKtMogSyfHN2Z-qzNQLwM,8294
|
57
57
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py,sha256=N2ACycHn-EwP5paxHwDu2fufABssE293wiunhm-bCGg,22076
|
58
58
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py,sha256=H1bVDG_mFPokJ7OYrnl9rM9M3gEa5bctGmhUuKccB4U,15950
|
@@ -78,7 +78,7 @@ vellum/client/README.md,sha256=JkCJjmMZl4jrPj46pkmL9dpK4gSzQQmP5I7z4aME4LY,4749
|
|
78
78
|
vellum/client/__init__.py,sha256=o4m7iRZWEV8rP3GkdaztHAjNmjxjWERlarviFoHzuKI,110927
|
79
79
|
vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
80
80
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
81
|
-
vellum/client/core/client_wrapper.py,sha256=
|
81
|
+
vellum/client/core/client_wrapper.py,sha256=xZCaeJ0zVTtxXqFRe54cEDIyxXqbJlQAZ5gQGXg4sSc,1890
|
82
82
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
83
83
|
vellum/client/core/file.py,sha256=X9IbmkZmB2bB_DpmZAO3crWdXagOakAyn6UCOCImCPg,2322
|
84
84
|
vellum/client/core/http_client.py,sha256=R0pQpCppnEtxccGvXl4uJ76s7ro_65Fo_erlNNLp_AI,19228
|
@@ -1220,7 +1220,7 @@ vellum/workflows/events/__init__.py,sha256=6pxxceJo2dcaRkWtkDAYlUQZ-PHBQSZytIoyu
|
|
1220
1220
|
vellum/workflows/events/node.py,sha256=3_NPVhXR-XMnNj5QVA_ycebs_-jRuGSLf5H7XjLQh8o,5258
|
1221
1221
|
vellum/workflows/events/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1222
1222
|
vellum/workflows/events/tests/test_event.py,sha256=IBP_fCT_kPDdSCdgDCo7eaG7MYUR6aF4EFxwFIr9lbA,12717
|
1223
|
-
vellum/workflows/events/types.py,sha256=
|
1223
|
+
vellum/workflows/events/types.py,sha256=7sBSMNstsibqq93Klu4A-GInzo4IB23xWel595Uyi_Y,3077
|
1224
1224
|
vellum/workflows/events/workflow.py,sha256=02UZE4sBpWrG2A3xddu8v0S9kPfo7YetX6xTvzKg-2w,5218
|
1225
1225
|
vellum/workflows/exceptions.py,sha256=Dc7mxstsaMDRmS91QEOiZCbZ1ZIRacnm0l5lQmC6WkA,401
|
1226
1226
|
vellum/workflows/expressions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1259,7 +1259,7 @@ vellum/workflows/inputs/base.py,sha256=1kMgr0WqCYdWUqgFvgSoAMw2067FAlgwhGXLgbIOr
|
|
1259
1259
|
vellum/workflows/logging.py,sha256=_a217XogktV4Ncz6xKFz7WfYmZAzkfVRVuC0rWob8ls,437
|
1260
1260
|
vellum/workflows/nodes/__init__.py,sha256=aVdQVv7Y3Ro3JlqXGpxwaU2zrI06plDHD2aumH5WUIs,1157
|
1261
1261
|
vellum/workflows/nodes/bases/__init__.py,sha256=Ll1Ti6t3e_HKtGLsQTHAJevDmfo0QtfgPZUZ9FCRduI,140
|
1262
|
-
vellum/workflows/nodes/bases/base.py,sha256=
|
1262
|
+
vellum/workflows/nodes/bases/base.py,sha256=atWeRf3BgTZpy5L3Mm47D6dca_sYKfSr5D3-fruwX_k,14056
|
1263
1263
|
vellum/workflows/nodes/bases/base_subworkflow_node/__init__.py,sha256=0nkHQiFC4IpA1ZGx60XG0BLUWF6hwUpgqmS3ZrlFGhg,80
|
1264
1264
|
vellum/workflows/nodes/bases/base_subworkflow_node/node.py,sha256=vC0gUBQewAUNtP3i2G0-LUpE_kY-r_ijBD_tS1XkQ1E,383
|
1265
1265
|
vellum/workflows/nodes/bases/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1284,7 +1284,7 @@ vellum/workflows/nodes/core/templating_node/node.py,sha256=19OFvRimrp1YuUO7H4rU7
|
|
1284
1284
|
vellum/workflows/nodes/core/templating_node/render.py,sha256=OpJp0NAH6qcEL6K9lxR0qjpFb75TYNttJR5iCos8tmg,1792
|
1285
1285
|
vellum/workflows/nodes/core/templating_node/tests/test_templating_node.py,sha256=0BtXeSix7KGIuKzlPFTMLATpNnFPhut1UV_srGptkt0,1120
|
1286
1286
|
vellum/workflows/nodes/core/try_node/__init__.py,sha256=JVD4DrldTIqFQQFrubs9KtWCCc0YCAc7Fzol5ZWIWeM,56
|
1287
|
-
vellum/workflows/nodes/core/try_node/node.py,sha256=
|
1287
|
+
vellum/workflows/nodes/core/try_node/node.py,sha256=XS-xZaJ_tM3sS-FjWU-FCk9x4Id2lrniyknORgg0KjA,6654
|
1288
1288
|
vellum/workflows/nodes/core/try_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1289
1289
|
vellum/workflows/nodes/core/try_node/tests/test_node.py,sha256=iD_ZjgB-v7pOYS6VjsqC-FWAFw8xvnEb-xXeau1Cuk0,4053
|
1290
1290
|
vellum/workflows/nodes/displayable/__init__.py,sha256=6F_4DlSwvHuilWnIalp8iDjjDXl0Nmz4QzJV2PYe5RI,1023
|
@@ -1301,12 +1301,12 @@ vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=1_OXD
|
|
1301
1301
|
vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py,sha256=MdrAKN8QGPk_JnNjbEBaVVKwVLPE2judbBcWuYJgbkY,4964
|
1302
1302
|
vellum/workflows/nodes/displayable/bases/search_node.py,sha256=S7J8tTW681O4wcWYerGOfH6h-_BlE8-JMJHpW8eCVG0,3564
|
1303
1303
|
vellum/workflows/nodes/displayable/code_execution_node/__init__.py,sha256=0FLWMMktpzSnmBMizQglBpcPrP80fzVsoJwJgf822Cg,76
|
1304
|
-
vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=
|
1304
|
+
vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=uwT_sn-XT0uYe7E-0DcJfcb3X33pwE0sw-2ri7FhoTo,8073
|
1305
1305
|
vellum/workflows/nodes/displayable/code_execution_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1306
1306
|
vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1307
1307
|
vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/main.py,sha256=5QsbmkzSlSbcbWTG_JmIqcP-JNJzOPTKxGzdHos19W4,79
|
1308
1308
|
vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py,sha256=2Kr7fKtjc1fW5z_6z6noKfWoETIVJbYi0AGhhSw-hsU,3376
|
1309
|
-
vellum/workflows/nodes/displayable/code_execution_node/utils.py,sha256=
|
1309
|
+
vellum/workflows/nodes/displayable/code_execution_node/utils.py,sha256=LfI3kj2zQz6UGMld_uA9z2LjZobqRcgxQO4jdUWkg7o,376
|
1310
1310
|
vellum/workflows/nodes/displayable/conditional_node/__init__.py,sha256=AS_EIqFdU1F9t8aLmbZU-rLh9ry6LCJ0uj0D8F0L5Uw,72
|
1311
1311
|
vellum/workflows/nodes/displayable/conditional_node/node.py,sha256=REFZdEVetXGyOK1RbIN1T6yRblrP0hfyZUls2KfjTKg,1016
|
1312
1312
|
vellum/workflows/nodes/displayable/final_output_node/__init__.py,sha256=G7VXM4OWpubvSJtVkGmMNeqgb9GkM7qZT838eL18XU4,72
|
@@ -1334,7 +1334,7 @@ vellum/workflows/outputs/__init__.py,sha256=AyZ4pRh_ACQIGvkf0byJO46EDnSix1ZCAXfv
|
|
1334
1334
|
vellum/workflows/outputs/base.py,sha256=a7W6rNSDSawwGAXYjNTF2iHb9lnZu7WFSOagZIyy__k,7976
|
1335
1335
|
vellum/workflows/ports/__init__.py,sha256=bZuMt-R7z5bKwpu4uPW7LlJeePOQWmCcDSXe5frUY5g,101
|
1336
1336
|
vellum/workflows/ports/node_ports.py,sha256=g4A-8iUAvEJSkaWppbvzAR8XU02R9U-qLN4rP2Kq4Aw,2743
|
1337
|
-
vellum/workflows/ports/port.py,sha256=
|
1337
|
+
vellum/workflows/ports/port.py,sha256=rc3GB7dDQCUs0IbY08a92-31YzJHQgBeww13brSJ2Js,3172
|
1338
1338
|
vellum/workflows/ports/utils.py,sha256=pEjVNJKw9LhD_cFN-o0MWBOW2ejno7jv26qqzjLxwS4,1662
|
1339
1339
|
vellum/workflows/references/__init__.py,sha256=glHFC1VfXmcbNvH5VzFbkT03d8_D7MMcvEcsUBrzLIs,591
|
1340
1340
|
vellum/workflows/references/environment_variable.py,sha256=7FFtiKfc4eyVkkfUbhc666OBNDqvFlMoNQEYmGpEVVE,661
|
@@ -1350,7 +1350,7 @@ vellum/workflows/references/workflow_input.py,sha256=epspVRZ9n_nxoTxI5Am3GDd2fpU
|
|
1350
1350
|
vellum/workflows/resolvers/__init__.py,sha256=eH6hTvZO4IciDaf_cf7aM2vs-DkBDyJPycOQevJxQnI,82
|
1351
1351
|
vellum/workflows/resolvers/base.py,sha256=WHra9LRtlTuB1jmuNqkfVE2JUgB61Cyntn8f0b0WZg4,411
|
1352
1352
|
vellum/workflows/runner/__init__.py,sha256=i1iG5sAhtpdsrlvwgH6B-m49JsINkiWyPWs8vyT-bqM,72
|
1353
|
-
vellum/workflows/runner/runner.py,sha256=
|
1353
|
+
vellum/workflows/runner/runner.py,sha256=7mSVaqJjyVljuuy3-bIO56mzXXMeQwKcYzZOuo8aC8E,27573
|
1354
1354
|
vellum/workflows/state/__init__.py,sha256=yUUdR-_Vl7UiixNDYQZ-GEM_kJI9dnOia75TtuNEsnE,60
|
1355
1355
|
vellum/workflows/state/base.py,sha256=jpSzF1OQd3-fqi6dMGlNsQl-7JnJxCdzWIigmX8Wz-I,14425
|
1356
1356
|
vellum/workflows/state/context.py,sha256=oXiEdNsWJi1coRB85IreTgUeR6_CrWWBXndtLff9S7M,1272
|
@@ -1377,8 +1377,8 @@ vellum/workflows/vellum_client.py,sha256=ODrq_TSl-drX2aezXegf7pizpWDVJuTXH-j6528
|
|
1377
1377
|
vellum/workflows/workflows/__init__.py,sha256=KY45TqvavCCvXIkyCFMEc0dc6jTMOUci93U2DUrlZYc,66
|
1378
1378
|
vellum/workflows/workflows/base.py,sha256=mnI-kZ78yt7u6NFSTUo-tYjDnarP-RJ7uZjwjCn6PCQ,16795
|
1379
1379
|
vellum/workflows/workflows/event_filters.py,sha256=-uQcMB7IpPd-idMku8f2QNVhPXPFWo6FZLlGjRf8rCo,1996
|
1380
|
-
vellum_ai-0.11.
|
1381
|
-
vellum_ai-0.11.
|
1382
|
-
vellum_ai-0.11.
|
1383
|
-
vellum_ai-0.11.
|
1384
|
-
vellum_ai-0.11.
|
1380
|
+
vellum_ai-0.11.6.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1381
|
+
vellum_ai-0.11.6.dist-info/METADATA,sha256=PlJ1b2Y0mTg3Ob_st_UHH7dOU5JqNqQI2-1akD7YOZs,5128
|
1382
|
+
vellum_ai-0.11.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
1383
|
+
vellum_ai-0.11.6.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1384
|
+
vellum_ai-0.11.6.dist-info/RECORD,,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import inspect
|
1
2
|
from uuid import UUID
|
2
3
|
from typing import ClassVar, Dict, Generic, Optional, TypeVar
|
3
4
|
|
@@ -28,7 +29,8 @@ class BaseCodeExecutionNodeDisplay(BaseNodeVellumDisplay[_CodeExecutionNodeType]
|
|
28
29
|
node = self._node
|
29
30
|
node_id = self.node_id
|
30
31
|
|
31
|
-
|
32
|
+
node_file_path = inspect.getfile(node)
|
33
|
+
code = read_file_from_path(node_filepath=node_file_path, script_filepath=(raise_if_descriptor(node.filepath)))
|
32
34
|
code_inputs = raise_if_descriptor(node.code_inputs)
|
33
35
|
|
34
36
|
inputs = [
|
@@ -39,7 +39,6 @@ class BaseErrorNodeDisplay(BaseNodeVellumDisplay[_ErrorNodeType], Generic[_Error
|
|
39
39
|
"data": {
|
40
40
|
"name": self.name,
|
41
41
|
"label": self.label,
|
42
|
-
"source_handle_id": str(self.get_source_handle_id(display_context.port_displays)),
|
43
42
|
"target_handle_id": str(self.get_target_handle_id()),
|
44
43
|
"error_source_input_id": str(error_source_input_id),
|
45
44
|
"error_output_id": str(self.error_output_id),
|
@@ -15,7 +15,7 @@ from vellum_ee.workflows.display.nodes.utils import raise_if_descriptor
|
|
15
15
|
from vellum_ee.workflows.display.nodes.vellum.utils import create_node_input
|
16
16
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
17
17
|
from vellum_ee.workflows.display.utils.uuids import uuid4_from_hash
|
18
|
-
from vellum_ee.workflows.display.vellum import NodeInput
|
18
|
+
from vellum_ee.workflows.display.vellum import InputVariablePointer, NodeInput
|
19
19
|
|
20
20
|
_SearchNodeType = TypeVar("_SearchNodeType", bound=SearchNode)
|
21
21
|
|
@@ -28,7 +28,7 @@ class VariableIdMap:
|
|
28
28
|
|
29
29
|
|
30
30
|
class BaseSearchNodeDisplay(BaseNodeVellumDisplay[_SearchNodeType], Generic[_SearchNodeType]):
|
31
|
-
|
31
|
+
input_variable_ids_by_logical_id: Optional[Dict[str, str]] = None
|
32
32
|
|
33
33
|
def serialize(
|
34
34
|
self, display_context: WorkflowDisplayContext, error_output_id: Optional[UUID] = None, **kwargs
|
@@ -128,7 +128,6 @@ class BaseSearchNodeDisplay(BaseNodeVellumDisplay[_SearchNodeType], Generic[_Sea
|
|
128
128
|
logical_expression: Union[VellumValueLogicalConditionGroupRequest, VellumValueLogicalConditionRequest],
|
129
129
|
display_context: WorkflowDisplayContext,
|
130
130
|
path: List[int] = [],
|
131
|
-
variable_id_map: Optional[VariableIdMap] = None,
|
132
131
|
) -> Tuple[JsonObject, List[NodeInput]]:
|
133
132
|
if isinstance(logical_expression, VellumValueLogicalConditionGroupRequest):
|
134
133
|
conditions: JsonArray = []
|
@@ -150,38 +149,42 @@ class BaseSearchNodeDisplay(BaseNodeVellumDisplay[_SearchNodeType], Generic[_Sea
|
|
150
149
|
variables,
|
151
150
|
)
|
152
151
|
elif isinstance(logical_expression, VellumValueLogicalConditionRequest):
|
153
|
-
lhs_variable_id = (
|
154
|
-
|
155
|
-
|
156
|
-
|
152
|
+
lhs_variable_id = str(logical_expression.lhs_variable.value)
|
153
|
+
rhs_variable_id = str(logical_expression.rhs_variable.value)
|
154
|
+
lhs_query_input_id = (
|
155
|
+
self.input_variable_ids_by_logical_id[lhs_variable_id]
|
156
|
+
if self.input_variable_ids_by_logical_id
|
157
|
+
else uuid4_from_hash(f"{self.node_id}|{hash(path)}")
|
157
158
|
)
|
158
|
-
|
159
|
-
|
160
|
-
if
|
161
|
-
else uuid4_from_hash(f"{self.node_id}|{hash(
|
159
|
+
rhs_query_input_id = (
|
160
|
+
self.input_variable_ids_by_logical_id[rhs_variable_id]
|
161
|
+
if self.input_variable_ids_by_logical_id
|
162
|
+
else uuid4_from_hash(f"{self.node_id}|{hash(path)}")
|
162
163
|
)
|
163
164
|
|
164
165
|
return (
|
165
166
|
{
|
166
167
|
"type": "LOGICAL_CONDITION",
|
167
|
-
"
|
168
|
+
"lhs_variable_id": str(lhs_variable_id),
|
168
169
|
"operator": logical_expression.operator,
|
169
|
-
"
|
170
|
+
"rhs_variable_id": str(rhs_variable_id),
|
170
171
|
},
|
171
172
|
[
|
172
173
|
create_node_input(
|
173
174
|
self.node_id,
|
174
175
|
f"vellum-query-builder-variable-{lhs_variable_id}",
|
175
|
-
|
176
|
+
lhs_query_input_id,
|
176
177
|
display_context,
|
177
|
-
input_id=lhs_variable_id,
|
178
|
+
input_id=UUID(lhs_variable_id),
|
179
|
+
pointer_type=InputVariablePointer,
|
178
180
|
),
|
179
181
|
create_node_input(
|
180
182
|
self.node_id,
|
181
183
|
f"vellum-query-builder-variable-{rhs_variable_id}",
|
182
|
-
|
184
|
+
rhs_query_input_id,
|
183
185
|
display_context,
|
184
|
-
input_id=rhs_variable_id,
|
186
|
+
input_id=UUID(rhs_variable_id),
|
187
|
+
pointer_type=InputVariablePointer,
|
185
188
|
),
|
186
189
|
],
|
187
190
|
)
|
@@ -10,6 +10,10 @@ from vellum_ee.workflows.display.utils.uuids import uuid4_from_hash
|
|
10
10
|
from vellum_ee.workflows.display.utils.vellum import create_node_input_value_pointer_rule, primitive_to_vellum_value
|
11
11
|
from vellum_ee.workflows.display.vellum import (
|
12
12
|
ConstantValuePointer,
|
13
|
+
ExecutionCounterData,
|
14
|
+
ExecutionCounterPointer,
|
15
|
+
InputVariableData,
|
16
|
+
InputVariablePointer,
|
13
17
|
NodeInput,
|
14
18
|
NodeInputValuePointer,
|
15
19
|
NodeInputValuePointerRule,
|
@@ -93,4 +97,15 @@ def create_pointer(
|
|
93
97
|
)
|
94
98
|
|
95
99
|
vellum_variable_value = primitive_to_vellum_value(value)
|
96
|
-
|
100
|
+
if pointer_type is InputVariablePointer:
|
101
|
+
return InputVariablePointer(type="INPUT_VARIABLE", data=InputVariableData(input_variable_id=value))
|
102
|
+
elif pointer_type is WorkspaceSecretPointer:
|
103
|
+
return WorkspaceSecretPointer(
|
104
|
+
type="WORKSPACE_SECRET", data=WorkspaceSecretData(type="STRING", workspace_secret_id=value)
|
105
|
+
)
|
106
|
+
elif pointer_type is ExecutionCounterPointer:
|
107
|
+
return ExecutionCounterPointer(type="EXECUTION_COUNTER", data=ExecutionCounterData(node_id=value))
|
108
|
+
elif pointer_type is ConstantValuePointer or pointer_type is None:
|
109
|
+
return ConstantValuePointer(type="CONSTANT_VALUE", data=vellum_variable_value)
|
110
|
+
else:
|
111
|
+
raise ValueError(f"Pointer type {pointer_type} not supported")
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py
CHANGED
@@ -102,7 +102,6 @@ def test_serialize_workflow():
|
|
102
102
|
"data": {
|
103
103
|
"name": "error-node",
|
104
104
|
"label": "Fail Node",
|
105
|
-
"source_handle_id": "ca17d318-a0f5-4f7c-be6c-59c9dc1dd7ed",
|
106
105
|
"target_handle_id": "70c19f1c-309c-4a5d-ba65-664c0bb2fedf",
|
107
106
|
"error_source_input_id": "None",
|
108
107
|
"error_output_id": "None",
|
File without changes
|
File without changes
|
File without changes
|