vellum-ai 0.14.23__py3-none-any.whl → 0.14.25__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/client/types/vellum_sdk_error.py +1 -1
- vellum/client/types/workflow_execution_event_error_code.py +1 -0
- vellum/plugins/pydantic.py +2 -0
- vellum/workflows/nodes/core/inline_subworkflow_node/node.py +6 -0
- vellum/workflows/nodes/core/inline_subworkflow_node/tests/test_node.py +27 -0
- vellum/workflows/nodes/displayable/guardrail_node/node.py +13 -1
- {vellum_ai-0.14.23.dist-info → vellum_ai-0.14.25.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.23.dist-info → vellum_ai-0.14.25.dist-info}/RECORD +29 -27
- vellum_ee/workflows/display/base.py +29 -14
- vellum_ee/workflows/display/editor/__init__.py +7 -0
- vellum_ee/workflows/display/editor/types.py +22 -0
- vellum_ee/workflows/display/nodes/base_node_display.py +4 -2
- vellum_ee/workflows/display/nodes/base_node_vellum_display.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/api_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/search_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +5 -11
- vellum_ee/workflows/display/nodes/vellum/utils.py +3 -4
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py +2 -1
- vellum_ee/workflows/display/types.py +19 -16
- vellum_ee/workflows/display/utils/expressions.py +6 -2
- vellum_ee/workflows/display/utils/vellum.py +59 -13
- vellum_ee/workflows/display/vellum.py +29 -100
- vellum_ee/workflows/display/workflows/base_workflow_display.py +99 -57
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +1 -1
- vellum_ee/workflows/display/workflows/vellum_workflow_display.py +2 -56
- {vellum_ai-0.14.23.dist-info → vellum_ai-0.14.25.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.23.dist-info → vellum_ai-0.14.25.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.23.dist-info → vellum_ai-0.14.25.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.25",
|
22
22
|
}
|
23
23
|
headers["X_API_KEY"] = self.api_key
|
24
24
|
return headers
|
@@ -8,8 +8,8 @@ import pydantic
|
|
8
8
|
|
9
9
|
|
10
10
|
class VellumSdkError(UniversalBaseModel):
|
11
|
-
code: VellumSdkErrorCodeEnum
|
12
11
|
message: str
|
12
|
+
code: VellumSdkErrorCodeEnum
|
13
13
|
|
14
14
|
if IS_PYDANTIC_V2:
|
15
15
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
vellum/plugins/pydantic.py
CHANGED
@@ -46,6 +46,8 @@ class OnValidatePython(ValidatePythonHandlerProtocol):
|
|
46
46
|
context: Optional[Dict[str, Any]] = None,
|
47
47
|
self_instance: Optional[Any] = None,
|
48
48
|
allow_partial: Union[bool, Literal["off", "on", "trailing-strings"]] = False,
|
49
|
+
by_alias: Optional[bool] = None,
|
50
|
+
by_name: Optional[bool] = None,
|
49
51
|
) -> None:
|
50
52
|
if not isinstance(input, dict):
|
51
53
|
return
|
@@ -13,6 +13,7 @@ from vellum.workflows.state.base import BaseState
|
|
13
13
|
from vellum.workflows.state.context import WorkflowContext
|
14
14
|
from vellum.workflows.types.core import EntityInputsInterface
|
15
15
|
from vellum.workflows.types.generics import InputsType, StateType
|
16
|
+
from vellum.workflows.utils.uuids import uuid4_from_hash
|
16
17
|
from vellum.workflows.workflows.event_filters import all_workflow_event_filter
|
17
18
|
|
18
19
|
if TYPE_CHECKING:
|
@@ -140,3 +141,8 @@ class InlineSubworkflowNode(
|
|
140
141
|
# Subclasses of InlineSubworkflowNode can override this method to provider their own
|
141
142
|
# approach to annotating the outputs class based on the `subworkflow.Outputs`
|
142
143
|
setattr(outputs_class, reference.name, reference)
|
144
|
+
|
145
|
+
if cls.__output_ids__ is None:
|
146
|
+
cls.__output_ids__ = {}
|
147
|
+
|
148
|
+
cls.__output_ids__[reference.name] = uuid4_from_hash(f"{cls.__id__}|{reference.name}")
|
@@ -116,3 +116,30 @@ def test_inline_subworkflow_node__base_inputs_validation():
|
|
116
116
|
# AND the error message should indicate the missing required input
|
117
117
|
assert e.value.code == WorkflowErrorCode.INVALID_INPUTS
|
118
118
|
assert "Required input variables required_input should have defined value" == str(e.value)
|
119
|
+
|
120
|
+
|
121
|
+
def test_inline_subworkflow_node__with_adornment():
|
122
|
+
# GIVEN a simple inline subworkflow with an output
|
123
|
+
class InnerNode(BaseNode):
|
124
|
+
class Outputs(BaseNode.Outputs):
|
125
|
+
final_output = "hello"
|
126
|
+
|
127
|
+
class TestSubworkflow(BaseWorkflow):
|
128
|
+
graph = InnerNode
|
129
|
+
|
130
|
+
class Outputs(BaseWorkflow.Outputs):
|
131
|
+
final_output = InnerNode.Outputs.final_output
|
132
|
+
|
133
|
+
# AND it's wrapped in a TryNode
|
134
|
+
@TryNode.wrap()
|
135
|
+
class TestNode(InlineSubworkflowNode):
|
136
|
+
subworkflow = TestSubworkflow
|
137
|
+
|
138
|
+
# THEN the wrapped node should have the correct output IDs
|
139
|
+
assert "final_output" in TestNode.__output_ids__
|
140
|
+
|
141
|
+
# AND when we run the node
|
142
|
+
node = TestNode()
|
143
|
+
outputs = list(node.run())
|
144
|
+
|
145
|
+
assert outputs[-1].name == "final_output" and outputs[-1].value == "hello"
|
@@ -34,6 +34,7 @@ class GuardrailNode(BaseNode[StateType], Generic[StateType]):
|
|
34
34
|
|
35
35
|
class Outputs(BaseOutputs):
|
36
36
|
score: float
|
37
|
+
log: Optional[str]
|
37
38
|
|
38
39
|
def run(self) -> Outputs:
|
39
40
|
metric_execution = self._context.vellum_client.metric_definitions.execute_metric_definition(
|
@@ -52,8 +53,19 @@ class GuardrailNode(BaseNode[StateType], Generic[StateType]):
|
|
52
53
|
code=WorkflowErrorCode.INVALID_OUTPUTS,
|
53
54
|
)
|
54
55
|
|
56
|
+
log = metric_outputs.get("log")
|
57
|
+
|
58
|
+
if log is not None and not isinstance(log, str):
|
59
|
+
raise NodeException(
|
60
|
+
message="Metric execution log output must be of type 'str'",
|
61
|
+
code=WorkflowErrorCode.INVALID_OUTPUTS,
|
62
|
+
)
|
63
|
+
if log:
|
64
|
+
metric_outputs.pop("log")
|
65
|
+
|
55
66
|
metric_outputs.pop("score")
|
56
|
-
|
67
|
+
|
68
|
+
return self.Outputs(score=score, log=log, **metric_outputs)
|
57
69
|
|
58
70
|
def _compile_metric_inputs(self) -> List[MetricDefinitionInput]:
|
59
71
|
# TODO: We may want to consolidate with prompt deployment input compilation
|
@@ -22,17 +22,19 @@ vellum_ee/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
vellum_ee/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
vellum_ee/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
vellum_ee/workflows/display/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
-
vellum_ee/workflows/display/base.py,sha256=
|
25
|
+
vellum_ee/workflows/display/base.py,sha256=_Hr-ie3P7Ww1rPtLF7bJuHvgBh7Tj-w6A_IWlT7WAC4,2256
|
26
|
+
vellum_ee/workflows/display/editor/__init__.py,sha256=MSAgY91xCEg2neH5d8jXx5wRdR962ftZVa6vO9BGq9k,167
|
27
|
+
vellum_ee/workflows/display/editor/types.py,sha256=x-tOOCJ6CF4HmiKDfCmcc3bOVfc1EBlP5o6u5WEfLoY,567
|
26
28
|
vellum_ee/workflows/display/nodes/__init__.py,sha256=436iSAh_Ex5tC68oEYvNgPu05ZVIAVXnS4PKGrQeZ0Y,321
|
27
|
-
vellum_ee/workflows/display/nodes/base_node_display.py,sha256=
|
28
|
-
vellum_ee/workflows/display/nodes/base_node_vellum_display.py,sha256=
|
29
|
+
vellum_ee/workflows/display/nodes/base_node_display.py,sha256=cHK2OxeM2gWOshMHjaDHxWbRxvjkNHxOXbajjkrgk1w,19094
|
30
|
+
vellum_ee/workflows/display/nodes/base_node_vellum_display.py,sha256=WXbfVoGHTfl_owas2WKHwcRhfLeu0cAI4qLmKxfxjOs,1707
|
29
31
|
vellum_ee/workflows/display/nodes/get_node_display_class.py,sha256=59Nht1XAxMcNESFV1VmECrF01lZMnGkB_9JWaTAFnv0,2214
|
30
32
|
vellum_ee/workflows/display/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
33
|
vellum_ee/workflows/display/nodes/tests/test_base_node_display.py,sha256=QqR3Ly0RNrXwOeLdW5nERDFt0gRPf76n1bPES6o5UN4,1093
|
32
34
|
vellum_ee/workflows/display/nodes/types.py,sha256=St1BB6no528OyELGiyRabWao0GGw6mLhstQAvEACbGk,247
|
33
35
|
vellum_ee/workflows/display/nodes/utils.py,sha256=sloya5TpXsnot1HURc9L51INwflRqUzHxRVnCS9Cd-4,973
|
34
36
|
vellum_ee/workflows/display/nodes/vellum/__init__.py,sha256=nUIgH2s0-7IbQRNrBhLPyRNe8YIrx3Yo9HeeW-aXXFk,1668
|
35
|
-
vellum_ee/workflows/display/nodes/vellum/api_node.py,sha256=
|
37
|
+
vellum_ee/workflows/display/nodes/vellum/api_node.py,sha256=RDsxyubod_zYc72_VaHUTfOZXsgrKv8g3fqZFS2_j8Y,8538
|
36
38
|
vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py,sha256=Bzqplrnx-bDIRD1JgU7036m8pSWSO45zEReNv8RJTu4,6379
|
37
39
|
vellum_ee/workflows/display/nodes/vellum/code_execution_node.py,sha256=IYx0nll0t-tsPcjfgpfHMZE4FJgMFIsOiaQanGLYF0Q,4410
|
38
40
|
vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=ybLIa4uclqVIy3VAQvI1ivg2tnK5Ug_1R5a69DFqL7E,11104
|
@@ -46,7 +48,7 @@ vellum_ee/workflows/display/nodes/vellum/merge_node.py,sha256=xtyecs9mJ_WEwVpP12
|
|
46
48
|
vellum_ee/workflows/display/nodes/vellum/note_node.py,sha256=TMb8txILu2uWjzoxaghjgjlzeBAgzn4vkP_8zSh2qoE,1151
|
47
49
|
vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py,sha256=9YR6MtxVq8Bavb0ud2lZX0t2Y_NUd-dY9kRgq8WBz-Y,3093
|
48
50
|
vellum_ee/workflows/display/nodes/vellum/retry_node.py,sha256=LgokATi7sSS38Fil-XjqoR4t7AMOJ-GzXRw6p606Svo,3397
|
49
|
-
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=
|
51
|
+
vellum_ee/workflows/display/nodes/vellum/search_node.py,sha256=Hn55mKO1Q6BBspQtbsurvJJqX7RjSSuEyRjUW29xvg0,9279
|
50
52
|
vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py,sha256=62baAElKoRKIoba0lLhnrXGWWx96B73VxKGxh7BaIxc,2612
|
51
53
|
vellum_ee/workflows/display/nodes/vellum/templating_node.py,sha256=5EWzdA3TSUPlbJhs4uo1KGH6eGtDXZucVhlUoc_xpl4,3242
|
52
54
|
vellum_ee/workflows/display/nodes/vellum/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -56,14 +58,14 @@ vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py,sha256=bg9INs
|
|
56
58
|
vellum_ee/workflows/display/nodes/vellum/tests/test_retry_node.py,sha256=NuIw8Yb42KUdoGi3Ur8_7VPg50IC4hNrwAkCociwqNk,2091
|
57
59
|
vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py,sha256=Us32jf_FQnLuT4Bs2o5JyHxihCTAN8ozZghWIR0pl9k,3459
|
58
60
|
vellum_ee/workflows/display/nodes/vellum/tests/test_try_node.py,sha256=mtzB8LJlFCHVFM4H5AanLp29gQfaVmnN4A4iaRGJHoI,2427
|
59
|
-
vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py,sha256=
|
61
|
+
vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py,sha256=8_4b_U2l60b3TPLTHiDd_lzk6gi-30FmNJreDVeG0oM,4876
|
60
62
|
vellum_ee/workflows/display/nodes/vellum/try_node.py,sha256=0ipBZMYm521tuwefQFgHOvTyTgiWVTkzxpQtnnmOAI0,4203
|
61
|
-
vellum_ee/workflows/display/nodes/vellum/utils.py,sha256=
|
63
|
+
vellum_ee/workflows/display/nodes/vellum/utils.py,sha256=MAoHDSURlLRJ9V8D6I6icclqGq2hExU_h7ABx6BWuJY,4733
|
62
64
|
vellum_ee/workflows/display/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
63
65
|
vellum_ee/workflows/display/tests/test_vellum_workflow_display.py,sha256=VD-4USiRlCcdC3Qe9WfdkxwFdircai0vqvuZCbELR84,9556
|
64
66
|
vellum_ee/workflows/display/tests/workflow_serialization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
65
67
|
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
|
-
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py,sha256=
|
68
|
+
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py,sha256=lXw_Zvhlf7b1z3dsZoDznDweF1O-AStibV7BYrEtr0M,2544
|
67
69
|
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py,sha256=4R8cZ98JsGmIq-kmt3q519c4nCI7wCy5ynAUCUNnvuI,15605
|
68
70
|
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py,sha256=PXoNUAgqfyNCAoYGWoo5D-_5SLEannn7SD08nxZmVe8,19781
|
69
71
|
vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py,sha256=s6_mnk0pkztU59wYpSfOFpMhAJaRjmyfxM6WJGtnD4Y,6456
|
@@ -87,16 +89,16 @@ vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_n
|
|
87
89
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py,sha256=UrueKI15Ez-DRfZpZH82o127v0LRXLP-s308kjDTPMI,4084
|
88
90
|
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py,sha256=eD5686C9nWC5s6t08vbAnm9qf9t53gYQM-E1FwAa75c,3035
|
89
91
|
vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py,sha256=zXTjfjUdji0WBu6ZhocvM4UiXEWFJIpds24sxV9TZT0,7714
|
90
|
-
vellum_ee/workflows/display/types.py,sha256=
|
92
|
+
vellum_ee/workflows/display/types.py,sha256=LOPqMVElveazfn2hIFQkpjtir-21W2MJohmwGcQ0Ab0,2544
|
91
93
|
vellum_ee/workflows/display/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
|
-
vellum_ee/workflows/display/utils/expressions.py,sha256=
|
93
|
-
vellum_ee/workflows/display/utils/vellum.py,sha256=
|
94
|
-
vellum_ee/workflows/display/vellum.py,sha256=
|
94
|
+
vellum_ee/workflows/display/utils/expressions.py,sha256=2u2o8Fqr-2C45FII01ej5rt6i8n2EEGiliXugK7buVw,1210
|
95
|
+
vellum_ee/workflows/display/utils/vellum.py,sha256=Pzmg9Xiq-hRaYxbOSDaJhIAQ4A0apQN6dURn_h5DnWI,9364
|
96
|
+
vellum_ee/workflows/display/vellum.py,sha256=Y41ZHHQfJfxxkIakHPEhuaSmlPJk7HdVfyKZTJJDzI0,3626
|
95
97
|
vellum_ee/workflows/display/workflows/__init__.py,sha256=kapXsC67VJcgSuiBMa86FdePG5A9kMB5Pi4Uy1O2ob4,207
|
96
|
-
vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=
|
98
|
+
vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=AyfrB1MZLWOF8OumihxJT6hwfjWCceh6jrzXfxiAkfw,20850
|
97
99
|
vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=kp0u8LN_2IwshLrhMImhpZx1hRyAcD5gXY-kDuuaGMQ,1269
|
98
|
-
vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=
|
99
|
-
vellum_ee/workflows/display/workflows/vellum_workflow_display.py,sha256=
|
100
|
+
vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=nD6_lZnNp56siVJwhlWzSEHdMaSKjvWlsJa31SqfQAE,10623
|
101
|
+
vellum_ee/workflows/display/workflows/vellum_workflow_display.py,sha256=fTp-fF4IeYJTgwC-WNrtda5O_ksp5h4JnD65zefrJ4o,14395
|
100
102
|
vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
103
|
vellum_ee/workflows/server/virtual_file_loader.py,sha256=ET-Q83W5Cgqzqz3qtFNwtS2nJEIcm3VtvR5kffsT3VY,2262
|
102
104
|
vellum_ee/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -126,7 +128,7 @@ vellum/client/README.md,sha256=JkCJjmMZl4jrPj46pkmL9dpK4gSzQQmP5I7z4aME4LY,4749
|
|
126
128
|
vellum/client/__init__.py,sha256=tKtdM1_GqmGq1gpi9ydWD_T-MM7fPn8QdHh8ww19cNI,117564
|
127
129
|
vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
128
130
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
129
|
-
vellum/client/core/client_wrapper.py,sha256=
|
131
|
+
vellum/client/core/client_wrapper.py,sha256=zFlsIV2xy7hRtKCi3BonxHsEUNqbr50eG39idgiPy_M,1869
|
130
132
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
131
133
|
vellum/client/core/file.py,sha256=X9IbmkZmB2bB_DpmZAO3crWdXagOakAyn6UCOCImCPg,2322
|
132
134
|
vellum/client/core/http_client.py,sha256=R0pQpCppnEtxccGvXl4uJ76s7ro_65Fo_erlNNLp_AI,19228
|
@@ -670,7 +672,7 @@ vellum/client/types/vellum_error_request.py,sha256=RacXJoIgR8MeXXWDMI76pkxLBhCRg
|
|
670
672
|
vellum/client/types/vellum_image.py,sha256=wkFRgxOkxFPrmRdWTO58_41_vk0HYn5k4xsc-5ywxEs,637
|
671
673
|
vellum/client/types/vellum_image_request.py,sha256=_Gr4L7PSY8PNQINyTy04hPdwLc8_bR1RTUWZ73RQRYM,644
|
672
674
|
vellum/client/types/vellum_node_execution_event.py,sha256=64a6Gw9pGD5andcz1VOXI3fRjpoA_xiwv2T9GK6HLpA,735
|
673
|
-
vellum/client/types/vellum_sdk_error.py,sha256=
|
675
|
+
vellum/client/types/vellum_sdk_error.py,sha256=1AyCu_sUa8gx5wUJg5EtDYbvs9uQPhZfHjns1X3n8gI,656
|
674
676
|
vellum/client/types/vellum_sdk_error_code_enum.py,sha256=9lqUnPRvUW9tk5GASIE57FO3bc1RJoBTGcuFk5mGMA8,460
|
675
677
|
vellum/client/types/vellum_secret.py,sha256=jru3nBCquZHZ3wEdpgKZNmy2WFh26PVKrTNaXeVSsZQ,555
|
676
678
|
vellum/client/types/vellum_span.py,sha256=V5P1z-OFqgQQAZjek2toYudlh-fCu0NTt5uKuKm9hd0,258
|
@@ -695,7 +697,7 @@ vellum/client/types/workflow_execution_actual.py,sha256=8-eGI91UTAw2g3EpSC-axH_O
|
|
695
697
|
vellum/client/types/workflow_execution_actual_chat_history_request.py,sha256=L6U8tgM7SiU4qGJMZChFzj6HfHgO-YAlTXfbT7ZIaE4,1993
|
696
698
|
vellum/client/types/workflow_execution_actual_json_request.py,sha256=5QYaPCSOwFnjH_kTrB2bTznTMFExSZdBhTkmelf1h4Q,1931
|
697
699
|
vellum/client/types/workflow_execution_actual_string_request.py,sha256=1optEDv090iVev1l0Z9cgZ1NfNrHp2VRiNjmS7f7jtc,1895
|
698
|
-
vellum/client/types/workflow_execution_event_error_code.py,sha256=
|
700
|
+
vellum/client/types/workflow_execution_event_error_code.py,sha256=UQihvr26uUXt1UU6ngIOmYAk3QepeUVTymla5ulCNn8,451
|
699
701
|
vellum/client/types/workflow_execution_event_type.py,sha256=ESKqV3ItoAlqBooruf-i0AnmEh_GvCySZ0Co3r9Bvt0,170
|
700
702
|
vellum/client/types/workflow_execution_fulfilled_body.py,sha256=4M9fQdJy7nH5Y1HLq9VVlfTNW4F9jlj4k5SWty9fFqQ,746
|
701
703
|
vellum/client/types/workflow_execution_fulfilled_event.py,sha256=ud3jxSpoo3D85vyEewsf4Eqv1AdBfwclOGmJu9lfOv8,2412
|
@@ -785,7 +787,7 @@ vellum/evaluations/utils/env.py,sha256=Xj_nxsoU5ox06EOTjRopR4lrigQI6Le6qbWGltYoE
|
|
785
787
|
vellum/evaluations/utils/exceptions.py,sha256=dXMAkzqbHV_AP5FjjbegPlfUE0zQDlpA3qOsoOJUxfg,49
|
786
788
|
vellum/evaluations/utils/paginator.py,sha256=rEED_BJAXAM6tM1yMwHePNzszjq_tTq4NbQvi1jWQ_Q,697
|
787
789
|
vellum/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
788
|
-
vellum/plugins/pydantic.py,sha256=
|
790
|
+
vellum/plugins/pydantic.py,sha256=_kx82JIA050R67QAimgR7NQTuweSP7xLGW4qHLIepo4,3609
|
789
791
|
vellum/plugins/utils.py,sha256=cPmxE9R2CK1bki2jKE8rB-G9zMf2pzHjSPDHFPXwd3Q,878
|
790
792
|
vellum/plugins/vellum_mypy.py,sha256=QTuMSq6PiZW1dyTUZ5Bf1d4XkgFj0TKAgZLP8f4UgL4,27914
|
791
793
|
vellum/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1499,9 +1501,9 @@ vellum/workflows/nodes/core/__init__.py,sha256=5zDMCmyt1v0HTJzlUBwq3U9L825yZGZhT
|
|
1499
1501
|
vellum/workflows/nodes/core/error_node/__init__.py,sha256=g7RRnlHhqu4qByfLjBwCunmgGA8dI5gNsjS3h6TwlSI,60
|
1500
1502
|
vellum/workflows/nodes/core/error_node/node.py,sha256=MFHU5vITYSK-L9CuMZ49In2ZeNLWnhZD0f8r5dWvb5Y,1270
|
1501
1503
|
vellum/workflows/nodes/core/inline_subworkflow_node/__init__.py,sha256=nKNEH1QTl-1PcvmYoqSWEl0-t6gAur8GLTXHzklRQfM,84
|
1502
|
-
vellum/workflows/nodes/core/inline_subworkflow_node/node.py,sha256=
|
1504
|
+
vellum/workflows/nodes/core/inline_subworkflow_node/node.py,sha256=e-Mal5tZ6JXJdWn8MspoBbXC8LBaCVxKb4RjoHnuZ0A,6611
|
1503
1505
|
vellum/workflows/nodes/core/inline_subworkflow_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1504
|
-
vellum/workflows/nodes/core/inline_subworkflow_node/tests/test_node.py,sha256=
|
1506
|
+
vellum/workflows/nodes/core/inline_subworkflow_node/tests/test_node.py,sha256=kUqwcRMMxjTHALbwGUXCJT_aJBrHS1bkg49oL8R0JO8,4337
|
1505
1507
|
vellum/workflows/nodes/core/map_node/__init__.py,sha256=MXpZYmGfhsMJHqqlpd64WiJRtbAtAMQz-_3fCU_cLV0,56
|
1506
1508
|
vellum/workflows/nodes/core/map_node/node.py,sha256=dY27Xm11LHsqD7hnZnVYYDIazZ-XfL4_zatvWKTi6CU,9243
|
1507
1509
|
vellum/workflows/nodes/core/map_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1552,7 +1554,7 @@ vellum/workflows/nodes/displayable/final_output_node/node.py,sha256=PuQ0RvtAmoSI
|
|
1552
1554
|
vellum/workflows/nodes/displayable/final_output_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1553
1555
|
vellum/workflows/nodes/displayable/final_output_node/tests/test_node.py,sha256=E6LQ74qZjY4Xi4avx2qdOCgGhF8pEcNLBh8cqYRkzMI,709
|
1554
1556
|
vellum/workflows/nodes/displayable/guardrail_node/__init__.py,sha256=Ab5eXmOoBhyV4dMWdzh32HLUmnPIBEK_zFCT38C4Fng,68
|
1555
|
-
vellum/workflows/nodes/displayable/guardrail_node/node.py,sha256=
|
1557
|
+
vellum/workflows/nodes/displayable/guardrail_node/node.py,sha256=g6xG2-fEKGxYtJwbex1X5IodP3cJ7DqSthi80d2-Lo4,4395
|
1556
1558
|
vellum/workflows/nodes/displayable/inline_prompt_node/__init__.py,sha256=gSUOoEZLlrx35-tQhSAd3An8WDwBqyiQh-sIebLU9wU,74
|
1557
1559
|
vellum/workflows/nodes/displayable/inline_prompt_node/node.py,sha256=8RXZqWMzViUjFfbpmcy1gkSsKnEpci8BGwsuPYv4xMQ,3380
|
1558
1560
|
vellum/workflows/nodes/displayable/inline_prompt_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1644,8 +1646,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
|
|
1644
1646
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1645
1647
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=tCxrV3QBHL8wfdEO3bvKteDdw32xBlUl1_WxkAwaONw,8344
|
1646
1648
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1647
|
-
vellum_ai-0.14.
|
1648
|
-
vellum_ai-0.14.
|
1649
|
-
vellum_ai-0.14.
|
1650
|
-
vellum_ai-0.14.
|
1651
|
-
vellum_ai-0.14.
|
1649
|
+
vellum_ai-0.14.25.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1650
|
+
vellum_ai-0.14.25.dist-info/METADATA,sha256=X3sUFpricDkxi-Wt9aftPV-nGbncI-e1hW3vAXHRyLY,5484
|
1651
|
+
vellum_ai-0.14.25.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1652
|
+
vellum_ai-0.14.25.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1653
|
+
vellum_ai-0.14.25.dist-info/RECORD,,
|
@@ -1,20 +1,38 @@
|
|
1
|
-
from dataclasses import dataclass
|
1
|
+
from dataclasses import dataclass, field
|
2
2
|
from uuid import UUID
|
3
3
|
from typing import TypeVar
|
4
4
|
|
5
|
+
from pydantic import Field
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
8
|
+
from vellum_ee.workflows.display.editor.types import NodeDisplayData
|
9
|
+
|
10
|
+
|
11
|
+
class WorkflowDisplayDataViewport(UniversalBaseModel):
|
12
|
+
x: float = 0.0
|
13
|
+
y: float = 0.0
|
14
|
+
zoom: float = 1.0
|
15
|
+
|
16
|
+
|
17
|
+
class WorkflowDisplayData(UniversalBaseModel):
|
18
|
+
viewport: WorkflowDisplayDataViewport = Field(default_factory=WorkflowDisplayDataViewport)
|
9
19
|
|
10
20
|
|
11
21
|
@dataclass
|
12
|
-
class WorkflowMetaDisplay
|
13
|
-
|
22
|
+
class WorkflowMetaDisplay:
|
23
|
+
entrypoint_node_id: UUID
|
24
|
+
entrypoint_node_source_handle_id: UUID
|
25
|
+
entrypoint_node_display: NodeDisplayData = Field(default_factory=NodeDisplayData)
|
26
|
+
display_data: WorkflowDisplayData = field(default_factory=WorkflowDisplayData)
|
14
27
|
|
15
28
|
|
16
|
-
|
17
|
-
|
29
|
+
@dataclass
|
30
|
+
class WorkflowMetaDisplayOverrides(WorkflowMetaDisplay):
|
31
|
+
"""
|
32
|
+
DEPRECATED: Use WorkflowMetaDisplay instead. Will be removed in 0.15.0
|
33
|
+
"""
|
34
|
+
|
35
|
+
pass
|
18
36
|
|
19
37
|
|
20
38
|
@dataclass
|
@@ -60,19 +78,16 @@ class EdgeDisplayOverrides(EdgeDisplay):
|
|
60
78
|
|
61
79
|
|
62
80
|
@dataclass
|
63
|
-
class
|
81
|
+
class EntrypointDisplay:
|
64
82
|
id: UUID
|
83
|
+
edge_display: EdgeDisplay
|
65
84
|
|
66
85
|
|
67
86
|
@dataclass
|
68
|
-
class EntrypointDisplay
|
87
|
+
class EntrypointDisplayOverrides(EntrypointDisplay):
|
69
88
|
pass
|
70
89
|
|
71
90
|
|
72
|
-
EntrypointDisplayType = TypeVar("EntrypointDisplayType", bound=EntrypointDisplay)
|
73
|
-
EntrypointDisplayOverridesType = TypeVar("EntrypointDisplayOverridesType", bound=EntrypointDisplayOverrides)
|
74
|
-
|
75
|
-
|
76
91
|
@dataclass
|
77
92
|
class WorkflowOutputDisplay:
|
78
93
|
id: UUID
|
@@ -0,0 +1,22 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
6
|
+
|
7
|
+
|
8
|
+
class NodeDisplayPosition(UniversalBaseModel):
|
9
|
+
x: float = 0.0
|
10
|
+
y: float = 0.0
|
11
|
+
|
12
|
+
|
13
|
+
class NodeDisplayComment(UniversalBaseModel):
|
14
|
+
value: Optional[str] = None
|
15
|
+
expanded: Optional[bool] = None
|
16
|
+
|
17
|
+
|
18
|
+
class NodeDisplayData(UniversalBaseModel):
|
19
|
+
position: NodeDisplayPosition = Field(default_factory=NodeDisplayPosition)
|
20
|
+
width: Optional[int] = None
|
21
|
+
height: Optional[int] = None
|
22
|
+
comment: Optional[NodeDisplayComment] = None
|
@@ -17,6 +17,7 @@ from typing import (
|
|
17
17
|
get_origin,
|
18
18
|
)
|
19
19
|
|
20
|
+
from vellum.client.types.code_resource_definition import CodeResourceDefinition
|
20
21
|
from vellum.workflows import BaseWorkflow
|
21
22
|
from vellum.workflows.constants import undefined
|
22
23
|
from vellum.workflows.descriptors.base import BaseDescriptor
|
@@ -30,6 +31,7 @@ from vellum.workflows.expressions.is_undefined import IsUndefinedExpression
|
|
30
31
|
from vellum.workflows.expressions.not_between import NotBetweenExpression
|
31
32
|
from vellum.workflows.expressions.parse_json import ParseJsonExpression
|
32
33
|
from vellum.workflows.nodes.bases.base import BaseNode
|
34
|
+
from vellum.workflows.nodes.displayable.bases.utils import primitive_to_vellum_value
|
33
35
|
from vellum.workflows.nodes.utils import get_wrapped_node
|
34
36
|
from vellum.workflows.ports import Port
|
35
37
|
from vellum.workflows.references import OutputReference
|
@@ -45,11 +47,11 @@ from vellum.workflows.types.utils import get_original_base
|
|
45
47
|
from vellum.workflows.utils.names import pascal_to_title_case
|
46
48
|
from vellum.workflows.utils.uuids import uuid4_from_hash
|
47
49
|
from vellum.workflows.utils.vellum_variables import primitive_type_to_vellum_variable_type
|
50
|
+
from vellum_ee.workflows.display.editor.types import NodeDisplayData
|
48
51
|
from vellum_ee.workflows.display.nodes.get_node_display_class import get_node_display_class
|
49
52
|
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay, PortDisplayOverrides
|
50
53
|
from vellum_ee.workflows.display.utils.expressions import get_child_descriptor
|
51
|
-
from vellum_ee.workflows.display.utils.vellum import convert_descriptor_to_operator
|
52
|
-
from vellum_ee.workflows.display.vellum import CodeResourceDefinition, NodeDisplayData
|
54
|
+
from vellum_ee.workflows.display.utils.vellum import convert_descriptor_to_operator
|
53
55
|
|
54
56
|
if TYPE_CHECKING:
|
55
57
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
@@ -4,9 +4,9 @@ from typing import ClassVar, Dict, Optional
|
|
4
4
|
from vellum.workflows.nodes.utils import get_unadorned_node
|
5
5
|
from vellum.workflows.ports import Port
|
6
6
|
from vellum.workflows.types.generics import NodeType
|
7
|
+
from vellum_ee.workflows.display.editor.types import NodeDisplayComment, NodeDisplayData
|
7
8
|
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
8
9
|
from vellum_ee.workflows.display.nodes.types import PortDisplay
|
9
|
-
from vellum_ee.workflows.display.vellum import NodeDisplayComment, NodeDisplayData
|
10
10
|
|
11
11
|
|
12
12
|
class BaseNodeVellumDisplay(BaseNodeDisplay[NodeType]):
|
@@ -8,7 +8,7 @@ from vellum_ee.workflows.display.nodes.base_node_vellum_display import BaseNodeV
|
|
8
8
|
from vellum_ee.workflows.display.nodes.utils import raise_if_descriptor
|
9
9
|
from vellum_ee.workflows.display.nodes.vellum.utils import create_node_input
|
10
10
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
11
|
-
from vellum_ee.workflows.display.vellum import WorkspaceSecretPointer
|
11
|
+
from vellum_ee.workflows.display.utils.vellum import WorkspaceSecretPointer
|
12
12
|
|
13
13
|
_APINodeType = TypeVar("_APINodeType", bound=APINode)
|
14
14
|
|
@@ -15,7 +15,8 @@ from vellum_ee.workflows.display.nodes.base_node_vellum_display import BaseNodeV
|
|
15
15
|
from vellum_ee.workflows.display.nodes.utils import raise_if_descriptor
|
16
16
|
from vellum_ee.workflows.display.nodes.vellum.utils import create_node_input
|
17
17
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
18
|
-
from vellum_ee.workflows.display.vellum import InputVariablePointer
|
18
|
+
from vellum_ee.workflows.display.utils.vellum import InputVariablePointer
|
19
|
+
from vellum_ee.workflows.display.vellum import NodeInput
|
19
20
|
|
20
21
|
_SearchNodeType = TypeVar("_SearchNodeType", bound=SearchNode)
|
21
22
|
|
@@ -8,21 +8,20 @@ from vellum.workflows.inputs import BaseInputs
|
|
8
8
|
from vellum.workflows.nodes.bases import BaseNode
|
9
9
|
from vellum.workflows.outputs import BaseOutputs
|
10
10
|
from vellum.workflows.references import LazyReference
|
11
|
+
from vellum_ee.workflows.display.editor.types import NodeDisplayData
|
11
12
|
from vellum_ee.workflows.display.nodes.base_node_vellum_display import BaseNodeVellumDisplay
|
12
13
|
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay
|
13
14
|
from vellum_ee.workflows.display.nodes.vellum.utils import create_node_input_value_pointer_rules
|
14
15
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
15
|
-
from vellum_ee.workflows.display.vellum import (
|
16
|
+
from vellum_ee.workflows.display.utils.vellum import (
|
16
17
|
ConstantValuePointer,
|
17
18
|
InputVariableData,
|
18
19
|
InputVariablePointer,
|
19
|
-
NodeDisplayData,
|
20
20
|
NodeInputValuePointerRule,
|
21
21
|
NodeOutputData,
|
22
22
|
NodeOutputPointer,
|
23
|
-
WorkflowInputsVellumDisplayOverrides,
|
24
|
-
WorkflowMetaVellumDisplay,
|
25
23
|
)
|
24
|
+
from vellum_ee.workflows.display.vellum import WorkflowInputsVellumDisplayOverrides, WorkflowMetaVellumDisplay
|
26
25
|
from vellum_ee.workflows.display.workflows.vellum_workflow_display import VellumWorkflowDisplay
|
27
26
|
|
28
27
|
|
@@ -68,41 +67,36 @@ class MyNodeB(BaseNode):
|
|
68
67
|
MyNodeB.fallback_example,
|
69
68
|
[
|
70
69
|
NodeOutputPointer(
|
71
|
-
type="NODE_OUTPUT",
|
72
70
|
data=NodeOutputData(
|
73
71
|
node_id="b48fa5e0-d7d3-4fe3-ae48-615415011cc5",
|
74
72
|
output_id="4b16a629-11a1-4b3f-a965-a57b872d13b8",
|
75
73
|
),
|
76
74
|
),
|
77
75
|
InputVariablePointer(
|
78
|
-
type="INPUT_VARIABLE",
|
79
76
|
data=InputVariableData(input_variable_id="a154c29d-fac0-4cd0-ba88-bc52034f5470"),
|
80
77
|
),
|
81
|
-
ConstantValuePointer(
|
78
|
+
ConstantValuePointer(data=StringVellumValue(value="fallback")),
|
82
79
|
],
|
83
80
|
),
|
84
81
|
(
|
85
82
|
MyNodeB.constant_coalesce,
|
86
83
|
[
|
87
84
|
InputVariablePointer(
|
88
|
-
type="INPUT_VARIABLE",
|
89
85
|
data=InputVariableData(input_variable_id="a154c29d-fac0-4cd0-ba88-bc52034f5470"),
|
90
86
|
),
|
91
|
-
ConstantValuePointer(
|
87
|
+
ConstantValuePointer(data=StringVellumValue(value="default_value")),
|
92
88
|
],
|
93
89
|
),
|
94
90
|
(
|
95
91
|
MyNodeB.lazy_coalesce,
|
96
92
|
[
|
97
93
|
NodeOutputPointer(
|
98
|
-
type="NODE_OUTPUT",
|
99
94
|
data=NodeOutputData(
|
100
95
|
node_id="b48fa5e0-d7d3-4fe3-ae48-615415011cc5",
|
101
96
|
output_id="4b16a629-11a1-4b3f-a965-a57b872d13b8",
|
102
97
|
),
|
103
98
|
),
|
104
99
|
InputVariablePointer(
|
105
|
-
type="INPUT_VARIABLE",
|
106
100
|
data=InputVariableData(input_variable_id="a154c29d-fac0-4cd0-ba88-bc52034f5470"),
|
107
101
|
),
|
108
102
|
],
|
@@ -9,19 +9,18 @@ from vellum.workflows.references.lazy import LazyReference
|
|
9
9
|
from vellum.workflows.utils.uuids import uuid4_from_hash
|
10
10
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
11
11
|
from vellum_ee.workflows.display.utils.expressions import get_child_descriptor
|
12
|
-
from vellum_ee.workflows.display.utils.vellum import
|
13
|
-
from vellum_ee.workflows.display.vellum import (
|
12
|
+
from vellum_ee.workflows.display.utils.vellum import (
|
14
13
|
ConstantValuePointer,
|
15
14
|
ExecutionCounterData,
|
16
15
|
ExecutionCounterPointer,
|
17
16
|
InputVariableData,
|
18
17
|
InputVariablePointer,
|
19
|
-
NodeInput,
|
20
|
-
NodeInputValuePointer,
|
21
18
|
NodeInputValuePointerRule,
|
22
19
|
WorkspaceSecretData,
|
23
20
|
WorkspaceSecretPointer,
|
21
|
+
create_node_input_value_pointer_rule,
|
24
22
|
)
|
23
|
+
from vellum_ee.workflows.display.vellum import NodeInput, NodeInputValuePointer
|
25
24
|
|
26
25
|
|
27
26
|
def create_node_input(
|
@@ -9,11 +9,12 @@ from vellum.workflows.references.workflow_input import WorkflowInputReference
|
|
9
9
|
from vellum.workflows.types.core import JsonObject
|
10
10
|
from vellum.workflows.types.generics import NodeType
|
11
11
|
from vellum_ee.workflows.display.base import StateValueDisplayType, WorkflowInputsDisplayType
|
12
|
+
from vellum_ee.workflows.display.editor.types import NodeDisplayData
|
12
13
|
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
13
14
|
from vellum_ee.workflows.display.nodes.get_node_display_class import get_node_display_class
|
14
15
|
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay
|
15
16
|
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
16
|
-
from vellum_ee.workflows.display.vellum import
|
17
|
+
from vellum_ee.workflows.display.vellum import WorkflowMetaVellumDisplay
|
17
18
|
from vellum_ee.workflows.display.workflows.vellum_workflow_display import VellumWorkflowDisplay
|
18
19
|
|
19
20
|
|
@@ -8,44 +8,47 @@ from vellum.workflows.ports import Port
|
|
8
8
|
from vellum.workflows.references import OutputReference, StateValueReference, WorkflowInputReference
|
9
9
|
from vellum_ee.workflows.display.base import (
|
10
10
|
EdgeDisplay,
|
11
|
-
|
11
|
+
EntrypointDisplay,
|
12
12
|
StateValueDisplayType,
|
13
13
|
WorkflowInputsDisplayType,
|
14
|
-
|
14
|
+
WorkflowMetaDisplay,
|
15
15
|
WorkflowOutputDisplay,
|
16
16
|
)
|
17
|
+
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
18
|
+
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay
|
17
19
|
|
18
20
|
if TYPE_CHECKING:
|
19
|
-
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
20
|
-
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay
|
21
21
|
from vellum_ee.workflows.display.workflows import BaseWorkflowDisplay
|
22
22
|
|
23
23
|
WorkflowDisplayType = TypeVar("WorkflowDisplayType", bound="BaseWorkflowDisplay")
|
24
24
|
|
25
|
+
NodeDisplays = Dict[Type[BaseNode], BaseNodeDisplay]
|
26
|
+
NodeOutputDisplays = Dict[OutputReference, Tuple[Type[BaseNode], NodeOutputDisplay]]
|
27
|
+
EntrypointDisplays = Dict[Type[BaseNode], EntrypointDisplay]
|
28
|
+
WorkflowOutputDisplays = Dict[BaseDescriptor, WorkflowOutputDisplay]
|
29
|
+
EdgeDisplays = Dict[Tuple[Port, Type[BaseNode]], EdgeDisplay]
|
30
|
+
PortDisplays = Dict[Port, PortDisplay]
|
31
|
+
|
25
32
|
|
26
33
|
@dataclass
|
27
34
|
class WorkflowDisplayContext(
|
28
35
|
Generic[
|
29
|
-
WorkflowMetaDisplayType,
|
30
36
|
WorkflowInputsDisplayType,
|
31
37
|
StateValueDisplayType,
|
32
|
-
EntrypointDisplayType,
|
33
38
|
]
|
34
39
|
):
|
35
40
|
workflow_display_class: Type["BaseWorkflowDisplay"]
|
36
|
-
workflow_display:
|
41
|
+
workflow_display: WorkflowMetaDisplay
|
37
42
|
workflow_input_displays: Dict[WorkflowInputReference, WorkflowInputsDisplayType] = field(default_factory=dict)
|
38
43
|
global_workflow_input_displays: Dict[WorkflowInputReference, WorkflowInputsDisplayType] = field(
|
39
44
|
default_factory=dict
|
40
45
|
)
|
41
46
|
state_value_displays: Dict[StateValueReference, StateValueDisplayType] = field(default_factory=dict)
|
42
47
|
global_state_value_displays: Dict[StateValueReference, StateValueDisplayType] = field(default_factory=dict)
|
43
|
-
node_displays:
|
44
|
-
global_node_displays:
|
45
|
-
global_node_output_displays:
|
46
|
-
|
47
|
-
)
|
48
|
-
|
49
|
-
|
50
|
-
edge_displays: Dict[Tuple[Port, Type[BaseNode]], EdgeDisplay] = field(default_factory=dict)
|
51
|
-
port_displays: Dict[Port, "PortDisplay"] = field(default_factory=dict)
|
48
|
+
node_displays: NodeDisplays = field(default_factory=dict)
|
49
|
+
global_node_displays: NodeDisplays = field(default_factory=dict)
|
50
|
+
global_node_output_displays: NodeOutputDisplays = field(default_factory=dict)
|
51
|
+
entrypoint_displays: EntrypointDisplays = field(default_factory=dict)
|
52
|
+
workflow_output_displays: WorkflowOutputDisplays = field(default_factory=dict)
|
53
|
+
edge_displays: EdgeDisplays = field(default_factory=dict)
|
54
|
+
port_displays: PortDisplays = field(default_factory=dict)
|
@@ -1,9 +1,13 @@
|
|
1
|
+
from typing import TYPE_CHECKING
|
2
|
+
|
1
3
|
from vellum.workflows.descriptors.base import BaseDescriptor
|
2
4
|
from vellum.workflows.references.lazy import LazyReference
|
3
|
-
|
5
|
+
|
6
|
+
if TYPE_CHECKING:
|
7
|
+
from vellum_ee.workflows.display.types import WorkflowDisplayContext
|
4
8
|
|
5
9
|
|
6
|
-
def get_child_descriptor(value: LazyReference, display_context: WorkflowDisplayContext) -> BaseDescriptor:
|
10
|
+
def get_child_descriptor(value: LazyReference, display_context: "WorkflowDisplayContext") -> BaseDescriptor:
|
7
11
|
if isinstance(value._get, str):
|
8
12
|
reference_parts = value._get.split(".")
|
9
13
|
if len(reference_parts) < 3:
|