vellum-ai 0.14.63__py3-none-any.whl → 0.14.64__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/nodes/bases/base.py +3 -3
- vellum/workflows/nodes/bases/base_adornment_node.py +2 -0
- vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +4 -0
- vellum/workflows/nodes/experimental/tool_calling_node/node.py +17 -11
- vellum/workflows/nodes/experimental/tool_calling_node/utils.py +9 -11
- {vellum_ai-0.14.63.dist-info → vellum_ai-0.14.64.dist-info}/METADATA +11 -12
- {vellum_ai-0.14.63.dist-info → vellum_ai-0.14.64.dist-info}/RECORD +14 -14
- vellum_ee/workflows/display/nodes/vellum/map_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +33 -26
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py +16 -10
- {vellum_ai-0.14.63.dist-info → vellum_ai-0.14.64.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.63.dist-info → vellum_ai-0.14.64.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.63.dist-info → vellum_ai-0.14.64.dist-info}/entry_points.txt +0 -0
@@ -18,7 +18,7 @@ class BaseClientWrapper:
|
|
18
18
|
headers: typing.Dict[str, str] = {
|
19
19
|
"X-Fern-Language": "Python",
|
20
20
|
"X-Fern-SDK-Name": "vellum-ai",
|
21
|
-
"X-Fern-SDK-Version": "0.14.
|
21
|
+
"X-Fern-SDK-Version": "0.14.64",
|
22
22
|
}
|
23
23
|
headers["X-API-KEY"] = self.api_key
|
24
24
|
return headers
|
@@ -1,3 +1,4 @@
|
|
1
|
+
from abc import ABC, ABCMeta
|
1
2
|
from dataclasses import field
|
2
3
|
from functools import cached_property, reduce
|
3
4
|
import inspect
|
@@ -50,7 +51,7 @@ def _is_annotated(cls: Type, name: str) -> bool:
|
|
50
51
|
return False
|
51
52
|
|
52
53
|
|
53
|
-
class BaseNodeMeta(
|
54
|
+
class BaseNodeMeta(ABCMeta):
|
54
55
|
def __new__(mcs, name: str, bases: Tuple[Type, ...], dct: Dict[str, Any]) -> Any:
|
55
56
|
if "Outputs" in dct:
|
56
57
|
outputs_class = dct["Outputs"]
|
@@ -258,7 +259,7 @@ class _BaseNodeExecutionMeta(type):
|
|
258
259
|
NodeRunResponse = Union[BaseOutputs, Iterator[BaseOutput]]
|
259
260
|
|
260
261
|
|
261
|
-
class BaseNode(Generic[StateType], metaclass=BaseNodeMeta):
|
262
|
+
class BaseNode(Generic[StateType], ABC, metaclass=BaseNodeMeta):
|
262
263
|
__id__: UUID = uuid4_from_hash(__qualname__)
|
263
264
|
__output_ids__: Dict[str, UUID] = {}
|
264
265
|
state: StateType
|
@@ -490,7 +491,6 @@ class BaseNode(Generic[StateType], metaclass=BaseNodeMeta):
|
|
490
491
|
node_output_descriptor.name,
|
491
492
|
node_output_descriptor.instance.resolve(self.state),
|
492
493
|
)
|
493
|
-
delattr(self.Outputs, "_outputs_post_init")
|
494
494
|
|
495
495
|
setattr(self.Outputs, "_outputs_post_init", _outputs_post_init)
|
496
496
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
from abc import ABC
|
1
2
|
from typing import TYPE_CHECKING, Any, Dict, Generic, Optional, Tuple, Type
|
2
3
|
|
3
4
|
from vellum.workflows.inputs.base import BaseInputs
|
@@ -67,6 +68,7 @@ class _BaseAdornmentNodeMeta(BaseNodeMeta):
|
|
67
68
|
class BaseAdornmentNode(
|
68
69
|
BaseNode[StateType],
|
69
70
|
Generic[StateType],
|
71
|
+
ABC,
|
70
72
|
metaclass=_BaseAdornmentNodeMeta,
|
71
73
|
):
|
72
74
|
"""
|
@@ -63,6 +63,10 @@ class SubworkflowDeploymentNode(BaseNode[StateType], Generic[StateType]):
|
|
63
63
|
compiled_inputs: List[WorkflowRequestInputRequest] = []
|
64
64
|
|
65
65
|
for input_name, input_value in self.subworkflow_inputs.items():
|
66
|
+
# Exclude inputs that resolved to be null. This ensure that we don't pass input values
|
67
|
+
# to optional subworkflow inputs whose values were unresolved.
|
68
|
+
if input_value is None:
|
69
|
+
continue
|
66
70
|
if isinstance(input_value, str):
|
67
71
|
compiled_inputs.append(
|
68
72
|
WorkflowRequestStringInputRequest(
|
@@ -1,10 +1,11 @@
|
|
1
|
-
from collections.abc import Callable
|
1
|
+
from collections.abc import Callable, Sequence
|
2
2
|
from typing import Any, ClassVar, Dict, List, Optional, cast
|
3
3
|
|
4
4
|
from pydash import snake_case
|
5
5
|
|
6
6
|
from vellum import ChatMessage, PromptBlock
|
7
7
|
from vellum.client.types.code_execution_package import CodeExecutionPackage
|
8
|
+
from vellum.client.types.code_execution_runtime import CodeExecutionRuntime
|
8
9
|
from vellum.workflows.context import execution_context, get_parent_context
|
9
10
|
from vellum.workflows.errors.types import WorkflowErrorCode
|
10
11
|
from vellum.workflows.exceptions import NodeException
|
@@ -29,16 +30,14 @@ class ToolCallingNode(BaseNode):
|
|
29
30
|
functions: List[FunctionDefinition] - The functions that can be called
|
30
31
|
function_callables: List[Callable] - The callables that can be called
|
31
32
|
prompt_inputs: Optional[EntityInputsInterface] - Mapping of input variable names to values
|
32
|
-
|
33
|
-
runtime: str - The runtime to use for code execution (default: "PYTHON_3_11_6")
|
33
|
+
function_configs: Optional[Dict[str, Dict[str, Any]]] - Mapping of function names to their configuration
|
34
34
|
"""
|
35
35
|
|
36
36
|
ml_model: ClassVar[str] = "gpt-4o-mini"
|
37
37
|
blocks: ClassVar[List[PromptBlock]] = []
|
38
38
|
functions: ClassVar[List[Callable[..., Any]]] = []
|
39
39
|
prompt_inputs: ClassVar[Optional[EntityInputsInterface]] = None
|
40
|
-
|
41
|
-
runtime: ClassVar[str] = "PYTHON_3_11_6"
|
40
|
+
function_configs: ClassVar[Optional[Dict[str, Dict[str, Any]]]] = None
|
42
41
|
|
43
42
|
class Outputs(BaseOutputs):
|
44
43
|
"""
|
@@ -108,17 +107,24 @@ class ToolCallingNode(BaseNode):
|
|
108
107
|
self._function_nodes = {}
|
109
108
|
for function in self.functions:
|
110
109
|
function_name = snake_case(function.__name__)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
110
|
+
|
111
|
+
# Get configuration for this function
|
112
|
+
config = {}
|
113
|
+
if self.function_configs and function.__name__ in self.function_configs:
|
114
|
+
config = self.function_configs[function.__name__]
|
115
|
+
|
116
|
+
packages = config.get("packages", None)
|
117
|
+
if packages is not None:
|
118
|
+
packages = cast(Sequence[CodeExecutionPackage], packages)
|
119
|
+
|
120
|
+
runtime_raw = config.get("runtime", "PYTHON_3_11_6")
|
121
|
+
runtime = cast(CodeExecutionRuntime, runtime_raw)
|
116
122
|
|
117
123
|
self._function_nodes[function_name] = create_function_node(
|
118
124
|
function=function,
|
119
125
|
tool_router_node=self.tool_router_node,
|
120
126
|
packages=packages,
|
121
|
-
runtime=
|
127
|
+
runtime=runtime,
|
122
128
|
)
|
123
129
|
|
124
130
|
graph_set = set()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from collections.abc import Callable
|
1
|
+
from collections.abc import Callable, Sequence
|
2
2
|
import inspect
|
3
3
|
import json
|
4
4
|
import types
|
@@ -8,6 +8,7 @@ from pydash import snake_case
|
|
8
8
|
|
9
9
|
from vellum import ChatMessage, PromptBlock
|
10
10
|
from vellum.client.types.code_execution_package import CodeExecutionPackage
|
11
|
+
from vellum.client.types.code_execution_runtime import CodeExecutionRuntime
|
11
12
|
from vellum.client.types.function_call_chat_message_content import FunctionCallChatMessageContent
|
12
13
|
from vellum.client.types.function_call_chat_message_content_value import FunctionCallChatMessageContentValue
|
13
14
|
from vellum.client.types.string_chat_message_content import StringChatMessageContent
|
@@ -128,8 +129,8 @@ def create_tool_router_node(
|
|
128
129
|
def create_function_node(
|
129
130
|
function: Callable[..., Any],
|
130
131
|
tool_router_node: Type[ToolRouterNode],
|
131
|
-
packages: Optional[
|
132
|
-
runtime:
|
132
|
+
packages: Optional[Sequence[CodeExecutionPackage]] = None,
|
133
|
+
runtime: CodeExecutionRuntime = "PYTHON_3_11_6",
|
133
134
|
) -> Type[FunctionNode]:
|
134
135
|
"""
|
135
136
|
Create a FunctionNode class for a given function.
|
@@ -198,20 +199,17 @@ def create_function_node(
|
|
198
199
|
function_source = inspect.getsource(function)
|
199
200
|
function_name = function.__name__
|
200
201
|
|
201
|
-
|
202
|
+
code = f'''
|
202
203
|
{function_source}
|
203
204
|
|
204
205
|
def main(arguments):
|
205
206
|
"""Main function that calls the original function with the provided arguments."""
|
206
207
|
return {function_name}(**arguments)
|
207
208
|
'''
|
208
|
-
_packages = packages
|
209
|
-
_tool_router_node = tool_router_node
|
210
|
-
_runtime = runtime
|
211
209
|
|
212
210
|
def execute_code_execution_function(self) -> BaseNode.Outputs:
|
213
211
|
# Get the function call from the tool router output
|
214
|
-
function_call_output = self.state.meta.node_outputs.get(
|
212
|
+
function_call_output = self.state.meta.node_outputs.get(tool_router_node.Outputs.results)
|
215
213
|
if function_call_output and len(function_call_output) > 0:
|
216
214
|
function_call = function_call_output[0]
|
217
215
|
arguments = function_call.value.arguments
|
@@ -246,11 +244,11 @@ def main(arguments):
|
|
246
244
|
{},
|
247
245
|
lambda ns: ns.update(
|
248
246
|
{
|
249
|
-
"code":
|
247
|
+
"code": code,
|
250
248
|
"code_inputs": {}, # No inputs needed since we handle function call extraction in run()
|
251
249
|
"run": execute_code_execution_function,
|
252
|
-
"runtime":
|
253
|
-
"packages":
|
250
|
+
"runtime": runtime,
|
251
|
+
"packages": packages,
|
254
252
|
"__module__": __name__,
|
255
253
|
}
|
256
254
|
),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vellum-ai
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.64
|
4
4
|
Summary:
|
5
5
|
License: MIT
|
6
6
|
Requires-Python: >=3.9,<4.0
|
@@ -20,22 +20,21 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.8
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
22
22
|
Classifier: Typing :: Typed
|
23
|
-
Requires-Dist: Jinja2 (>=3.1.
|
24
|
-
Requires-Dist:
|
25
|
-
Requires-Dist:
|
26
|
-
Requires-Dist: docker (==7.1.0)
|
23
|
+
Requires-Dist: Jinja2 (>=3.1.0,<4.0.0)
|
24
|
+
Requires-Dist: click (>=8.1.0,<9.0.0)
|
25
|
+
Requires-Dist: docker (>=7.1.0,<8.0.0)
|
27
26
|
Requires-Dist: httpx (>=0.21.2)
|
28
|
-
Requires-Dist: openai (>=1.0.0)
|
27
|
+
Requires-Dist: openai (>=1.0.0,<2.0.0)
|
29
28
|
Requires-Dist: orderly-set (>=5.2.2,<6.0.0)
|
30
29
|
Requires-Dist: publication (==0.0.3)
|
31
30
|
Requires-Dist: pydantic (>=1.9.2)
|
32
31
|
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
33
|
-
Requires-Dist: pydash (
|
34
|
-
Requires-Dist: python-dotenv (
|
35
|
-
Requires-Dist: pytz (
|
36
|
-
Requires-Dist: pyyaml (
|
37
|
-
Requires-Dist: requests (
|
38
|
-
Requires-Dist: tomli (
|
32
|
+
Requires-Dist: pydash (>=7.0.0,<8.0.0)
|
33
|
+
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
34
|
+
Requires-Dist: pytz (>=2022.0,<2026.0)
|
35
|
+
Requires-Dist: pyyaml (>=6.0.0,<7.0.0)
|
36
|
+
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
37
|
+
Requires-Dist: tomli (>=2.0.0,<3.0.0)
|
39
38
|
Requires-Dist: typing_extensions (>=4.0.0)
|
40
39
|
Project-URL: Repository, https://github.com/vellum-ai/vellum-python-sdks
|
41
40
|
Description-Content-Type: text/markdown
|
@@ -42,7 +42,7 @@ vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=jUDI2FwVaw0
|
|
42
42
|
vellum_ee/workflows/display/nodes/vellum/guardrail_node.py,sha256=5_5D5PMzBOeUdVtRlANbfEsu7Gv3r37dLvpfjGAqYac,2330
|
43
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
|
-
vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=
|
45
|
+
vellum_ee/workflows/display/nodes/vellum/map_node.py,sha256=2teCYQSX8g-b8aaC_MY4XSC4GRMTJigPFWNTQEkC_gk,3907
|
46
46
|
vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=yBWeN4T_lOsDVnNOKWRiT7JYKu0IR5Fx2z99iq6QKSA,3273
|
47
47
|
vellum_ee/workflows/display/nodes/vellum/note_node.py,sha256=3E0UqmgVYdtbj4nyq8gKju8EpMsRHMCQ0KLrJhug3XU,1084
|
48
48
|
vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py,sha256=1NxFddxWCFtMe_je1cutP7qnoASoG94LJqKhRkoQwvw,3535
|
@@ -59,7 +59,7 @@ vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=TtzUj3
|
|
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
|
62
|
-
vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py,sha256=
|
62
|
+
vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py,sha256=ZsLIGnJ9QKrXjYeDW8LEN8M9FnWRQ9TohHFyB6144HY,7970
|
63
63
|
vellum_ee/workflows/display/nodes/vellum/tests/test_try_node.py,sha256=Khjsb53PKpZuyhKoRMgKAL45eGp5hZqXvHmVeQWRw4w,2289
|
64
64
|
vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py,sha256=3LS1O4DGPWit05oj_ubeW8AlHGnoBxdUMferGQuAiZs,4851
|
65
65
|
vellum_ee/workflows/display/nodes/vellum/try_node.py,sha256=z9Omo676RRc7mQjLoL7hjiHhUj0OWVLhrrb97YTN4QA,4086
|
@@ -90,7 +90,7 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_
|
|
90
90
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py,sha256=KkYZc_bZuq1lmDcvUz3QxIqJLpQPCZioD1FHUNsMJY8,11211
|
91
91
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py,sha256=aZaqRDrkO3ytcmdM2eKJqHSt60MF070NMj6M2vgzOKc,7711
|
92
92
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py,sha256=r748dpS13HtwY7t_KQFExFssxRy0xI2d-wxmhiUHRe0,3850
|
93
|
-
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=
|
93
|
+
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py,sha256=Cx3oY6vPVap0xm_mChqfQw4zzR4pqV36o_SyD8g6jPY,8727
|
94
94
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=EL5kfakuoEcwD85dGjhMta-J-PpCHRSDoc80SdbBrQk,2769
|
95
95
|
vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=RmFUDx8dYdfsOE2CGLvdXqNNRtLLpVzXDN8dqZyMcZ8,5822
|
96
96
|
vellum_ee/workflows/display/types.py,sha256=i4T7ElU5b5h-nA1i3scmEhO1BqmNDc4eJDHavATD88w,2821
|
@@ -134,7 +134,7 @@ vellum/client/README.md,sha256=qmaVIP42MnxAu8jV7u-CsgVFfs3-pHQODrXdZdFxtaw,4749
|
|
134
134
|
vellum/client/__init__.py,sha256=AYopGv2ZRVn3zsU8_km6KOvEHDbXiTPCVuYVI7bWvdA,120166
|
135
135
|
vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
136
136
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
137
|
-
vellum/client/core/client_wrapper.py,sha256=
|
137
|
+
vellum/client/core/client_wrapper.py,sha256=EBMKy4AU89W_wlhww7wsWGLScDvYus97WUeayU5Ejd0,1869
|
138
138
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
139
139
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
140
140
|
vellum/client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
|
@@ -1548,8 +1548,8 @@ vellum/workflows/inputs/tests/test_inputs.py,sha256=lioA8917mFLYq7Ml69UNkqUjcWbb
|
|
1548
1548
|
vellum/workflows/logging.py,sha256=_a217XogktV4Ncz6xKFz7WfYmZAzkfVRVuC0rWob8ls,437
|
1549
1549
|
vellum/workflows/nodes/__init__.py,sha256=aVdQVv7Y3Ro3JlqXGpxwaU2zrI06plDHD2aumH5WUIs,1157
|
1550
1550
|
vellum/workflows/nodes/bases/__init__.py,sha256=cniHuz_RXdJ4TQgD8CBzoiKDiPxg62ErdVpCbWICX64,58
|
1551
|
-
vellum/workflows/nodes/bases/base.py,sha256=
|
1552
|
-
vellum/workflows/nodes/bases/base_adornment_node.py,sha256=
|
1551
|
+
vellum/workflows/nodes/bases/base.py,sha256=TtvfbGnAB8fYfQlhBM-sF3fwZLYn_Nq-dqU9m1fAbBU,21923
|
1552
|
+
vellum/workflows/nodes/bases/base_adornment_node.py,sha256=hrgzuTetM4ynPd9YGHoK8Vwwn4XITi3aZZ_OCnQrq4Y,3433
|
1553
1553
|
vellum/workflows/nodes/bases/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1554
1554
|
vellum/workflows/nodes/bases/tests/test_base_adornment_node.py,sha256=fXZI9KqpS4XMBrBnIEkK3foHaBVvyHwYcQWWDKay7ic,1148
|
1555
1555
|
vellum/workflows/nodes/bases/tests/test_base_node.py,sha256=KRrgjXfzxf1ecE55-jwbQqPnOlNii-i2iaHJUW6oWcI,9358
|
@@ -1632,7 +1632,7 @@ vellum/workflows/nodes/displayable/search_node/node.py,sha256=vUTDyurYKw6KLABuVm
|
|
1632
1632
|
vellum/workflows/nodes/displayable/search_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1633
1633
|
vellum/workflows/nodes/displayable/search_node/tests/test_node.py,sha256=OserVd6jPe6t49MQF0cxphI2irBLaC_GceMr0acFqoY,8075
|
1634
1634
|
vellum/workflows/nodes/displayable/subworkflow_deployment_node/__init__.py,sha256=9yYM6001YZeqI1VOk1QuEM_yrffk_EdsO7qaPzINKds,92
|
1635
|
-
vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py,sha256=
|
1635
|
+
vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py,sha256=lq8_USZkNiYktH0oJSW2jOuXyRtVwVoq1CKFdCek5-M,9719
|
1636
1636
|
vellum/workflows/nodes/displayable/subworkflow_deployment_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1637
1637
|
vellum/workflows/nodes/displayable/subworkflow_deployment_node/tests/test_node.py,sha256=c98nMPogZ6iN_pTvVUMTB3J72Hj--H-XVgvvRXhdSQE,19085
|
1638
1638
|
vellum/workflows/nodes/displayable/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1644,9 +1644,9 @@ vellum/workflows/nodes/experimental/__init__.py,sha256=_tpZGWAZLydcKxfrj1-plrZeT
|
|
1644
1644
|
vellum/workflows/nodes/experimental/openai_chat_completion_node/__init__.py,sha256=lsyD9laR9p7kx5-BXGH2gUTM242UhKy8SMV0SR6S2iE,90
|
1645
1645
|
vellum/workflows/nodes/experimental/openai_chat_completion_node/node.py,sha256=cKI2Ls25L-JVt4z4a2ozQa-YBeVy21Z7BQ32Sj7iBPE,10460
|
1646
1646
|
vellum/workflows/nodes/experimental/tool_calling_node/__init__.py,sha256=S7OzT3I4cyOU5Beoz87nPwCejCMP2FsHBFL8OcVmxJ4,118
|
1647
|
-
vellum/workflows/nodes/experimental/tool_calling_node/node.py,sha256=
|
1647
|
+
vellum/workflows/nodes/experimental/tool_calling_node/node.py,sha256=FkhaJccpCbx2be_IZ5V2v6Lo-jPJ0WgSC5tveLvAW4A,5774
|
1648
1648
|
vellum/workflows/nodes/experimental/tool_calling_node/tests/test_node.py,sha256=sxG26mOwt4N36RLoPJ-ngginPqC5qFzD_kGj9izdCFI,1833
|
1649
|
-
vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=
|
1649
|
+
vellum/workflows/nodes/experimental/tool_calling_node/utils.py,sha256=DjFn33XuomM-EiojCFzTlOsWMdF_uYyHzNayBok6X-k,10055
|
1650
1650
|
vellum/workflows/nodes/mocks.py,sha256=a1FjWEIocseMfjzM-i8DNozpUsaW0IONRpZmXBoWlyc,10455
|
1651
1651
|
vellum/workflows/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1652
1652
|
vellum/workflows/nodes/tests/test_mocks.py,sha256=mfPvrs75PKcsNsbJLQAN6PDFoVqs9TmQxpdyFKDdO60,7837
|
@@ -1712,8 +1712,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
|
|
1712
1712
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1713
1713
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=fROqff6AZpCIzaSwOKSdtYy4XR0UZQ6ejxL3RJOSJVs,20447
|
1714
1714
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1715
|
-
vellum_ai-0.14.
|
1716
|
-
vellum_ai-0.14.
|
1717
|
-
vellum_ai-0.14.
|
1718
|
-
vellum_ai-0.14.
|
1719
|
-
vellum_ai-0.14.
|
1715
|
+
vellum_ai-0.14.64.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1716
|
+
vellum_ai-0.14.64.dist-info/METADATA,sha256=tewaEjPiWmDj6JmUJmAXJPiXr51sX5Yvpc3rHxjJw0w,5508
|
1717
|
+
vellum_ai-0.14.64.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1718
|
+
vellum_ai-0.14.64.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1719
|
+
vellum_ai-0.14.64.dist-info/RECORD,,
|
@@ -3,6 +3,7 @@ from typing import Generic, Optional, TypeVar, cast
|
|
3
3
|
|
4
4
|
from vellum.workflows.nodes import MapNode
|
5
5
|
from vellum.workflows.types.core import JsonObject
|
6
|
+
from vellum.workflows.workflows.base import BaseWorkflow
|
6
7
|
from vellum_ee.workflows.display.nodes.utils import raise_if_descriptor
|
7
8
|
from vellum_ee.workflows.display.nodes.vellum.base_adornment_node import BaseAdornmentNodeDisplay
|
8
9
|
from vellum_ee.workflows.display.nodes.vellum.utils import create_node_input
|
@@ -21,7 +22,7 @@ class BaseMapNodeDisplay(BaseAdornmentNodeDisplay[_MapNodeType], Generic[_MapNod
|
|
21
22
|
node = self._node
|
22
23
|
node_id = self.node_id
|
23
24
|
|
24
|
-
subworkflow = raise_if_descriptor(node.subworkflow)
|
25
|
+
subworkflow = cast(type[BaseWorkflow], raise_if_descriptor(node.subworkflow))
|
25
26
|
|
26
27
|
items_node_input = create_node_input(
|
27
28
|
node_id=node_id,
|
@@ -125,7 +125,7 @@ def test_serialize_node__prompt_inputs__mixed_values():
|
|
125
125
|
}
|
126
126
|
|
127
127
|
|
128
|
-
def
|
128
|
+
def test_serialize_node__function_configs():
|
129
129
|
# GIVEN a tool calling node with function packages
|
130
130
|
def foo():
|
131
131
|
pass
|
@@ -135,14 +135,18 @@ def test_serialize_node__function_packages():
|
|
135
135
|
|
136
136
|
class MyToolCallingNode(ToolCallingNode):
|
137
137
|
functions = [foo, bar]
|
138
|
-
|
139
|
-
foo:
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
138
|
+
function_configs = {
|
139
|
+
"foo": {
|
140
|
+
"runtime": "PYTHON_3_11_6",
|
141
|
+
"packages": [
|
142
|
+
CodeExecutionPackage(name="first_package", version="1.0.0"),
|
143
|
+
CodeExecutionPackage(name="second_package", version="2.0.0"),
|
144
|
+
],
|
145
|
+
},
|
146
|
+
"bar": {
|
147
|
+
"runtime": "PYTHON_3_11_6",
|
148
|
+
"packages": [CodeExecutionPackage(name="third_package", version="3.0.0")],
|
149
|
+
},
|
146
150
|
}
|
147
151
|
|
148
152
|
# AND a workflow with the tool calling node
|
@@ -160,31 +164,34 @@ def test_serialize_node__function_packages():
|
|
160
164
|
if node["id"] == str(MyToolCallingNode.__id__)
|
161
165
|
)
|
162
166
|
|
163
|
-
|
164
|
-
attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "
|
167
|
+
function_configs_attribute = next(
|
168
|
+
attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "function_configs"
|
165
169
|
)
|
166
170
|
|
167
|
-
assert
|
168
|
-
"id": "
|
169
|
-
"name": "
|
171
|
+
assert function_configs_attribute == {
|
172
|
+
"id": "90cc5fc7-9fb3-450f-be5a-e90e7412a601",
|
173
|
+
"name": "function_configs",
|
170
174
|
"value": {
|
171
175
|
"type": "CONSTANT_VALUE",
|
172
176
|
"value": {
|
173
177
|
"type": "JSON",
|
174
178
|
"value": {
|
175
|
-
"foo":
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
179
|
+
"foo": {
|
180
|
+
"runtime": "PYTHON_3_11_6",
|
181
|
+
"packages": [
|
182
|
+
{"version": "1.0.0", "name": "first_package"},
|
183
|
+
{"version": "2.0.0", "name": "second_package"},
|
184
|
+
],
|
185
|
+
},
|
186
|
+
"bar": {"runtime": "PYTHON_3_11_6", "packages": [{"version": "3.0.0", "name": "third_package"}]},
|
180
187
|
},
|
181
188
|
},
|
182
189
|
},
|
183
190
|
}
|
184
191
|
|
185
192
|
|
186
|
-
def
|
187
|
-
# GIVEN a tool calling node with no function
|
193
|
+
def test_serialize_node__function_configs__none():
|
194
|
+
# GIVEN a tool calling node with no function configs
|
188
195
|
def foo():
|
189
196
|
pass
|
190
197
|
|
@@ -206,12 +213,12 @@ def test_serialize_node__none_function_packages():
|
|
206
213
|
if node["id"] == str(MyToolCallingNode.__id__)
|
207
214
|
)
|
208
215
|
|
209
|
-
|
210
|
-
attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "
|
216
|
+
function_configs_attribute = next(
|
217
|
+
attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "function_configs"
|
211
218
|
)
|
212
219
|
|
213
|
-
assert
|
214
|
-
"id": "
|
215
|
-
"name": "
|
220
|
+
assert function_configs_attribute == {
|
221
|
+
"id": "5f63f2aa-72d7-47ad-a552-630753418b7d",
|
222
|
+
"name": "function_configs",
|
216
223
|
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
217
224
|
}
|
@@ -150,6 +150,22 @@ def test_serialize_workflow():
|
|
150
150
|
},
|
151
151
|
},
|
152
152
|
},
|
153
|
+
{
|
154
|
+
"id": "a4e3bc9f-7112-4d2f-94fb-7362a85db27a",
|
155
|
+
"name": "function_configs",
|
156
|
+
"value": {
|
157
|
+
"type": "CONSTANT_VALUE",
|
158
|
+
"value": {
|
159
|
+
"type": "JSON",
|
160
|
+
"value": {
|
161
|
+
"get_current_weather": {
|
162
|
+
"runtime": "PYTHON_3_11_6",
|
163
|
+
"packages": [{"version": "2.26.0", "name": "requests"}],
|
164
|
+
}
|
165
|
+
},
|
166
|
+
},
|
167
|
+
},
|
168
|
+
},
|
153
169
|
{
|
154
170
|
"id": "0f6dc102-3460-4963-91fa-7ba85d65ef7a",
|
155
171
|
"name": "prompt_inputs",
|
@@ -167,16 +183,6 @@ def test_serialize_workflow():
|
|
167
183
|
],
|
168
184
|
},
|
169
185
|
},
|
170
|
-
{
|
171
|
-
"id": "b31575f0-633b-4bd0-ba6a-960532f3887a",
|
172
|
-
"name": "function_packages",
|
173
|
-
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
174
|
-
},
|
175
|
-
{
|
176
|
-
"id": "d316c45c-97ea-4f39-9a2d-5c43e2d355de",
|
177
|
-
"name": "runtime",
|
178
|
-
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "PYTHON_3_11_6"}},
|
179
|
-
},
|
180
186
|
],
|
181
187
|
"outputs": [
|
182
188
|
{"id": "e62bc785-a914-4066-b79e-8c89a5d0ec6c", "name": "text", "type": "STRING", "value": None},
|
File without changes
|
File without changes
|
File without changes
|