vellum-ai 1.0.7__py3-none-any.whl → 1.0.8__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 +2 -2
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py +14 -1
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +5 -1
- vellum/workflows/types/core.py +2 -2
- vellum/workflows/types/definition.py +21 -0
- vellum/workflows/types/tests/test_definition.py +79 -1
- {vellum_ai-1.0.7.dist-info → vellum_ai-1.0.8.dist-info}/METADATA +1 -1
- {vellum_ai-1.0.7.dist-info → vellum_ai-1.0.8.dist-info}/RECORD +12 -12
- vellum_cli/push.py +3 -2
- {vellum_ai-1.0.7.dist-info → vellum_ai-1.0.8.dist-info}/LICENSE +0 -0
- {vellum_ai-1.0.7.dist-info → vellum_ai-1.0.8.dist-info}/WHEEL +0 -0
- {vellum_ai-1.0.7.dist-info → vellum_ai-1.0.8.dist-info}/entry_points.txt +0 -0
@@ -25,10 +25,10 @@ class BaseClientWrapper:
|
|
25
25
|
|
26
26
|
def get_headers(self) -> typing.Dict[str, str]:
|
27
27
|
headers: typing.Dict[str, str] = {
|
28
|
-
"User-Agent": "vellum-ai/1.0.
|
28
|
+
"User-Agent": "vellum-ai/1.0.8",
|
29
29
|
"X-Fern-Language": "Python",
|
30
30
|
"X-Fern-SDK-Name": "vellum-ai",
|
31
|
-
"X-Fern-SDK-Version": "1.0.
|
31
|
+
"X-Fern-SDK-Version": "1.0.8",
|
32
32
|
}
|
33
33
|
if self._api_version is not None:
|
34
34
|
headers["X-API-Version"] = self._api_version
|
@@ -15,7 +15,7 @@ from vellum.workflows.nodes.bases import BaseNode
|
|
15
15
|
from vellum.workflows.nodes.displayable.tool_calling_node.utils import create_tool_router_node, get_function_name
|
16
16
|
from vellum.workflows.outputs.base import BaseOutputs
|
17
17
|
from vellum.workflows.state.base import BaseState
|
18
|
-
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition
|
18
|
+
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition, MCPServer, MCPToolDefinition
|
19
19
|
|
20
20
|
|
21
21
|
def test_get_function_name_callable():
|
@@ -69,6 +69,19 @@ def test_get_function_name_subworkflow_deployment_uuid():
|
|
69
69
|
assert result == "57f09bebb46340e0bf9ec972e664352f"
|
70
70
|
|
71
71
|
|
72
|
+
def test_get_function_name_mcp_tool_definition():
|
73
|
+
"""Test MCPToolDefinition function name generation."""
|
74
|
+
mcp_tool = MCPToolDefinition(
|
75
|
+
name="create_repository",
|
76
|
+
server=MCPServer(name="github", url="https://api.github.com"),
|
77
|
+
parameters={"repository_name": "string", "description": "string"},
|
78
|
+
)
|
79
|
+
|
80
|
+
result = get_function_name(mcp_tool)
|
81
|
+
|
82
|
+
assert result == "create_repository"
|
83
|
+
|
84
|
+
|
72
85
|
@pytest.mark.parametrize(
|
73
86
|
"toolkit,action,description,expected_result",
|
74
87
|
[
|
@@ -28,7 +28,7 @@ from vellum.workflows.references.lazy import LazyReference
|
|
28
28
|
from vellum.workflows.state import BaseState
|
29
29
|
from vellum.workflows.state.encoder import DefaultStateEncoder
|
30
30
|
from vellum.workflows.types.core import EntityInputsInterface, MergeBehavior, Tool
|
31
|
-
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition
|
31
|
+
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition, MCPToolDefinition
|
32
32
|
from vellum.workflows.types.generics import is_workflow_class
|
33
33
|
|
34
34
|
CHAT_HISTORY_VARIABLE = "chat_history"
|
@@ -379,6 +379,8 @@ def create_function_node(
|
|
379
379
|
},
|
380
380
|
)
|
381
381
|
return node
|
382
|
+
elif isinstance(function, MCPToolDefinition):
|
383
|
+
pass
|
382
384
|
elif is_workflow_class(function):
|
383
385
|
node = type(
|
384
386
|
f"DynamicInlineSubworkflowNode_{function.__name__}",
|
@@ -410,5 +412,7 @@ def get_function_name(function: Tool) -> str:
|
|
410
412
|
return name.replace("-", "")
|
411
413
|
elif isinstance(function, ComposioToolDefinition):
|
412
414
|
return function.name
|
415
|
+
elif isinstance(function, MCPToolDefinition):
|
416
|
+
return function.name
|
413
417
|
else:
|
414
418
|
return snake_case(function.__name__)
|
vellum/workflows/types/core.py
CHANGED
@@ -13,7 +13,7 @@ from typing import ( # type: ignore[attr-defined]
|
|
13
13
|
)
|
14
14
|
|
15
15
|
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
16
|
-
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition
|
16
|
+
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition, MCPToolDefinition
|
17
17
|
|
18
18
|
if TYPE_CHECKING:
|
19
19
|
from vellum.workflows.workflows.base import BaseWorkflow
|
@@ -50,4 +50,4 @@ class ConditionType(Enum):
|
|
50
50
|
|
51
51
|
|
52
52
|
# Type alias for functions that can be called in tool calling nodes
|
53
|
-
Tool = Union[Callable[..., Any], DeploymentDefinition, Type["BaseWorkflow"], ComposioToolDefinition]
|
53
|
+
Tool = Union[Callable[..., Any], DeploymentDefinition, Type["BaseWorkflow"], ComposioToolDefinition, MCPToolDefinition]
|
@@ -8,6 +8,9 @@ from pydantic import BeforeValidator
|
|
8
8
|
|
9
9
|
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
10
10
|
from vellum.client.types.code_resource_definition import CodeResourceDefinition as ClientCodeResourceDefinition
|
11
|
+
from vellum.client.types.vellum_secret import VellumSecret
|
12
|
+
from vellum.workflows.constants import AuthorizationType
|
13
|
+
from vellum.workflows.references.environment_variable import EnvironmentVariableReference
|
11
14
|
|
12
15
|
|
13
16
|
def serialize_type_encoder(obj: type) -> Dict[str, Any]:
|
@@ -118,3 +121,21 @@ class ComposioToolDefinition(UniversalBaseModel):
|
|
118
121
|
def name(self) -> str:
|
119
122
|
"""Generate a function name for this tool"""
|
120
123
|
return self.action.lower()
|
124
|
+
|
125
|
+
|
126
|
+
class MCPServer(UniversalBaseModel):
|
127
|
+
name: str
|
128
|
+
url: str
|
129
|
+
authorization_type: AuthorizationType = AuthorizationType.BEARER_TOKEN
|
130
|
+
bearer_token_value: Optional[Union[str, EnvironmentVariableReference]] = None
|
131
|
+
api_key_header_key: Optional[str] = None
|
132
|
+
api_key_header_value: Optional[Union[str, VellumSecret]] = None
|
133
|
+
|
134
|
+
model_config = {"arbitrary_types_allowed": True}
|
135
|
+
|
136
|
+
|
137
|
+
class MCPToolDefinition(UniversalBaseModel):
|
138
|
+
name: str
|
139
|
+
server: MCPServer
|
140
|
+
description: Optional[str] = None
|
141
|
+
parameters: Dict[str, Any] = {}
|
@@ -1,7 +1,10 @@
|
|
1
1
|
import pytest
|
2
2
|
from uuid import UUID
|
3
3
|
|
4
|
-
from vellum.
|
4
|
+
from vellum.client.types.vellum_secret import VellumSecret
|
5
|
+
from vellum.workflows.constants import AuthorizationType
|
6
|
+
from vellum.workflows.references.environment_variable import EnvironmentVariableReference
|
7
|
+
from vellum.workflows.types.definition import ComposioToolDefinition, DeploymentDefinition, MCPServer, MCPToolDefinition
|
5
8
|
|
6
9
|
|
7
10
|
@pytest.mark.parametrize(
|
@@ -44,3 +47,78 @@ def test_composio_tool_definition_creation():
|
|
44
47
|
assert composio_tool.description == "Create a new issue in a GitHub repository"
|
45
48
|
assert composio_tool.display_name is None
|
46
49
|
assert composio_tool.name == "github_create_an_issue"
|
50
|
+
|
51
|
+
|
52
|
+
def test_mcp_tool_definition_creation_bearer_token():
|
53
|
+
"""Test that MCPToolDefinition can be created with required fields."""
|
54
|
+
mcp_tool = MCPToolDefinition(
|
55
|
+
name="create_repository",
|
56
|
+
server=MCPServer(
|
57
|
+
name="github",
|
58
|
+
url="https://api.githubcopilot.com/mcp/",
|
59
|
+
authorization_type=AuthorizationType.BEARER_TOKEN,
|
60
|
+
bearer_token_value=EnvironmentVariableReference(name="GITHUB_PERSONAL_ACCESS_TOKEN"),
|
61
|
+
),
|
62
|
+
parameters={
|
63
|
+
"type": "object",
|
64
|
+
"properties": {
|
65
|
+
"repository_name": {"type": "string", "description": "Repository name"},
|
66
|
+
"description": {"type": "string", "description": "Repository description"},
|
67
|
+
},
|
68
|
+
"required": ["repository_name"],
|
69
|
+
},
|
70
|
+
)
|
71
|
+
|
72
|
+
assert mcp_tool.name == "create_repository"
|
73
|
+
assert mcp_tool.server.name == "github"
|
74
|
+
assert mcp_tool.server.url == "https://api.githubcopilot.com/mcp/"
|
75
|
+
assert mcp_tool.server.authorization_type == AuthorizationType.BEARER_TOKEN
|
76
|
+
assert mcp_tool.parameters == {
|
77
|
+
"type": "object",
|
78
|
+
"properties": {
|
79
|
+
"repository_name": {"type": "string", "description": "Repository name"},
|
80
|
+
"description": {"type": "string", "description": "Repository description"},
|
81
|
+
},
|
82
|
+
"required": ["repository_name"],
|
83
|
+
}
|
84
|
+
|
85
|
+
assert isinstance(mcp_tool.server.bearer_token_value, EnvironmentVariableReference)
|
86
|
+
assert mcp_tool.server.bearer_token_value.name == "GITHUB_PERSONAL_ACCESS_TOKEN"
|
87
|
+
|
88
|
+
|
89
|
+
def test_mcp_tool_definition_creation_api_key():
|
90
|
+
"""Test that MCPToolDefinition can be created with required fields."""
|
91
|
+
mcp_tool = MCPToolDefinition(
|
92
|
+
name="create_repository",
|
93
|
+
server=MCPServer(
|
94
|
+
name="github",
|
95
|
+
url="https://api.githubcopilot.com/mcp/",
|
96
|
+
authorization_type=AuthorizationType.API_KEY,
|
97
|
+
api_key_header_key="Authorization",
|
98
|
+
api_key_header_value=VellumSecret(name="GITHUB_PERSONAL_ACCESS_TOKEN"),
|
99
|
+
),
|
100
|
+
parameters={
|
101
|
+
"type": "object",
|
102
|
+
"properties": {
|
103
|
+
"repository_name": {"type": "string", "description": "Repository name"},
|
104
|
+
"description": {"type": "string", "description": "Repository description"},
|
105
|
+
},
|
106
|
+
"required": ["repository_name"],
|
107
|
+
},
|
108
|
+
)
|
109
|
+
|
110
|
+
assert mcp_tool.name == "create_repository"
|
111
|
+
assert mcp_tool.server.name == "github"
|
112
|
+
assert mcp_tool.server.url == "https://api.githubcopilot.com/mcp/"
|
113
|
+
assert mcp_tool.server.authorization_type == AuthorizationType.API_KEY
|
114
|
+
assert mcp_tool.server.api_key_header_key == "Authorization"
|
115
|
+
assert isinstance(mcp_tool.server.api_key_header_value, VellumSecret)
|
116
|
+
assert mcp_tool.server.api_key_header_value.name == "GITHUB_PERSONAL_ACCESS_TOKEN"
|
117
|
+
assert mcp_tool.parameters == {
|
118
|
+
"type": "object",
|
119
|
+
"properties": {
|
120
|
+
"repository_name": {"type": "string", "description": "Repository name"},
|
121
|
+
"description": {"type": "string", "description": "Repository description"},
|
122
|
+
},
|
123
|
+
"required": ["repository_name"],
|
124
|
+
}
|
@@ -8,7 +8,7 @@ vellum_cli/init.py,sha256=WpnMXPItPmh0f0bBGIer3p-e5gu8DUGwSArT_FuoMEw,5093
|
|
8
8
|
vellum_cli/logger.py,sha256=dcM_OmgqXLo93vDYswO5ylyUQQcTfnA5GTd5tbIt3wM,1446
|
9
9
|
vellum_cli/ping.py,sha256=p_BCCRjgPhng6JktuECtkDQLbhopt6JpmrtGoLnLJT8,1161
|
10
10
|
vellum_cli/pull.py,sha256=udYyPlJ6VKDdh78rApNJOZgxHl82fcV6iGnRPSdX1LY,14750
|
11
|
-
vellum_cli/push.py,sha256=
|
11
|
+
vellum_cli/push.py,sha256=hzBBD7Rc-11Dyu6_JfHeLI03c4XKAYQZZoq1SCNyXpM,11547
|
12
12
|
vellum_cli/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
vellum_cli/tests/conftest.py,sha256=wx3PlJjVB0HRf5dr2b_idOIw27WPPl0J0FNbhIJJaVk,1689
|
14
14
|
vellum_cli/tests/test_config.py,sha256=uvKGDc8BoVyT9_H0Z-g8469zVxomn6Oi3Zj-vK7O_wU,2631
|
@@ -145,7 +145,7 @@ vellum/client/README.md,sha256=Dle5iytCXxP1pNeNd7uZyhFo0rl7tp7vU7s8gmi10OQ,4863
|
|
145
145
|
vellum/client/__init__.py,sha256=KmkyOgReuTsjmXF3WC_dPQ9QqJgYrB3Sr8_LcSUIQyI,125258
|
146
146
|
vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
147
147
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
148
|
-
vellum/client/core/client_wrapper.py,sha256
|
148
|
+
vellum/client/core/client_wrapper.py,sha256=-AFplaIvuzgdfFXfodBM9oR_i0p48jofC_DkscIsYRE,2383
|
149
149
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
150
150
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
151
151
|
vellum/client/core/http_client.py,sha256=cKs2w0ybDBk1wHQf-fTALm_MmvaMe3cZKcYJxqmCxkE,19539
|
@@ -1700,8 +1700,8 @@ vellum/workflows/nodes/displayable/tool_calling_node/state.py,sha256=oQg_GAtc349
|
|
1700
1700
|
vellum/workflows/nodes/displayable/tool_calling_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1701
1701
|
vellum/workflows/nodes/displayable/tool_calling_node/tests/test_composio_service.py,sha256=UV0vZpU7-_tHcwnIq36WKwHrJXNurU4bdC3rfaw8eoU,4804
|
1702
1702
|
vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py,sha256=raY_E5-EgtYNXEPbO2I-Ythe4YeuFdGsXGZ_BAN98uI,7979
|
1703
|
-
vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py,sha256=
|
1704
|
-
vellum/workflows/nodes/displayable/tool_calling_node/utils.py,sha256=
|
1703
|
+
vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py,sha256=prl8GRwSBOgIorjBJkaYrp6XJjXNuaoedg3Lxt269j0,8303
|
1704
|
+
vellum/workflows/nodes/displayable/tool_calling_node/utils.py,sha256=rj9UTNDOi3sx_Rbc4DfBOtBpMTHut9piwlALN9n0zE0,16706
|
1705
1705
|
vellum/workflows/nodes/experimental/README.md,sha256=eF6DfIL8t-HbF9-mcofOMymKrraiBHDLKTlnBa51ZiE,284
|
1706
1706
|
vellum/workflows/nodes/experimental/__init__.py,sha256=jCQgvZEknXKfuNhGSOou4XPfrPqZ1_XBj5F0n0fgiWM,106
|
1707
1707
|
vellum/workflows/nodes/experimental/openai_chat_completion_node/__init__.py,sha256=lsyD9laR9p7kx5-BXGH2gUTM242UhKy8SMV0SR6S2iE,90
|
@@ -1748,12 +1748,12 @@ vellum/workflows/tests/test_sandbox.py,sha256=JKwaluI-lODQo7Ek9sjDstjL_WTdSqUlVi
|
|
1748
1748
|
vellum/workflows/tests/test_undefined.py,sha256=zMCVliCXVNLrlC6hEGyOWDnQADJ2g83yc5FIM33zuo8,353
|
1749
1749
|
vellum/workflows/types/__init__.py,sha256=KxUTMBGzuRCfiMqzzsykOeVvrrkaZmTTo1a7SLu8gRM,68
|
1750
1750
|
vellum/workflows/types/code_execution_node_wrappers.py,sha256=3MNIoFZKzVzNS5qFLVuDwMV17QJw72zo7NRf52yMq5A,3074
|
1751
|
-
vellum/workflows/types/core.py,sha256=
|
1752
|
-
vellum/workflows/types/definition.py,sha256=
|
1751
|
+
vellum/workflows/types/core.py,sha256=Vykj9o6fEnS13M1LwJDh9FVgua03acqigBqyYOiJiq8,1352
|
1752
|
+
vellum/workflows/types/definition.py,sha256=pK0fAXHw7C0AFpCoM4WGe1_MD-usupF4-m6ldo5AQXY,4568
|
1753
1753
|
vellum/workflows/types/generics.py,sha256=8jptbEx1fnJV0Lhj0MpCJOT6yNiEWeTOYOwrEAb5CRU,1576
|
1754
1754
|
vellum/workflows/types/stack.py,sha256=h7NE0vXR7l9DevFBIzIAk1Zh59K-kECQtDTKOUunwMY,1314
|
1755
1755
|
vellum/workflows/types/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1756
|
-
vellum/workflows/types/tests/test_definition.py,sha256=
|
1756
|
+
vellum/workflows/types/tests/test_definition.py,sha256=RsDoicu8A1dqJOGa-Ok866K8lnzn5L0Hez3lQijYD4c,5011
|
1757
1757
|
vellum/workflows/types/tests/test_utils.py,sha256=UnZog59tR577mVwqZRqqWn2fScoOU1H6up0EzS8zYhw,2536
|
1758
1758
|
vellum/workflows/types/utils.py,sha256=mTctHITBybpt4855x32oCKALBEcMNLn-9cCmfEKgJHQ,6498
|
1759
1759
|
vellum/workflows/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1774,8 +1774,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
|
|
1774
1774
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1775
1775
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=ptMntHzVyy8ZuzNgeTuk7hREgKQ5UBdgq8VJFSGaW4Y,20832
|
1776
1776
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1777
|
-
vellum_ai-1.0.
|
1778
|
-
vellum_ai-1.0.
|
1779
|
-
vellum_ai-1.0.
|
1780
|
-
vellum_ai-1.0.
|
1781
|
-
vellum_ai-1.0.
|
1777
|
+
vellum_ai-1.0.8.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1778
|
+
vellum_ai-1.0.8.dist-info/METADATA,sha256=qMK12xNOQpaw7B4-wciOlrjn7mmS4zzPS9ALMXFIb_c,5554
|
1779
|
+
vellum_ai-1.0.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1780
|
+
vellum_ai-1.0.8.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1781
|
+
vellum_ai-1.0.8.dist-info/RECORD,,
|
vellum_cli/push.py
CHANGED
@@ -95,8 +95,9 @@ def push_command(
|
|
95
95
|
and workflow_config.workflow_sandbox_id
|
96
96
|
and workflow_config.workflow_sandbox_id != workflow_sandbox_id
|
97
97
|
):
|
98
|
-
|
99
|
-
f"Workflow sandbox id '{workflow_sandbox_id}' is already associated with '{workflow_config.module}'."
|
98
|
+
logger.warning(
|
99
|
+
f"Workflow sandbox id '{workflow_sandbox_id}' is already associated with '{workflow_config.module}'. "
|
100
|
+
f"Continuing with the provided workflow sandbox id '{workflow_sandbox_id}'."
|
100
101
|
)
|
101
102
|
|
102
103
|
client = create_vellum_client(
|
File without changes
|
File without changes
|
File without changes
|