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.
Files changed (103) hide show
  1. vellum/client/core/client_wrapper.py +1 -1
  2. vellum/client/types/logical_operator.py +2 -0
  3. vellum/evaluations/resources.py +7 -12
  4. vellum/evaluations/utils/env.py +1 -3
  5. vellum/evaluations/utils/paginator.py +0 -1
  6. vellum/evaluations/utils/typing.py +1 -1
  7. vellum/evaluations/utils/uuid.py +1 -1
  8. vellum/plugins/vellum_mypy.py +3 -1
  9. vellum/workflows/descriptors/utils.py +27 -0
  10. vellum/workflows/events/__init__.py +0 -2
  11. vellum/workflows/events/node.py +7 -6
  12. vellum/workflows/events/tests/test_event.py +2 -2
  13. vellum/workflows/events/types.py +35 -30
  14. vellum/workflows/events/workflow.py +33 -8
  15. vellum/workflows/nodes/bases/base.py +49 -26
  16. vellum/workflows/nodes/bases/tests/test_base_node.py +0 -1
  17. vellum/workflows/nodes/core/templating_node/node.py +1 -0
  18. vellum/workflows/nodes/core/try_node/node.py +22 -4
  19. vellum/workflows/nodes/core/try_node/tests/test_node.py +16 -3
  20. vellum/workflows/nodes/displayable/bases/api_node/node.py +1 -1
  21. vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py +0 -1
  22. vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +0 -1
  23. vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +2 -1
  24. vellum/workflows/nodes/displayable/bases/search_node.py +0 -1
  25. vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py +0 -1
  26. vellum/workflows/nodes/displayable/code_execution_node/utils.py +3 -2
  27. vellum/workflows/nodes/displayable/conditional_node/node.py +1 -1
  28. vellum/workflows/nodes/displayable/guardrail_node/node.py +0 -1
  29. vellum/workflows/nodes/displayable/inline_prompt_node/node.py +1 -0
  30. vellum/workflows/nodes/displayable/prompt_deployment_node/node.py +3 -1
  31. vellum/workflows/nodes/displayable/search_node/node.py +1 -0
  32. vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +3 -2
  33. vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py +10 -7
  34. vellum/workflows/nodes/displayable/tests/test_search_node_wth_text_output.py +0 -1
  35. vellum/workflows/outputs/base.py +2 -4
  36. vellum/workflows/ports/node_ports.py +1 -1
  37. vellum/workflows/runner/runner.py +185 -157
  38. vellum/workflows/state/base.py +55 -23
  39. vellum/workflows/state/context.py +26 -3
  40. vellum/workflows/types/core.py +1 -0
  41. vellum/workflows/types/tests/test_utils.py +1 -0
  42. vellum/workflows/types/utils.py +0 -1
  43. vellum/workflows/utils/functions.py +74 -0
  44. vellum/workflows/utils/tests/test_functions.py +171 -0
  45. vellum/workflows/utils/tests/test_vellum_variables.py +0 -1
  46. vellum/workflows/utils/vellum_variables.py +2 -2
  47. vellum/workflows/workflows/base.py +84 -10
  48. vellum/workflows/workflows/event_filters.py +53 -0
  49. {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/METADATA +1 -1
  50. {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/RECORD +101 -93
  51. vellum_cli/__init__.py +147 -13
  52. vellum_cli/config.py +0 -1
  53. vellum_cli/image_push.py +1 -1
  54. vellum_cli/pull.py +29 -19
  55. vellum_cli/push.py +9 -10
  56. vellum_cli/tests/__init__.py +0 -0
  57. vellum_cli/tests/conftest.py +40 -0
  58. vellum_cli/tests/test_main.py +11 -0
  59. vellum_cli/tests/test_pull.py +125 -71
  60. vellum_cli/tests/test_push.py +173 -0
  61. vellum_ee/workflows/display/nodes/base_node_display.py +3 -2
  62. vellum_ee/workflows/display/nodes/base_node_vellum_display.py +2 -2
  63. vellum_ee/workflows/display/nodes/get_node_display_class.py +1 -1
  64. vellum_ee/workflows/display/nodes/tests/test_base_node_display.py +1 -1
  65. vellum_ee/workflows/display/nodes/vellum/__init__.py +5 -3
  66. vellum_ee/workflows/display/nodes/vellum/api_node.py +4 -7
  67. vellum_ee/workflows/display/nodes/vellum/conditional_node.py +39 -22
  68. vellum_ee/workflows/display/nodes/vellum/error_node.py +49 -0
  69. vellum_ee/workflows/display/nodes/vellum/final_output_node.py +0 -2
  70. vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +1 -1
  71. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +1 -1
  72. vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +4 -2
  73. vellum_ee/workflows/display/nodes/vellum/map_node.py +11 -5
  74. vellum_ee/workflows/display/nodes/vellum/merge_node.py +2 -2
  75. vellum_ee/workflows/display/nodes/vellum/note_node.py +1 -3
  76. vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +1 -1
  77. vellum_ee/workflows/display/nodes/vellum/search_node.py +1 -1
  78. vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +1 -1
  79. vellum_ee/workflows/display/nodes/vellum/templating_node.py +1 -1
  80. vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +5 -5
  81. vellum_ee/workflows/display/nodes/vellum/utils.py +4 -4
  82. vellum_ee/workflows/display/tests/test_vellum_workflow_display.py +45 -0
  83. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py +13 -24
  84. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +13 -39
  85. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +203 -0
  86. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +2 -2
  87. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +62 -58
  88. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +25 -4
  89. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py +2 -1
  90. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +2 -2
  91. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +2 -2
  92. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +1 -1
  93. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py +2 -1
  94. vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +2 -2
  95. vellum_ee/workflows/display/types.py +4 -4
  96. vellum_ee/workflows/display/utils/vellum.py +2 -6
  97. vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +4 -1
  98. vellum_ee/workflows/display/workflows/vellum_workflow_display.py +6 -2
  99. vellum/workflows/events/utils.py +0 -5
  100. vellum/workflows/runner/types.py +0 -16
  101. {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/LICENSE +0 -0
  102. {vellum_ai-0.10.8.dist-info → vellum_ai-0.11.0.dist-info}/WHEEL +0 -0
  103. {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(workflow_class, parent_display_context=parent_display_context) # type: ignore[return-value]
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 = primitive_to_vellum_value(raise_if_descriptor(workflow_input.instance)) if workflow_input.instance else None
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": { "color" : workflow_input_display.color },
74
+ "extensions": {"color": workflow_input_display.color},
71
75
  }
72
76
  )
73
77
 
@@ -1,5 +0,0 @@
1
- from vellum.workflows.events.workflow import WorkflowEvent
2
-
3
-
4
- def is_terminal_event(event: WorkflowEvent) -> bool:
5
- return event.name in {"workflow.execution.fulfilled", "workflow.execution.rejected", "workflow.execution.paused"}
@@ -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"