vellum-ai 0.10.8__py3-none-any.whl → 0.11.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/types/logical_operator.py +2 -0
- vellum/evaluations/resources.py +7 -12
- vellum/evaluations/utils/env.py +1 -3
- vellum/evaluations/utils/paginator.py +0 -1
- vellum/evaluations/utils/typing.py +1 -1
- vellum/evaluations/utils/uuid.py +1 -1
- vellum/plugins/vellum_mypy.py +3 -1
- vellum/workflows/descriptors/utils.py +27 -0
- vellum/workflows/events/__init__.py +0 -2
- vellum/workflows/events/node.py +7 -6
- vellum/workflows/events/tests/test_event.py +2 -2
- vellum/workflows/events/types.py +35 -30
- vellum/workflows/events/workflow.py +33 -8
- vellum/workflows/nodes/bases/base.py +49 -26
- vellum/workflows/nodes/bases/tests/test_base_node.py +0 -1
- vellum/workflows/nodes/core/templating_node/node.py +1 -0
- vellum/workflows/nodes/core/try_node/node.py +22 -4
- vellum/workflows/nodes/core/try_node/tests/test_node.py +16 -3
- vellum/workflows/nodes/displayable/bases/api_node/node.py +1 -1
- vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py +0 -1
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +0 -1
- vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +2 -1
- vellum/workflows/nodes/displayable/bases/search_node.py +0 -1
- vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py +0 -1
- vellum/workflows/nodes/displayable/code_execution_node/utils.py +3 -2
- vellum/workflows/nodes/displayable/conditional_node/node.py +1 -1
- vellum/workflows/nodes/displayable/guardrail_node/node.py +0 -1
- vellum/workflows/nodes/displayable/inline_prompt_node/node.py +1 -0
- vellum/workflows/nodes/displayable/prompt_deployment_node/node.py +3 -1
- vellum/workflows/nodes/displayable/search_node/node.py +1 -0
- vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +3 -2
- vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py +10 -7
- vellum/workflows/nodes/displayable/tests/test_search_node_wth_text_output.py +0 -1
- vellum/workflows/outputs/base.py +2 -4
- vellum/workflows/ports/node_ports.py +1 -1
- vellum/workflows/runner/runner.py +185 -157
- vellum/workflows/state/base.py +55 -23
- vellum/workflows/state/context.py +26 -3
- vellum/workflows/types/core.py +1 -0
- vellum/workflows/types/tests/test_utils.py +1 -0
- vellum/workflows/types/utils.py +0 -1
- vellum/workflows/utils/functions.py +74 -0
- vellum/workflows/utils/tests/test_functions.py +171 -0
- vellum/workflows/utils/tests/test_vellum_variables.py +0 -1
- vellum/workflows/utils/vellum_variables.py +2 -2
- vellum/workflows/workflows/base.py +84 -10
- vellum/workflows/workflows/event_filters.py +53 -0
- {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/METADATA +1 -1
- {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/RECORD +101 -93
- vellum_cli/__init__.py +147 -13
- vellum_cli/config.py +0 -1
- vellum_cli/image_push.py +1 -1
- vellum_cli/pull.py +29 -19
- vellum_cli/push.py +9 -10
- vellum_cli/tests/__init__.py +0 -0
- vellum_cli/tests/conftest.py +40 -0
- vellum_cli/tests/test_main.py +11 -0
- vellum_cli/tests/test_pull.py +125 -71
- vellum_cli/tests/test_push.py +173 -0
- vellum_ee/workflows/display/nodes/base_node_display.py +3 -2
- vellum_ee/workflows/display/nodes/base_node_vellum_display.py +2 -2
- vellum_ee/workflows/display/nodes/get_node_display_class.py +1 -1
- vellum_ee/workflows/display/nodes/tests/test_base_node_display.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/__init__.py +5 -3
- vellum_ee/workflows/display/nodes/vellum/api_node.py +4 -7
- vellum_ee/workflows/display/nodes/vellum/conditional_node.py +39 -22
- vellum_ee/workflows/display/nodes/vellum/error_node.py +49 -0
- vellum_ee/workflows/display/nodes/vellum/final_output_node.py +0 -2
- vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +4 -2
- vellum_ee/workflows/display/nodes/vellum/map_node.py +11 -5
- vellum_ee/workflows/display/nodes/vellum/merge_node.py +2 -2
- vellum_ee/workflows/display/nodes/vellum/note_node.py +1 -3
- vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/search_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +5 -5
- vellum_ee/workflows/display/nodes/vellum/utils.py +4 -4
- vellum_ee/workflows/display/tests/test_vellum_workflow_display.py +45 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py +13 -24
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +13 -39
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +203 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +2 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +62 -58
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +25 -4
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py +2 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +2 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +2 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +1 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py +2 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +2 -2
- vellum_ee/workflows/display/types.py +4 -4
- vellum_ee/workflows/display/utils/vellum.py +2 -6
- vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +4 -1
- vellum_ee/workflows/display/workflows/vellum_workflow_display.py +6 -2
- vellum/workflows/events/utils.py +0 -5
- vellum/workflows/runner/types.py +0 -16
- {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/LICENSE +0 -0
- {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/WHEEL +0 -0
- {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,10 @@
|
|
1
1
|
from dataclasses import dataclass, field
|
2
2
|
from typing import TYPE_CHECKING, Dict, Generic, Tuple, Type, TypeVar
|
3
3
|
|
4
|
+
from vellum.workflows.descriptors.base import BaseDescriptor
|
5
|
+
from vellum.workflows.nodes import BaseNode
|
6
|
+
from vellum.workflows.ports import Port
|
7
|
+
from vellum.workflows.references import OutputReference, WorkflowInputReference
|
4
8
|
from vellum_ee.workflows.display.base import (
|
5
9
|
EdgeDisplayType,
|
6
10
|
EntrypointDisplayType,
|
@@ -9,10 +13,6 @@ from vellum_ee.workflows.display.base import (
|
|
9
13
|
WorkflowOutputDisplayType,
|
10
14
|
)
|
11
15
|
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay
|
12
|
-
from vellum.workflows.descriptors.base import BaseDescriptor
|
13
|
-
from vellum.workflows.nodes import BaseNode
|
14
|
-
from vellum.workflows.ports import Port
|
15
|
-
from vellum.workflows.references import OutputReference, WorkflowInputReference
|
16
16
|
|
17
17
|
if TYPE_CHECKING:
|
18
18
|
from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
|
@@ -4,9 +4,7 @@ import typing
|
|
4
4
|
from typing import Any, List, Union, cast
|
5
5
|
|
6
6
|
from vellum import ChatMessage, SearchResult, SearchResultRequest, VellumVariableType
|
7
|
-
from vellum.client.types.array_vellum_value import ArrayVellumValue
|
8
7
|
from vellum.workflows.descriptors.base import BaseDescriptor
|
9
|
-
from vellum.workflows.nodes.core.map_node.node import MapNodeItemType
|
10
8
|
from vellum.workflows.references import OutputReference, WorkflowInputReference
|
11
9
|
from vellum.workflows.references.execution_count import ExecutionCountReference
|
12
10
|
from vellum.workflows.references.node import NodeReference
|
@@ -48,7 +46,7 @@ def infer_vellum_variable_type(value: Any) -> VellumVariableType:
|
|
48
46
|
f"Expected NodeReference {descriptor.name} to have an instance pointing to a descriptor"
|
49
47
|
)
|
50
48
|
descriptor = descriptor.instance
|
51
|
-
|
49
|
+
|
52
50
|
inferred_type = primitive_type_to_vellum_variable_type(descriptor)
|
53
51
|
else:
|
54
52
|
vellum_variable_value = primitive_to_vellum_value(value)
|
@@ -68,9 +66,7 @@ def create_node_input_value_pointer_rule(
|
|
68
66
|
)
|
69
67
|
if isinstance(value, WorkflowInputReference):
|
70
68
|
workflow_input_display = display_context.workflow_input_displays[value]
|
71
|
-
return InputVariablePointer(
|
72
|
-
data=InputVariableData(input_variable_id=str(workflow_input_display.id))
|
73
|
-
)
|
69
|
+
return InputVariablePointer(data=InputVariableData(input_variable_id=str(workflow_input_display.id)))
|
74
70
|
if isinstance(value, VellumSecretReference):
|
75
71
|
# TODO: Pass through the name instead of retrieving the ID
|
76
72
|
# https://app.shortcut.com/vellum/story/5072
|
@@ -24,4 +24,7 @@ def get_workflow_display(
|
|
24
24
|
except IndexError:
|
25
25
|
return base_display_class(workflow_class)
|
26
26
|
|
27
|
-
return workflow_display_class(
|
27
|
+
return workflow_display_class( # type: ignore[return-value]
|
28
|
+
workflow_class,
|
29
|
+
parent_display_context=parent_display_context,
|
30
|
+
)
|
@@ -57,7 +57,11 @@ class VellumWorkflowDisplay(
|
|
57
57
|
def serialize(self, raise_errors: bool = True) -> JsonObject:
|
58
58
|
input_variables: JsonArray = []
|
59
59
|
for workflow_input, workflow_input_display in self.display_context.workflow_input_displays.items():
|
60
|
-
default =
|
60
|
+
default = (
|
61
|
+
primitive_to_vellum_value(raise_if_descriptor(workflow_input.instance))
|
62
|
+
if workflow_input.instance
|
63
|
+
else None
|
64
|
+
)
|
61
65
|
required = type(None) not in workflow_input.types
|
62
66
|
|
63
67
|
input_variables.append(
|
@@ -67,7 +71,7 @@ class VellumWorkflowDisplay(
|
|
67
71
|
"type": infer_vellum_variable_type(workflow_input),
|
68
72
|
"default": default.dict() if default else None,
|
69
73
|
"required": required,
|
70
|
-
"extensions": {
|
74
|
+
"extensions": {"color": workflow_input_display.color},
|
71
75
|
}
|
72
76
|
)
|
73
77
|
|
vellum/workflows/events/utils.py
DELETED
vellum/workflows/runner/types.py
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"""Only intenral types and enums for WorkflowRunner should be defined in this module."""
|
2
|
-
|
3
|
-
from dataclasses import dataclass
|
4
|
-
from typing import TYPE_CHECKING, Generic
|
5
|
-
|
6
|
-
from vellum.workflows.types.generics import StateType
|
7
|
-
|
8
|
-
if TYPE_CHECKING:
|
9
|
-
from vellum.workflows.events import NodeEvent
|
10
|
-
from vellum.workflows.nodes.bases import BaseNode
|
11
|
-
|
12
|
-
|
13
|
-
@dataclass(frozen=True)
|
14
|
-
class WorkItemEvent(Generic[StateType]):
|
15
|
-
node: "BaseNode[StateType]"
|
16
|
-
event: "NodeEvent"
|
File without changes
|
File without changes
|
File without changes
|