vellum-ai 1.0.11__py3-none-any.whl → 1.1.1__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/__init__.py +2 -2
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -877
- vellum/client/core/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/http_response.py +47 -0
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +22 -696
- vellum/client/resources/__init__.py +0 -2
- vellum/client/resources/ad_hoc/client.py +55 -161
- vellum/client/resources/ad_hoc/raw_client.py +278 -0
- vellum/client/resources/container_images/client.py +62 -172
- vellum/client/resources/container_images/raw_client.py +400 -0
- vellum/client/resources/deployments/client.py +112 -437
- vellum/client/resources/deployments/raw_client.py +995 -0
- vellum/client/resources/document_indexes/client.py +108 -317
- vellum/client/resources/document_indexes/raw_client.py +847 -0
- vellum/client/resources/documents/client.py +88 -285
- vellum/client/resources/documents/raw_client.py +655 -0
- vellum/client/resources/folder_entities/client.py +54 -92
- vellum/client/resources/folder_entities/raw_client.py +277 -0
- vellum/client/resources/metric_definitions/client.py +48 -95
- vellum/client/resources/metric_definitions/raw_client.py +225 -0
- vellum/client/resources/ml_models/client.py +36 -40
- vellum/client/resources/ml_models/raw_client.py +103 -0
- vellum/client/resources/organizations/client.py +34 -39
- vellum/client/resources/organizations/raw_client.py +96 -0
- vellum/client/resources/prompts/client.py +50 -193
- vellum/client/resources/prompts/raw_client.py +346 -0
- vellum/client/resources/sandboxes/client.py +68 -141
- vellum/client/resources/sandboxes/raw_client.py +393 -0
- vellum/client/resources/test_suite_runs/client.py +58 -141
- vellum/client/resources/test_suite_runs/raw_client.py +355 -0
- vellum/client/resources/test_suites/client.py +73 -141
- vellum/client/resources/test_suites/raw_client.py +379 -0
- vellum/client/resources/workflow_deployments/client.py +203 -328
- vellum/client/resources/workflow_deployments/raw_client.py +931 -0
- vellum/client/resources/workflow_executions/client.py +36 -40
- vellum/client/resources/workflow_executions/raw_client.py +97 -0
- vellum/client/resources/workflow_sandboxes/client.py +60 -108
- vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
- vellum/client/resources/workflows/client.py +68 -133
- vellum/client/resources/workflows/raw_client.py +307 -0
- vellum/client/resources/workspace_secrets/client.py +46 -90
- vellum/client/resources/workspace_secrets/raw_client.py +220 -0
- vellum/client/resources/workspaces/client.py +34 -39
- vellum/client/resources/workspaces/raw_client.py +96 -0
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/api_request_parent_context.py +1 -0
- vellum/client/types/external_parent_context.py +36 -0
- vellum/client/types/node_execution_fulfilled_event.py +1 -0
- vellum/client/types/node_execution_initiated_event.py +1 -0
- vellum/client/types/node_execution_paused_event.py +1 -0
- vellum/client/types/node_execution_rejected_event.py +1 -0
- vellum/client/types/node_execution_resumed_event.py +1 -0
- vellum/client/types/node_execution_span.py +1 -0
- vellum/client/types/node_execution_span_attributes.py +1 -0
- vellum/client/types/node_execution_streaming_event.py +1 -0
- vellum/client/types/node_parent_context.py +1 -0
- vellum/client/types/parent_context.py +2 -0
- vellum/client/types/prompt_deployment_parent_context.py +1 -0
- vellum/client/types/slim_workflow_execution_read.py +1 -0
- vellum/client/types/span_link.py +1 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +1 -0
- vellum/client/types/workflow_deployment_parent_context.py +1 -0
- vellum/client/types/workflow_event_execution_read.py +1 -0
- vellum/client/types/workflow_execution_detail.py +1 -0
- vellum/client/types/workflow_execution_fulfilled_event.py +1 -0
- vellum/client/types/workflow_execution_initiated_event.py +1 -0
- vellum/client/types/workflow_execution_paused_event.py +1 -0
- vellum/client/types/workflow_execution_rejected_event.py +1 -0
- vellum/client/types/workflow_execution_resumed_event.py +1 -0
- vellum/client/types/workflow_execution_snapshotted_event.py +1 -0
- vellum/client/types/workflow_execution_span.py +1 -0
- vellum/client/types/workflow_execution_span_attributes.py +1 -0
- vellum/client/types/workflow_execution_streaming_event.py +1 -0
- vellum/client/types/workflow_parent_context.py +1 -0
- vellum/client/types/workflow_sandbox_parent_context.py +1 -0
- vellum/{resources/release_reviews/__init__.py → core/http_response.py} +1 -1
- vellum/{resources/release_reviews/client.py → raw_client.py} +1 -1
- vellum/resources/ad_hoc/raw_client.py +3 -0
- vellum/resources/container_images/raw_client.py +3 -0
- vellum/resources/deployments/raw_client.py +3 -0
- vellum/resources/document_indexes/raw_client.py +3 -0
- vellum/resources/documents/raw_client.py +3 -0
- vellum/resources/folder_entities/raw_client.py +3 -0
- vellum/resources/metric_definitions/raw_client.py +3 -0
- vellum/resources/ml_models/raw_client.py +3 -0
- vellum/resources/organizations/raw_client.py +3 -0
- vellum/resources/prompts/raw_client.py +3 -0
- vellum/resources/sandboxes/raw_client.py +3 -0
- vellum/resources/test_suite_runs/raw_client.py +3 -0
- vellum/resources/test_suites/raw_client.py +3 -0
- vellum/resources/workflow_deployments/raw_client.py +3 -0
- vellum/resources/workflow_executions/raw_client.py +3 -0
- vellum/resources/workflow_sandboxes/raw_client.py +3 -0
- vellum/resources/workflows/raw_client.py +3 -0
- vellum/resources/workspace_secrets/raw_client.py +3 -0
- vellum/resources/workspaces/raw_client.py +3 -0
- vellum/types/external_parent_context.py +3 -0
- vellum/workflows/emitters/vellum_emitter.py +3 -2
- vellum/workflows/events/types.py +6 -0
- vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +5 -15
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +6 -0
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +75 -0
- vellum/workflows/state/context.py +13 -2
- vellum/workflows/types/definition.py +2 -2
- vellum/workflows/types/tests/test_definition.py +2 -3
- vellum/workflows/utils/functions.py +1 -1
- vellum/workflows/utils/tests/test_functions.py +3 -3
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/RECORD +123 -81
- vellum_ee/workflows/display/exceptions.py +7 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +93 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +98 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py +1 -1
- vellum_ee/workflows/display/utils/expressions.py +1 -1
- vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
- vellum/client/resources/release_reviews/__init__.py +0 -2
- vellum/client/resources/release_reviews/client.py +0 -139
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/entry_points.txt +0 -0
@@ -6,6 +6,7 @@ from vellum.client.core.api_error import ApiError
|
|
6
6
|
from vellum.workflows.nodes.displayable.code_execution_node.node import CodeExecutionNode
|
7
7
|
from vellum.workflows.references.vellum_secret import VellumSecretReference
|
8
8
|
from vellum.workflows.workflows.base import BaseWorkflow
|
9
|
+
from vellum_ee.workflows.display.exceptions import NodeValidationError
|
9
10
|
from vellum_ee.workflows.display.nodes.vellum.code_execution_node import BaseCodeExecutionNodeDisplay
|
10
11
|
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
11
12
|
|
@@ -166,6 +167,56 @@ def test_serialize_node__with_non_exist_code_input_path():
|
|
166
167
|
|
167
168
|
# WHEN we serialize the workflow
|
168
169
|
workflow_display = get_workflow_display(workflow_class=Workflow)
|
169
|
-
with pytest.raises(
|
170
|
+
with pytest.raises(NodeValidationError) as exc_info:
|
170
171
|
workflow_display.serialize()
|
171
|
-
assert "Filepath 'non_existent_file.py'
|
172
|
+
assert "Filepath 'non_existent_file.py' does not exist" in str(exc_info.value)
|
173
|
+
|
174
|
+
|
175
|
+
def test_serialize_node__with_non_exist_code_input_path_with_dry_run():
|
176
|
+
# GIVEN a code node with a non-existent code input path
|
177
|
+
class MyNode(CodeExecutionNode):
|
178
|
+
filepath = "non_existent_file.py"
|
179
|
+
|
180
|
+
# AND a workflow with the code node
|
181
|
+
class Workflow(BaseWorkflow):
|
182
|
+
graph = MyNode
|
183
|
+
|
184
|
+
# WHEN we serialize the workflow with dry_run=True
|
185
|
+
workflow_display = get_workflow_display(workflow_class=Workflow, dry_run=True)
|
186
|
+
data: dict = workflow_display.serialize()
|
187
|
+
|
188
|
+
# THEN the workflow should not raise an error
|
189
|
+
assert data == {
|
190
|
+
"workflow_raw_data": {
|
191
|
+
"nodes": [
|
192
|
+
{
|
193
|
+
"id": "9b9e2a5d-01a4-46b2-80a3-d9484b2c0e08",
|
194
|
+
"type": "ENTRYPOINT",
|
195
|
+
"inputs": [],
|
196
|
+
"data": {"label": "Entrypoint Node", "source_handle_id": "3e2a3f52-5047-4e2e-9a21-37bd43c63250"},
|
197
|
+
"display_data": {"position": {"x": 0.0, "y": -50.0}},
|
198
|
+
"base": None,
|
199
|
+
"definition": None,
|
200
|
+
}
|
201
|
+
],
|
202
|
+
"edges": [
|
203
|
+
{
|
204
|
+
"id": "ab6ef06e-df2c-4877-9c3e-9d7261b39748",
|
205
|
+
"source_node_id": "9b9e2a5d-01a4-46b2-80a3-d9484b2c0e08",
|
206
|
+
"source_handle_id": "3e2a3f52-5047-4e2e-9a21-37bd43c63250",
|
207
|
+
"target_node_id": "ac90c0ce-f393-438c-a24f-e5e9a9286182",
|
208
|
+
"target_handle_id": "3a39ea63-9f86-4891-a902-0216a7190720",
|
209
|
+
"type": "DEFAULT",
|
210
|
+
}
|
211
|
+
],
|
212
|
+
"display_data": {"viewport": {"x": 0.0, "y": 0.0, "zoom": 1.0}},
|
213
|
+
"definition": {
|
214
|
+
"name": "Workflow",
|
215
|
+
"module": ["vellum_ee", "workflows", "display", "nodes", "vellum", "tests", "test_code_execution_node"],
|
216
|
+
},
|
217
|
+
"output_values": [],
|
218
|
+
},
|
219
|
+
"input_variables": [],
|
220
|
+
"state_variables": [],
|
221
|
+
"output_variables": [],
|
222
|
+
}
|
@@ -3,6 +3,7 @@ from vellum.workflows.inputs import BaseInputs
|
|
3
3
|
from vellum.workflows.nodes.displayable.inline_prompt_node.node import InlinePromptNode
|
4
4
|
from vellum.workflows.nodes.displayable.tool_calling_node.node import ToolCallingNode
|
5
5
|
from vellum.workflows.state.base import BaseState
|
6
|
+
from vellum.workflows.types.definition import AuthorizationType, EnvironmentVariableReference, MCPServer
|
6
7
|
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
7
8
|
|
8
9
|
|
@@ -122,3 +123,95 @@ def test_serialize_node__prompt_inputs__mixed_values():
|
|
122
123
|
],
|
123
124
|
},
|
124
125
|
}
|
126
|
+
|
127
|
+
|
128
|
+
def test_serialize_node__tool_calling_node__mcp_server_api_key():
|
129
|
+
# GIVEN a tool calling node with an mcp server
|
130
|
+
class MyToolCallingNode(ToolCallingNode):
|
131
|
+
functions = [
|
132
|
+
MCPServer(
|
133
|
+
name="my-mcp-server",
|
134
|
+
url="https://my-mcp-server.com",
|
135
|
+
authorization_type=AuthorizationType.API_KEY,
|
136
|
+
api_key_header_key="my-api-key-header-key",
|
137
|
+
api_key_header_value=EnvironmentVariableReference(name="my-api-key-header-value"),
|
138
|
+
)
|
139
|
+
]
|
140
|
+
|
141
|
+
# AND a workflow with the tool calling node
|
142
|
+
class Workflow(BaseWorkflow):
|
143
|
+
graph = MyToolCallingNode
|
144
|
+
|
145
|
+
# WHEN the workflow is serialized
|
146
|
+
workflow_display = get_workflow_display(workflow_class=Workflow)
|
147
|
+
serialized_workflow: dict = workflow_display.serialize()
|
148
|
+
|
149
|
+
# THEN the node should properly serialize the mcp server
|
150
|
+
my_tool_calling_node = next(
|
151
|
+
node
|
152
|
+
for node in serialized_workflow["workflow_raw_data"]["nodes"]
|
153
|
+
if node["id"] == str(MyToolCallingNode.__id__)
|
154
|
+
)
|
155
|
+
|
156
|
+
functions_attribute = next(
|
157
|
+
attribute for attribute in my_tool_calling_node["attributes"] if attribute["name"] == "functions"
|
158
|
+
)
|
159
|
+
|
160
|
+
assert functions_attribute == {
|
161
|
+
"id": "6c0f7d4f-3c8a-4201-b588-8398d3c97480",
|
162
|
+
"name": "functions",
|
163
|
+
"value": {
|
164
|
+
"type": "ARRAY_REFERENCE",
|
165
|
+
"items": [
|
166
|
+
{
|
167
|
+
"type": "DICTIONARY_REFERENCE",
|
168
|
+
"entries": [
|
169
|
+
{
|
170
|
+
"id": "bcf2713b-19fc-4b4b-8ff5-b45c8e63c665",
|
171
|
+
"key": "type",
|
172
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "MCP_SERVER"}},
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"id": "4e00439e-ce6f-4e0a-be4c-0fc05990ec44",
|
176
|
+
"key": "name",
|
177
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "my-mcp-server"}},
|
178
|
+
},
|
179
|
+
{
|
180
|
+
"id": "9a3dcca9-4595-4efb-ada6-c011721f7018",
|
181
|
+
"key": "url",
|
182
|
+
"value": {
|
183
|
+
"type": "CONSTANT_VALUE",
|
184
|
+
"value": {"type": "STRING", "value": "https://my-mcp-server.com"},
|
185
|
+
},
|
186
|
+
},
|
187
|
+
{
|
188
|
+
"id": "21c3a6ce-7607-42a4-92b8-9d7c4061edce",
|
189
|
+
"key": "authorization_type",
|
190
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "API_KEY"}},
|
191
|
+
},
|
192
|
+
{
|
193
|
+
"id": "dcf8e8f0-84d2-4ffb-b0e6-218c569015a4",
|
194
|
+
"key": "bearer_token_value",
|
195
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"id": "fe93f516-42c0-40cf-b476-50bd04857d5f",
|
199
|
+
"key": "api_key_header_key",
|
200
|
+
"value": {
|
201
|
+
"type": "CONSTANT_VALUE",
|
202
|
+
"value": {"type": "STRING", "value": "my-api-key-header-key"},
|
203
|
+
},
|
204
|
+
},
|
205
|
+
{
|
206
|
+
"id": "750ed8ca-3bf3-46be-96f0-2c92d19d2084",
|
207
|
+
"key": "api_key_header_value",
|
208
|
+
"value": {
|
209
|
+
"type": "ENVIRONMENT_VARIABLE",
|
210
|
+
"environment_variable": "my-api-key-header-value",
|
211
|
+
},
|
212
|
+
},
|
213
|
+
],
|
214
|
+
}
|
215
|
+
],
|
216
|
+
},
|
217
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
from deepdiff import DeepDiff
|
2
|
+
|
3
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
|
4
|
+
|
5
|
+
from tests.workflows.basic_tool_calling_node_mcp_tool.workflow import BasicToolCallingNodeMCPWorkflow
|
6
|
+
|
7
|
+
|
8
|
+
def test_serialize_workflow():
|
9
|
+
# GIVEN a Workflow that uses a generic node
|
10
|
+
# WHEN we serialize it
|
11
|
+
workflow_display = get_workflow_display(workflow_class=BasicToolCallingNodeMCPWorkflow)
|
12
|
+
|
13
|
+
serialized_workflow: dict = workflow_display.serialize()
|
14
|
+
# THEN we should get a serialized representation of the Workflow
|
15
|
+
assert serialized_workflow.keys() == {
|
16
|
+
"workflow_raw_data",
|
17
|
+
"input_variables",
|
18
|
+
"state_variables",
|
19
|
+
"output_variables",
|
20
|
+
}
|
21
|
+
|
22
|
+
# AND its input variables should be what we expect
|
23
|
+
input_variables = serialized_workflow["input_variables"]
|
24
|
+
assert len(input_variables) == 1
|
25
|
+
|
26
|
+
# AND its output variables should be what we expect
|
27
|
+
output_variables = serialized_workflow["output_variables"]
|
28
|
+
assert len(output_variables) == 2
|
29
|
+
assert not DeepDiff(
|
30
|
+
[
|
31
|
+
{"id": "3934525a-4807-4dd3-a44f-8569033fece1", "key": "text", "type": "STRING"},
|
32
|
+
{"id": "a6ba35f0-306b-45a4-ad79-c1e9b9a5515c", "key": "chat_history", "type": "CHAT_HISTORY"},
|
33
|
+
],
|
34
|
+
output_variables,
|
35
|
+
ignore_order=True,
|
36
|
+
)
|
37
|
+
|
38
|
+
# AND its raw data should be what we expect
|
39
|
+
workflow_raw_data = serialized_workflow["workflow_raw_data"]
|
40
|
+
tool_calling_node = workflow_raw_data["nodes"][1]
|
41
|
+
function_attributes = next(
|
42
|
+
(attribute for attribute in tool_calling_node["attributes"] if attribute["name"] == "functions"),
|
43
|
+
)
|
44
|
+
assert function_attributes == {
|
45
|
+
"id": "20adf593-c4f0-4c67-8e36-37eb66f28f66",
|
46
|
+
"name": "functions",
|
47
|
+
"value": {
|
48
|
+
"type": "ARRAY_REFERENCE",
|
49
|
+
"items": [
|
50
|
+
{
|
51
|
+
"type": "DICTIONARY_REFERENCE",
|
52
|
+
"entries": [
|
53
|
+
{
|
54
|
+
"id": "bcf2713b-19fc-4b4b-8ff5-b45c8e63c665",
|
55
|
+
"key": "type",
|
56
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "MCP_SERVER"}},
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"id": "5a3aef6f-b8a1-4f37-8688-b513da42a35a",
|
60
|
+
"key": "name",
|
61
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "github"}},
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"id": "641decf3-79c5-4ef9-9fc8-06570d8a69af",
|
65
|
+
"key": "url",
|
66
|
+
"value": {
|
67
|
+
"type": "CONSTANT_VALUE",
|
68
|
+
"value": {"type": "STRING", "value": "https://api.githubcopilot.com/mcp/"},
|
69
|
+
},
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"id": "801a74ca-7966-4ac3-b1b5-bebb71a7de07",
|
73
|
+
"key": "authorization_type",
|
74
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "STRING", "value": "BEARER_TOKEN"}},
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"id": "fcd70e2f-0fb2-4011-a73b-90d5d7643be4",
|
78
|
+
"key": "bearer_token_value",
|
79
|
+
"value": {
|
80
|
+
"type": "ENVIRONMENT_VARIABLE",
|
81
|
+
"environment_variable": "GITHUB_PERSONAL_ACCESS_TOKEN",
|
82
|
+
},
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"id": "b2fa2900-0e09-44ff-99db-c5399fd76d28",
|
86
|
+
"key": "api_key_header_key",
|
87
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"id": "6ab23414-5f1b-49c1-a0bc-891bbba9124c",
|
91
|
+
"key": "api_key_header_value",
|
92
|
+
"value": {"type": "CONSTANT_VALUE", "value": {"type": "JSON", "value": None}},
|
93
|
+
},
|
94
|
+
],
|
95
|
+
}
|
96
|
+
],
|
97
|
+
},
|
98
|
+
}
|
@@ -19,7 +19,7 @@ from tests.workflows.basic_tool_calling_node_workflow_deployment.workflow import
|
|
19
19
|
|
20
20
|
|
21
21
|
def test_serialize_workflow(vellum_client):
|
22
|
-
vellum_client.
|
22
|
+
vellum_client.workflow_deployments.retrieve_workflow_deployment_release.return_value = WorkflowDeploymentRelease(
|
23
23
|
id="test-id",
|
24
24
|
created=datetime.now(),
|
25
25
|
environment=ReleaseEnvironment(
|
@@ -358,7 +358,7 @@ def serialize_value(display_context: "WorkflowDisplayContext", value: Any) -> Js
|
|
358
358
|
}
|
359
359
|
|
360
360
|
if isinstance(value, DeploymentDefinition):
|
361
|
-
workflow_deployment_release = display_context.client.
|
361
|
+
workflow_deployment_release = display_context.client.workflow_deployments.retrieve_workflow_deployment_release(
|
362
362
|
value.deployment, value.release_tag
|
363
363
|
)
|
364
364
|
name = workflow_deployment_release.deployment.name or value.deployment
|
@@ -35,6 +35,7 @@ from vellum_ee.workflows.display.base import (
|
|
35
35
|
WorkflowOutputDisplay,
|
36
36
|
)
|
37
37
|
from vellum_ee.workflows.display.editor.types import NodeDisplayData, NodeDisplayPosition
|
38
|
+
from vellum_ee.workflows.display.exceptions import NodeValidationError
|
38
39
|
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
39
40
|
from vellum_ee.workflows.display.nodes.get_node_display_class import get_node_display_class
|
40
41
|
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay
|
@@ -194,7 +195,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
194
195
|
|
195
196
|
try:
|
196
197
|
serialized_node = node_display.serialize(self.display_context)
|
197
|
-
except NotImplementedError as e:
|
198
|
+
except (NotImplementedError, NodeValidationError) as e:
|
198
199
|
self.add_error(e)
|
199
200
|
continue
|
200
201
|
|
@@ -1,139 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
from ...core.client_wrapper import SyncClientWrapper
|
4
|
-
import typing
|
5
|
-
from ...core.request_options import RequestOptions
|
6
|
-
from ...types.workflow_deployment_release import WorkflowDeploymentRelease
|
7
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
8
|
-
from ...core.pydantic_utilities import parse_obj_as
|
9
|
-
from json.decoder import JSONDecodeError
|
10
|
-
from ...core.api_error import ApiError
|
11
|
-
from ...core.client_wrapper import AsyncClientWrapper
|
12
|
-
|
13
|
-
|
14
|
-
class ReleaseReviewsClient:
|
15
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
16
|
-
self._client_wrapper = client_wrapper
|
17
|
-
|
18
|
-
def retrieve_workflow_deployment_release(
|
19
|
-
self, id: str, release_id_or_release_tag: str, *, request_options: typing.Optional[RequestOptions] = None
|
20
|
-
) -> WorkflowDeploymentRelease:
|
21
|
-
"""
|
22
|
-
Retrieve a specific Workflow Deployment Release by either its UUID or the name of a Release Tag that points to it.
|
23
|
-
|
24
|
-
Parameters
|
25
|
-
----------
|
26
|
-
id : str
|
27
|
-
Either the Workflow Deployment's ID or its unique name
|
28
|
-
|
29
|
-
release_id_or_release_tag : str
|
30
|
-
Either the UUID of Workflow Deployment Release you'd like to retrieve, or the name of a Release Tag that's pointing to the Workflow Deployment Release you'd like to retrieve.
|
31
|
-
|
32
|
-
request_options : typing.Optional[RequestOptions]
|
33
|
-
Request-specific configuration.
|
34
|
-
|
35
|
-
Returns
|
36
|
-
-------
|
37
|
-
WorkflowDeploymentRelease
|
38
|
-
|
39
|
-
|
40
|
-
Examples
|
41
|
-
--------
|
42
|
-
from vellum import Vellum
|
43
|
-
|
44
|
-
client = Vellum(
|
45
|
-
api_version="YOUR_API_VERSION",
|
46
|
-
api_key="YOUR_API_KEY",
|
47
|
-
)
|
48
|
-
client.release_reviews.retrieve_workflow_deployment_release(
|
49
|
-
id="id",
|
50
|
-
release_id_or_release_tag="release_id_or_release_tag",
|
51
|
-
)
|
52
|
-
"""
|
53
|
-
_response = self._client_wrapper.httpx_client.request(
|
54
|
-
f"v1/workflow-deployments/{jsonable_encoder(id)}/releases/{jsonable_encoder(release_id_or_release_tag)}",
|
55
|
-
base_url=self._client_wrapper.get_environment().default,
|
56
|
-
method="GET",
|
57
|
-
request_options=request_options,
|
58
|
-
)
|
59
|
-
try:
|
60
|
-
if 200 <= _response.status_code < 300:
|
61
|
-
return typing.cast(
|
62
|
-
WorkflowDeploymentRelease,
|
63
|
-
parse_obj_as(
|
64
|
-
type_=WorkflowDeploymentRelease, # type: ignore
|
65
|
-
object_=_response.json(),
|
66
|
-
),
|
67
|
-
)
|
68
|
-
_response_json = _response.json()
|
69
|
-
except JSONDecodeError:
|
70
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
71
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
72
|
-
|
73
|
-
|
74
|
-
class AsyncReleaseReviewsClient:
|
75
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
76
|
-
self._client_wrapper = client_wrapper
|
77
|
-
|
78
|
-
async def retrieve_workflow_deployment_release(
|
79
|
-
self, id: str, release_id_or_release_tag: str, *, request_options: typing.Optional[RequestOptions] = None
|
80
|
-
) -> WorkflowDeploymentRelease:
|
81
|
-
"""
|
82
|
-
Retrieve a specific Workflow Deployment Release by either its UUID or the name of a Release Tag that points to it.
|
83
|
-
|
84
|
-
Parameters
|
85
|
-
----------
|
86
|
-
id : str
|
87
|
-
Either the Workflow Deployment's ID or its unique name
|
88
|
-
|
89
|
-
release_id_or_release_tag : str
|
90
|
-
Either the UUID of Workflow Deployment Release you'd like to retrieve, or the name of a Release Tag that's pointing to the Workflow Deployment Release you'd like to retrieve.
|
91
|
-
|
92
|
-
request_options : typing.Optional[RequestOptions]
|
93
|
-
Request-specific configuration.
|
94
|
-
|
95
|
-
Returns
|
96
|
-
-------
|
97
|
-
WorkflowDeploymentRelease
|
98
|
-
|
99
|
-
|
100
|
-
Examples
|
101
|
-
--------
|
102
|
-
import asyncio
|
103
|
-
|
104
|
-
from vellum import AsyncVellum
|
105
|
-
|
106
|
-
client = AsyncVellum(
|
107
|
-
api_version="YOUR_API_VERSION",
|
108
|
-
api_key="YOUR_API_KEY",
|
109
|
-
)
|
110
|
-
|
111
|
-
|
112
|
-
async def main() -> None:
|
113
|
-
await client.release_reviews.retrieve_workflow_deployment_release(
|
114
|
-
id="id",
|
115
|
-
release_id_or_release_tag="release_id_or_release_tag",
|
116
|
-
)
|
117
|
-
|
118
|
-
|
119
|
-
asyncio.run(main())
|
120
|
-
"""
|
121
|
-
_response = await self._client_wrapper.httpx_client.request(
|
122
|
-
f"v1/workflow-deployments/{jsonable_encoder(id)}/releases/{jsonable_encoder(release_id_or_release_tag)}",
|
123
|
-
base_url=self._client_wrapper.get_environment().default,
|
124
|
-
method="GET",
|
125
|
-
request_options=request_options,
|
126
|
-
)
|
127
|
-
try:
|
128
|
-
if 200 <= _response.status_code < 300:
|
129
|
-
return typing.cast(
|
130
|
-
WorkflowDeploymentRelease,
|
131
|
-
parse_obj_as(
|
132
|
-
type_=WorkflowDeploymentRelease, # type: ignore
|
133
|
-
object_=_response.json(),
|
134
|
-
),
|
135
|
-
)
|
136
|
-
_response_json = _response.json()
|
137
|
-
except JSONDecodeError:
|
138
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
139
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
File without changes
|
File without changes
|
File without changes
|