vellum-ai 0.10.0__py3-none-any.whl → 0.10.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +8 -0
- vellum/client/README.md +1 -1
- vellum/client/__init__.py +4 -0
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/resources/__init__.py +2 -0
- vellum/client/resources/deployments/client.py +117 -0
- vellum/client/resources/ml_models/__init__.py +2 -0
- vellum/client/resources/ml_models/client.py +125 -0
- vellum/client/resources/workflow_deployments/client.py +117 -0
- vellum/client/types/__init__.py +6 -0
- vellum/client/types/deployment_history_item.py +44 -0
- vellum/client/types/ml_model_read.py +27 -0
- vellum/client/types/workflow_deployment_history_item.py +45 -0
- vellum/resources/ml_models/__init__.py +3 -0
- vellum/resources/ml_models/client.py +3 -0
- vellum/types/deployment_history_item.py +3 -0
- vellum/types/ml_model_read.py +3 -0
- vellum/types/workflow_deployment_history_item.py +3 -0
- vellum/workflows/nodes/__init__.py +4 -3
- vellum/workflows/nodes/core/__init__.py +2 -0
- vellum/workflows/nodes/displayable/bases/search_node.py +10 -3
- vellum/workflows/nodes/displayable/search_node/node.py +12 -5
- vellum/workflows/references/execution_count.py +4 -0
- {vellum_ai-0.10.0.dist-info → vellum_ai-0.10.2.dist-info}/METADATA +3 -3
- {vellum_ai-0.10.0.dist-info → vellum_ai-0.10.2.dist-info}/RECORD +36 -25
- vellum_cli/__init__.py +3 -2
- vellum_cli/pull.py +17 -4
- vellum_cli/tests/test_pull.py +18 -0
- vellum_ee/py.typed +0 -0
- vellum_ee/workflows/display/nodes/vellum/conditional_node.py +20 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +148 -42
- vellum_ee/workflows/display/utils/vellum.py +16 -11
- vellum_ee/workflows/display/vellum.py +10 -1
- {vellum_ai-0.10.0.dist-info → vellum_ai-0.10.2.dist-info}/LICENSE +0 -0
- {vellum_ai-0.10.0.dist-info → vellum_ai-0.10.2.dist-info}/WHEEL +0 -0
- {vellum_ai-0.10.0.dist-info → vellum_ai-0.10.2.dist-info}/entry_points.txt +0 -0
@@ -4,10 +4,16 @@ from unittest import mock
|
|
4
4
|
from deepdiff import DeepDiff
|
5
5
|
|
6
6
|
from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
|
7
|
-
from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import
|
8
|
-
|
7
|
+
from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import (
|
8
|
+
create_simple_workflow,
|
9
|
+
)
|
10
|
+
from vellum_ee.workflows.display.nodes.base_node_vellum_display import (
|
11
|
+
BaseNodeVellumDisplay,
|
12
|
+
)
|
9
13
|
from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
|
10
|
-
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import
|
14
|
+
from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import (
|
15
|
+
get_workflow_display,
|
16
|
+
)
|
11
17
|
from vellum.workflows.expressions.begins_with import BeginsWithExpression
|
12
18
|
from vellum.workflows.expressions.between import BetweenExpression
|
13
19
|
from vellum.workflows.expressions.contains import ContainsExpression
|
@@ -18,12 +24,16 @@ from vellum.workflows.expressions.does_not_equal import DoesNotEqualExpression
|
|
18
24
|
from vellum.workflows.expressions.ends_with import EndsWithExpression
|
19
25
|
from vellum.workflows.expressions.equals import EqualsExpression
|
20
26
|
from vellum.workflows.expressions.greater_than import GreaterThanExpression
|
21
|
-
from vellum.workflows.expressions.greater_than_or_equal_to import
|
27
|
+
from vellum.workflows.expressions.greater_than_or_equal_to import (
|
28
|
+
GreaterThanOrEqualToExpression,
|
29
|
+
)
|
22
30
|
from vellum.workflows.expressions.in_ import InExpression
|
23
31
|
from vellum.workflows.expressions.is_not_null import IsNotNullExpression
|
24
32
|
from vellum.workflows.expressions.is_null import IsNullExpression
|
25
33
|
from vellum.workflows.expressions.less_than import LessThanExpression
|
26
|
-
from vellum.workflows.expressions.less_than_or_equal_to import
|
34
|
+
from vellum.workflows.expressions.less_than_or_equal_to import (
|
35
|
+
LessThanOrEqualToExpression,
|
36
|
+
)
|
27
37
|
from vellum.workflows.expressions.not_between import NotBetweenExpression
|
28
38
|
from vellum.workflows.expressions.not_in import NotInExpression
|
29
39
|
|
@@ -31,7 +41,9 @@ from vellum.workflows.expressions.not_in import NotInExpression
|
|
31
41
|
def test_serialize_workflow():
|
32
42
|
# GIVEN a Workflow that uses a ConditionalNode
|
33
43
|
# WHEN we serialize it
|
34
|
-
workflow_display = get_workflow_display(
|
44
|
+
workflow_display = get_workflow_display(
|
45
|
+
base_display_class=VellumWorkflowDisplay, workflow_class=CategoryWorkflow
|
46
|
+
)
|
35
47
|
|
36
48
|
# TODO: Support serialization of BaseNode
|
37
49
|
# https://app.shortcut.com/vellum/story/4871/support-serialization-of-base-node
|
@@ -69,11 +81,31 @@ def test_serialize_workflow():
|
|
69
81
|
assert len(output_variables) == 5
|
70
82
|
assert not DeepDiff(
|
71
83
|
[
|
72
|
-
{
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
84
|
+
{
|
85
|
+
"id": "c05f7d96-59a0-4d58-93d7-d451afd3f630",
|
86
|
+
"key": "question",
|
87
|
+
"type": "STRING",
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"id": "93f2cb75-6fa2-4e46-9488-c0bcd29153c0",
|
91
|
+
"key": "compliment",
|
92
|
+
"type": "STRING",
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"id": "f936ae31-ba15-4864-8961-86231022a4d7",
|
96
|
+
"key": "complaint",
|
97
|
+
"type": "STRING",
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"id": "cdbe2adf-9951-409a-b9a8-b8b349037f4f",
|
101
|
+
"key": "statement",
|
102
|
+
"type": "STRING",
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"id": "62ad462f-f819-4940-99ab-b3f145507f57",
|
106
|
+
"key": "fallthrough",
|
107
|
+
"type": "STRING",
|
108
|
+
},
|
77
109
|
],
|
78
110
|
output_variables,
|
79
111
|
ignore_order=True,
|
@@ -124,7 +156,9 @@ def test_serialize_workflow():
|
|
124
156
|
"rules": [
|
125
157
|
{
|
126
158
|
"type": "INPUT_VARIABLE",
|
127
|
-
"data": {
|
159
|
+
"data": {
|
160
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
161
|
+
},
|
128
162
|
}
|
129
163
|
],
|
130
164
|
"combinator": "OR",
|
@@ -134,7 +168,12 @@ def test_serialize_workflow():
|
|
134
168
|
"id": "1fb4cf46-f8b3-418f-be30-f7ec57f92285",
|
135
169
|
"key": "708bb538-4c77-4ae9-8e87-0706346e2947.value",
|
136
170
|
"value": {
|
137
|
-
"rules": [
|
171
|
+
"rules": [
|
172
|
+
{
|
173
|
+
"type": "CONSTANT_VALUE",
|
174
|
+
"data": {"type": "STRING", "value": "question"},
|
175
|
+
}
|
176
|
+
],
|
138
177
|
"combinator": "OR",
|
139
178
|
},
|
140
179
|
},
|
@@ -145,7 +184,9 @@ def test_serialize_workflow():
|
|
145
184
|
"rules": [
|
146
185
|
{
|
147
186
|
"type": "INPUT_VARIABLE",
|
148
|
-
"data": {
|
187
|
+
"data": {
|
188
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
189
|
+
},
|
149
190
|
}
|
150
191
|
],
|
151
192
|
"combinator": "OR",
|
@@ -155,7 +196,12 @@ def test_serialize_workflow():
|
|
155
196
|
"id": "40957176-de6e-4131-bfa7-55c633312af0",
|
156
197
|
"key": "ddee5d1d-46e9-4ae8-b0a8-311747ebadd4.value",
|
157
198
|
"value": {
|
158
|
-
"rules": [
|
199
|
+
"rules": [
|
200
|
+
{
|
201
|
+
"type": "CONSTANT_VALUE",
|
202
|
+
"data": {"type": "STRING", "value": "complaint"},
|
203
|
+
}
|
204
|
+
],
|
159
205
|
"combinator": "OR",
|
160
206
|
},
|
161
207
|
},
|
@@ -166,7 +212,9 @@ def test_serialize_workflow():
|
|
166
212
|
"rules": [
|
167
213
|
{
|
168
214
|
"type": "INPUT_VARIABLE",
|
169
|
-
"data": {
|
215
|
+
"data": {
|
216
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
217
|
+
},
|
170
218
|
}
|
171
219
|
],
|
172
220
|
"combinator": "OR",
|
@@ -176,7 +224,12 @@ def test_serialize_workflow():
|
|
176
224
|
"id": "93f06582-aff7-4ce5-8c60-f923090ffebc",
|
177
225
|
"key": "73157578-205a-4816-8985-cf726063647c.value",
|
178
226
|
"value": {
|
179
|
-
"rules": [
|
227
|
+
"rules": [
|
228
|
+
{
|
229
|
+
"type": "CONSTANT_VALUE",
|
230
|
+
"data": {"type": "STRING", "value": "compliment"},
|
231
|
+
}
|
232
|
+
],
|
180
233
|
"combinator": "OR",
|
181
234
|
},
|
182
235
|
},
|
@@ -187,7 +240,9 @@ def test_serialize_workflow():
|
|
187
240
|
"rules": [
|
188
241
|
{
|
189
242
|
"type": "INPUT_VARIABLE",
|
190
|
-
"data": {
|
243
|
+
"data": {
|
244
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
245
|
+
},
|
191
246
|
}
|
192
247
|
],
|
193
248
|
"combinator": "OR",
|
@@ -197,7 +252,12 @@ def test_serialize_workflow():
|
|
197
252
|
"id": "e759091b-3609-4581-9014-5f46f438a4c9",
|
198
253
|
"key": "e805add5-7f7f-443d-b9bc-11ad15eeb49c.value",
|
199
254
|
"value": {
|
200
|
-
"rules": [
|
255
|
+
"rules": [
|
256
|
+
{
|
257
|
+
"type": "CONSTANT_VALUE",
|
258
|
+
"data": {"type": "STRING", "value": "statement"},
|
259
|
+
}
|
260
|
+
],
|
201
261
|
"combinator": "OR",
|
202
262
|
},
|
203
263
|
},
|
@@ -208,7 +268,9 @@ def test_serialize_workflow():
|
|
208
268
|
"rules": [
|
209
269
|
{
|
210
270
|
"type": "INPUT_VARIABLE",
|
211
|
-
"data": {
|
271
|
+
"data": {
|
272
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
273
|
+
},
|
212
274
|
}
|
213
275
|
],
|
214
276
|
"combinator": "OR",
|
@@ -218,7 +280,12 @@ def test_serialize_workflow():
|
|
218
280
|
"id": "e915cd85-ae55-48be-b31c-f2285db9db10",
|
219
281
|
"key": "f47d72ff-665f-4143-ada3-6fa66f5bda42.value",
|
220
282
|
"value": {
|
221
|
-
"rules": [
|
283
|
+
"rules": [
|
284
|
+
{
|
285
|
+
"type": "CONSTANT_VALUE",
|
286
|
+
"data": {"type": "STRING", "value": "statement"},
|
287
|
+
}
|
288
|
+
],
|
222
289
|
"combinator": "OR",
|
223
290
|
},
|
224
291
|
},
|
@@ -229,7 +296,9 @@ def test_serialize_workflow():
|
|
229
296
|
"rules": [
|
230
297
|
{
|
231
298
|
"type": "INPUT_VARIABLE",
|
232
|
-
"data": {
|
299
|
+
"data": {
|
300
|
+
"input_variable_id": "eece050a-432e-4a2c-8c87-9480397e4cbf"
|
301
|
+
},
|
233
302
|
}
|
234
303
|
],
|
235
304
|
"combinator": "OR",
|
@@ -239,7 +308,12 @@ def test_serialize_workflow():
|
|
239
308
|
"id": "e5d75ae4-cd46-437e-9695-9df2d79578b4",
|
240
309
|
"key": "d3359d60-9bb4-4c6e-8009-b7ea46ab28a7.value",
|
241
310
|
"value": {
|
242
|
-
"rules": [
|
311
|
+
"rules": [
|
312
|
+
{
|
313
|
+
"type": "CONSTANT_VALUE",
|
314
|
+
"data": {"type": "STRING", "value": "statement"},
|
315
|
+
}
|
316
|
+
],
|
243
317
|
"combinator": "OR",
|
244
318
|
},
|
245
319
|
},
|
@@ -377,8 +451,11 @@ def test_serialize_workflow():
|
|
377
451
|
},
|
378
452
|
"display_data": {"position": {"x": 0.0, "y": 0.0}},
|
379
453
|
"definition": {
|
454
|
+
"name": "CategoryConditionalNode",
|
455
|
+
"module": ["tests", "workflows", "basic_conditional_node", "workflow"],
|
380
456
|
"bases": [
|
381
457
|
{
|
458
|
+
"name": "ConditionalNode",
|
382
459
|
"module": [
|
383
460
|
"vellum",
|
384
461
|
"workflows",
|
@@ -387,16 +464,8 @@ def test_serialize_workflow():
|
|
387
464
|
"conditional_node",
|
388
465
|
"node",
|
389
466
|
],
|
390
|
-
"name": "ConditionalNode",
|
391
467
|
}
|
392
468
|
],
|
393
|
-
"module": [
|
394
|
-
"tests",
|
395
|
-
"workflows",
|
396
|
-
"basic_conditional_node",
|
397
|
-
"workflow",
|
398
|
-
],
|
399
|
-
"name": "CategoryConditionalNode",
|
400
469
|
},
|
401
470
|
},
|
402
471
|
conditional_node,
|
@@ -860,11 +929,15 @@ def descriptors_with_value_and_start_and_end():
|
|
860
929
|
|
861
930
|
|
862
931
|
@pytest.mark.parametrize("descriptor, operator", descriptors_with_lhs_and_rhs())
|
863
|
-
def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
932
|
+
def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
|
933
|
+
descriptor, operator
|
934
|
+
):
|
864
935
|
# GIVEN a simple workflow with one conditional node
|
865
936
|
workflow_cls = create_simple_workflow(descriptor)
|
866
937
|
|
867
|
-
workflow_display = get_workflow_display(
|
938
|
+
workflow_display = get_workflow_display(
|
939
|
+
base_display_class=VellumWorkflowDisplay, workflow_class=workflow_cls
|
940
|
+
)
|
868
941
|
|
869
942
|
# TODO: Support serialization of BaseNode
|
870
943
|
# https://app.shortcut.com/vellum/story/4871/support-serialization-of-base-node
|
@@ -894,7 +967,12 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(descriptor, o
|
|
894
967
|
"id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
|
895
968
|
"key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
|
896
969
|
"value": {
|
897
|
-
"rules": [
|
970
|
+
"rules": [
|
971
|
+
{
|
972
|
+
"type": "CONSTANT_VALUE",
|
973
|
+
"data": {"type": "STRING", "value": "123"},
|
974
|
+
}
|
975
|
+
],
|
898
976
|
"combinator": "OR",
|
899
977
|
},
|
900
978
|
},
|
@@ -902,7 +980,12 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(descriptor, o
|
|
902
980
|
"id": "aadade8a-c253-483a-8620-31fe8171c0fd",
|
903
981
|
"key": "abe7afac-952f-4cfc-ab07-47b47f34105f.value",
|
904
982
|
"value": {
|
905
|
-
"rules": [
|
983
|
+
"rules": [
|
984
|
+
{
|
985
|
+
"type": "CONSTANT_VALUE",
|
986
|
+
"data": {"type": "STRING", "value": "123"},
|
987
|
+
}
|
988
|
+
],
|
906
989
|
"combinator": "OR",
|
907
990
|
},
|
908
991
|
},
|
@@ -972,7 +1055,9 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
972
1055
|
# GIVEN a simple workflow with one conditional node
|
973
1056
|
workflow_cls = create_simple_workflow(descriptor)
|
974
1057
|
|
975
|
-
workflow_display = get_workflow_display(
|
1058
|
+
workflow_display = get_workflow_display(
|
1059
|
+
base_display_class=VellumWorkflowDisplay, workflow_class=workflow_cls
|
1060
|
+
)
|
976
1061
|
|
977
1062
|
# TODO: Support serialization of BaseNode
|
978
1063
|
# https://app.shortcut.com/vellum/story/4871/support-serialization-of-base-node
|
@@ -1002,7 +1087,12 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1002
1087
|
"id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
|
1003
1088
|
"key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
|
1004
1089
|
"value": {
|
1005
|
-
"rules": [
|
1090
|
+
"rules": [
|
1091
|
+
{
|
1092
|
+
"type": "CONSTANT_VALUE",
|
1093
|
+
"data": {"type": "STRING", "value": "123"},
|
1094
|
+
}
|
1095
|
+
],
|
1006
1096
|
"combinator": "OR",
|
1007
1097
|
},
|
1008
1098
|
}
|
@@ -1067,12 +1157,18 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
|
|
1067
1157
|
)
|
1068
1158
|
|
1069
1159
|
|
1070
|
-
@pytest.mark.parametrize(
|
1071
|
-
|
1160
|
+
@pytest.mark.parametrize(
|
1161
|
+
"descriptor, operator", descriptors_with_value_and_start_and_end()
|
1162
|
+
)
|
1163
|
+
def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
|
1164
|
+
descriptor, operator
|
1165
|
+
):
|
1072
1166
|
# GIVEN a simple workflow with one conditional node
|
1073
1167
|
workflow_cls = create_simple_workflow(descriptor)
|
1074
1168
|
|
1075
|
-
workflow_display = get_workflow_display(
|
1169
|
+
workflow_display = get_workflow_display(
|
1170
|
+
base_display_class=VellumWorkflowDisplay, workflow_class=workflow_cls
|
1171
|
+
)
|
1076
1172
|
|
1077
1173
|
# TODO: Support serialization of BaseNode
|
1078
1174
|
# https://app.shortcut.com/vellum/story/4871/support-serialization-of-base-node
|
@@ -1102,7 +1198,12 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(d
|
|
1102
1198
|
"id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
|
1103
1199
|
"key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
|
1104
1200
|
"value": {
|
1105
|
-
"rules": [
|
1201
|
+
"rules": [
|
1202
|
+
{
|
1203
|
+
"type": "CONSTANT_VALUE",
|
1204
|
+
"data": {"type": "STRING", "value": "123"},
|
1205
|
+
}
|
1206
|
+
],
|
1106
1207
|
"combinator": "OR",
|
1107
1208
|
},
|
1108
1209
|
},
|
@@ -1110,7 +1211,12 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(d
|
|
1110
1211
|
"id": "aadade8a-c253-483a-8620-31fe8171c0fd",
|
1111
1212
|
"key": "abe7afac-952f-4cfc-ab07-47b47f34105f.value",
|
1112
1213
|
"value": {
|
1113
|
-
"rules": [
|
1214
|
+
"rules": [
|
1215
|
+
{
|
1216
|
+
"type": "CONSTANT_VALUE",
|
1217
|
+
"data": {"type": "STRING", "value": "123,123"},
|
1218
|
+
}
|
1219
|
+
],
|
1114
1220
|
"combinator": "OR",
|
1115
1221
|
},
|
1116
1222
|
},
|
@@ -4,11 +4,20 @@ import typing
|
|
4
4
|
from typing import Any, List, Union, cast
|
5
5
|
|
6
6
|
from vellum import ChatMessage, SearchResult, SearchResultRequest, VellumVariableType
|
7
|
-
|
7
|
+
from vellum.workflows.descriptors.base import BaseDescriptor
|
8
|
+
from vellum.workflows.references import OutputReference, WorkflowInputReference
|
9
|
+
from vellum.workflows.references.execution_count import ExecutionCountReference
|
10
|
+
from vellum.workflows.references.node import NodeReference
|
11
|
+
from vellum.workflows.references.vellum_secret import VellumSecretReference
|
12
|
+
from vellum.workflows.types.core import VellumValuePrimitive
|
13
|
+
from vellum.workflows.utils.vellum_variables import primitive_type_to_vellum_variable_type
|
14
|
+
from vellum.workflows.vellum_client import create_vellum_client
|
8
15
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
9
16
|
from vellum_ee.workflows.display.vellum import (
|
10
17
|
ChatHistoryVellumValue,
|
11
18
|
ConstantValuePointer,
|
19
|
+
ExecutionCounterData,
|
20
|
+
ExecutionCounterPointer,
|
12
21
|
InputVariableData,
|
13
22
|
InputVariablePointer,
|
14
23
|
JsonVellumValue,
|
@@ -22,13 +31,6 @@ from vellum_ee.workflows.display.vellum import (
|
|
22
31
|
WorkspaceSecretData,
|
23
32
|
WorkspaceSecretPointer,
|
24
33
|
)
|
25
|
-
from vellum.workflows.descriptors.base import BaseDescriptor
|
26
|
-
from vellum.workflows.references import OutputReference, WorkflowInputReference
|
27
|
-
from vellum.workflows.references.node import NodeReference
|
28
|
-
from vellum.workflows.references.vellum_secret import VellumSecretReference
|
29
|
-
from vellum.workflows.types.core import VellumValuePrimitive
|
30
|
-
from vellum.workflows.utils.vellum_variables import primitive_type_to_vellum_variable_type
|
31
|
-
from vellum.workflows.vellum_client import create_vellum_client
|
32
34
|
|
33
35
|
_T = typing.TypeVar("_T")
|
34
36
|
|
@@ -61,13 +63,12 @@ def create_node_input_value_pointer_rule(
|
|
61
63
|
upstream_node, output_display = display_context.node_output_displays[value]
|
62
64
|
upstream_node_display = display_context.node_displays[upstream_node]
|
63
65
|
return NodeOutputPointer(
|
64
|
-
type="NODE_OUTPUT",
|
65
66
|
data=NodeOutputData(node_id=str(upstream_node_display.node_id), output_id=str(output_display.id)),
|
66
67
|
)
|
67
68
|
if isinstance(value, WorkflowInputReference):
|
68
69
|
workflow_input_display = display_context.workflow_input_displays[value]
|
69
70
|
return InputVariablePointer(
|
70
|
-
|
71
|
+
data=InputVariableData(input_variable_id=str(workflow_input_display.id))
|
71
72
|
)
|
72
73
|
if isinstance(value, VellumSecretReference):
|
73
74
|
# TODO: Pass through the name instead of retrieving the ID
|
@@ -77,12 +78,16 @@ def create_node_input_value_pointer_rule(
|
|
77
78
|
id=value.name,
|
78
79
|
)
|
79
80
|
return WorkspaceSecretPointer(
|
80
|
-
type="WORKSPACE_SECRET",
|
81
81
|
data=WorkspaceSecretData(
|
82
82
|
type="STRING",
|
83
83
|
workspace_secret_id=str(workspace_secret.id),
|
84
84
|
),
|
85
85
|
)
|
86
|
+
if isinstance(value, ExecutionCountReference):
|
87
|
+
node_class_display = display_context.node_displays[value.node_class]
|
88
|
+
return ExecutionCounterPointer(
|
89
|
+
data=ExecutionCounterData(node_id=str(node_class_display.node_id)),
|
90
|
+
)
|
86
91
|
|
87
92
|
if not isinstance(value, BaseDescriptor):
|
88
93
|
vellum_value = primitive_to_vellum_value(value)
|
@@ -7,7 +7,6 @@ from pydantic import Field
|
|
7
7
|
|
8
8
|
from vellum import ChatMessage, PromptParameters, SearchResult, SearchResultRequest, VellumVariable, VellumVariableType
|
9
9
|
from vellum.core import UniversalBaseModel
|
10
|
-
|
11
10
|
from vellum_ee.workflows.display.base import (
|
12
11
|
EdgeDisplay,
|
13
12
|
EdgeDisplayOverrides,
|
@@ -211,11 +210,21 @@ class WorkspaceSecretPointer(UniversalBaseModel):
|
|
211
210
|
data: WorkspaceSecretData
|
212
211
|
|
213
212
|
|
213
|
+
class ExecutionCounterData(UniversalBaseModel):
|
214
|
+
node_id: str
|
215
|
+
|
216
|
+
|
217
|
+
class ExecutionCounterPointer(UniversalBaseModel):
|
218
|
+
type: Literal["EXECUTION_COUNTER"] = "EXECUTION_COUNTER"
|
219
|
+
data: ExecutionCounterData
|
220
|
+
|
221
|
+
|
214
222
|
NodeInputValuePointerRule = Union[
|
215
223
|
NodeOutputPointer,
|
216
224
|
InputVariablePointer,
|
217
225
|
ConstantValuePointer,
|
218
226
|
WorkspaceSecretPointer,
|
227
|
+
ExecutionCounterPointer,
|
219
228
|
]
|
220
229
|
|
221
230
|
|
File without changes
|
File without changes
|
File without changes
|