vellum-ai 0.14.22__py3-none-any.whl → 0.14.23__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.
Files changed (139) hide show
  1. vellum/__init__.py +122 -0
  2. vellum/client/core/client_wrapper.py +1 -1
  3. vellum/client/resources/workflow_deployments/client.py +250 -0
  4. vellum/client/types/__init__.py +122 -0
  5. vellum/client/types/api_request_parent_context.py +41 -0
  6. vellum/client/types/api_version_enum.py +5 -0
  7. vellum/client/types/base_output.py +21 -0
  8. vellum/client/types/code_resource_definition.py +31 -0
  9. vellum/client/types/external_input_descriptor.py +23 -0
  10. vellum/client/types/invoked_port.py +19 -0
  11. vellum/client/types/ml_model_usage_wrapper.py +21 -0
  12. vellum/client/types/node_event_display_context.py +30 -0
  13. vellum/client/types/node_execution_fulfilled_body.py +24 -0
  14. vellum/client/types/node_execution_fulfilled_event.py +49 -0
  15. vellum/client/types/node_execution_initiated_body.py +21 -0
  16. vellum/client/types/node_execution_initiated_event.py +49 -0
  17. vellum/client/types/node_execution_paused_body.py +20 -0
  18. vellum/client/types/node_execution_paused_event.py +49 -0
  19. vellum/client/types/node_execution_rejected_body.py +22 -0
  20. vellum/client/types/node_execution_rejected_event.py +49 -0
  21. vellum/client/types/node_execution_resumed_body.py +20 -0
  22. vellum/client/types/node_execution_resumed_event.py +49 -0
  23. vellum/client/types/node_execution_span.py +46 -0
  24. vellum/client/types/node_execution_span_attributes.py +19 -0
  25. vellum/client/types/node_execution_streaming_body.py +22 -0
  26. vellum/client/types/node_execution_streaming_event.py +49 -0
  27. vellum/client/types/node_parent_context.py +43 -0
  28. vellum/client/types/parent_context.py +21 -0
  29. vellum/client/types/prompt_deployment_parent_context.py +49 -0
  30. vellum/client/types/slim_workflow_execution_read.py +54 -0
  31. vellum/client/types/span_link.py +41 -0
  32. vellum/client/types/span_link_type_enum.py +5 -0
  33. vellum/client/types/vellum_code_resource_definition.py +25 -0
  34. vellum/client/types/vellum_node_execution_event.py +18 -0
  35. vellum/client/types/vellum_sdk_error.py +21 -0
  36. vellum/client/types/vellum_sdk_error_code_enum.py +20 -0
  37. vellum/client/types/vellum_span.py +7 -0
  38. vellum/client/types/vellum_workflow_execution_event.py +20 -0
  39. vellum/client/types/workflow_deployment_event_executions_response.py +55 -0
  40. vellum/client/types/workflow_deployment_parent_context.py +49 -0
  41. vellum/client/types/workflow_error.py +7 -0
  42. vellum/client/types/workflow_event_display_context.py +28 -0
  43. vellum/client/types/workflow_event_execution_read.py +60 -0
  44. vellum/client/types/workflow_execution_actual.py +30 -0
  45. vellum/client/types/workflow_execution_fulfilled_body.py +21 -0
  46. vellum/client/types/workflow_execution_fulfilled_event.py +49 -0
  47. vellum/client/types/workflow_execution_initiated_body.py +30 -0
  48. vellum/client/types/workflow_execution_initiated_event.py +53 -0
  49. vellum/client/types/workflow_execution_paused_body.py +22 -0
  50. vellum/client/types/workflow_execution_paused_event.py +49 -0
  51. vellum/client/types/workflow_execution_rejected_body.py +22 -0
  52. vellum/client/types/workflow_execution_rejected_event.py +49 -0
  53. vellum/client/types/workflow_execution_resumed_body.py +20 -0
  54. vellum/client/types/workflow_execution_resumed_event.py +49 -0
  55. vellum/client/types/workflow_execution_snapshotted_body.py +21 -0
  56. vellum/client/types/workflow_execution_snapshotted_event.py +51 -0
  57. vellum/client/types/workflow_execution_span.py +50 -0
  58. vellum/client/types/workflow_execution_span_attributes.py +19 -0
  59. vellum/client/types/workflow_execution_streaming_body.py +22 -0
  60. vellum/client/types/workflow_execution_streaming_event.py +49 -0
  61. vellum/client/types/workflow_execution_usage_calculation_fulfilled_body.py +22 -0
  62. vellum/client/types/workflow_execution_view_online_eval_metric_result.py +30 -0
  63. vellum/client/types/workflow_initialization_error.py +24 -0
  64. vellum/client/types/workflow_parent_context.py +43 -0
  65. vellum/client/types/workflow_sandbox_parent_context.py +44 -0
  66. vellum/types/api_request_parent_context.py +3 -0
  67. vellum/types/api_version_enum.py +3 -0
  68. vellum/types/base_output.py +3 -0
  69. vellum/types/code_resource_definition.py +3 -0
  70. vellum/types/external_input_descriptor.py +3 -0
  71. vellum/types/invoked_port.py +3 -0
  72. vellum/types/ml_model_usage_wrapper.py +3 -0
  73. vellum/types/node_event_display_context.py +3 -0
  74. vellum/types/node_execution_fulfilled_body.py +3 -0
  75. vellum/types/node_execution_fulfilled_event.py +3 -0
  76. vellum/types/node_execution_initiated_body.py +3 -0
  77. vellum/types/node_execution_initiated_event.py +3 -0
  78. vellum/types/node_execution_paused_body.py +3 -0
  79. vellum/types/node_execution_paused_event.py +3 -0
  80. vellum/types/node_execution_rejected_body.py +3 -0
  81. vellum/types/node_execution_rejected_event.py +3 -0
  82. vellum/types/node_execution_resumed_body.py +3 -0
  83. vellum/types/node_execution_resumed_event.py +3 -0
  84. vellum/types/node_execution_span.py +3 -0
  85. vellum/types/node_execution_span_attributes.py +3 -0
  86. vellum/types/node_execution_streaming_body.py +3 -0
  87. vellum/types/node_execution_streaming_event.py +3 -0
  88. vellum/types/node_parent_context.py +3 -0
  89. vellum/types/parent_context.py +3 -0
  90. vellum/types/prompt_deployment_parent_context.py +3 -0
  91. vellum/types/slim_workflow_execution_read.py +3 -0
  92. vellum/types/span_link.py +3 -0
  93. vellum/types/span_link_type_enum.py +3 -0
  94. vellum/types/vellum_code_resource_definition.py +3 -0
  95. vellum/types/vellum_node_execution_event.py +3 -0
  96. vellum/types/vellum_sdk_error.py +3 -0
  97. vellum/types/vellum_sdk_error_code_enum.py +3 -0
  98. vellum/types/vellum_span.py +3 -0
  99. vellum/types/vellum_workflow_execution_event.py +3 -0
  100. vellum/types/workflow_deployment_event_executions_response.py +3 -0
  101. vellum/types/workflow_deployment_parent_context.py +3 -0
  102. vellum/types/workflow_error.py +3 -0
  103. vellum/types/workflow_event_display_context.py +3 -0
  104. vellum/types/workflow_event_execution_read.py +3 -0
  105. vellum/types/workflow_execution_actual.py +3 -0
  106. vellum/types/workflow_execution_fulfilled_body.py +3 -0
  107. vellum/types/workflow_execution_fulfilled_event.py +3 -0
  108. vellum/types/workflow_execution_initiated_body.py +3 -0
  109. vellum/types/workflow_execution_initiated_event.py +3 -0
  110. vellum/types/workflow_execution_paused_body.py +3 -0
  111. vellum/types/workflow_execution_paused_event.py +3 -0
  112. vellum/types/workflow_execution_rejected_body.py +3 -0
  113. vellum/types/workflow_execution_rejected_event.py +3 -0
  114. vellum/types/workflow_execution_resumed_body.py +3 -0
  115. vellum/types/workflow_execution_resumed_event.py +3 -0
  116. vellum/types/workflow_execution_snapshotted_body.py +3 -0
  117. vellum/types/workflow_execution_snapshotted_event.py +3 -0
  118. vellum/types/workflow_execution_span.py +3 -0
  119. vellum/types/workflow_execution_span_attributes.py +3 -0
  120. vellum/types/workflow_execution_streaming_body.py +3 -0
  121. vellum/types/workflow_execution_streaming_event.py +3 -0
  122. vellum/types/workflow_execution_usage_calculation_fulfilled_body.py +3 -0
  123. vellum/types/workflow_execution_view_online_eval_metric_result.py +3 -0
  124. vellum/types/workflow_initialization_error.py +3 -0
  125. vellum/types/workflow_parent_context.py +3 -0
  126. vellum/types/workflow_sandbox_parent_context.py +3 -0
  127. vellum/workflows/nodes/core/retry_node/tests/test_node.py +0 -23
  128. vellum/workflows/workflows/base.py +2 -2
  129. vellum/workflows/workflows/tests/test_base_workflow.py +10 -0
  130. {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/METADATA +1 -1
  131. {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/RECORD +139 -17
  132. vellum_ee/workflows/display/nodes/vellum/final_output_node.py +8 -0
  133. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +8 -0
  134. vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +12 -8
  135. vellum_ee/workflows/display/workflows/base_workflow_display.py +0 -6
  136. vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +14 -0
  137. {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/LICENSE +0 -0
  138. {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/WHEEL +0 -0
  139. {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_actual import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_fulfilled_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_fulfilled_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_initiated_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_initiated_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_paused_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_paused_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_rejected_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_rejected_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_resumed_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_resumed_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_snapshotted_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_snapshotted_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_span import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_span_attributes import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_streaming_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_streaming_event import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_usage_calculation_fulfilled_body import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_execution_view_online_eval_metric_result import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_initialization_error import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_parent_context import *
@@ -0,0 +1,3 @@
1
+ # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
+
3
+ from vellum.client.types.workflow_sandbox_parent_context import *
@@ -33,29 +33,6 @@ def test_retry_node__retry_on_error_code__successfully_retried():
33
33
  assert outputs.execution_count == 3
34
34
 
35
35
 
36
- def test_retry_node__retry_on_error_code_all():
37
- # GIVEN a retry node that is configured to retry on all errors
38
- @RetryNode.wrap(max_attempts=3)
39
- class TestNode(BaseNode):
40
- attempt_number = RetryNode.SubworkflowInputs.attempt_number
41
-
42
- class Outputs(BaseOutputs):
43
- execution_count: int
44
-
45
- def run(self) -> Outputs:
46
- if self.attempt_number < 3:
47
- raise NodeException(message="This will be retried", code=WorkflowErrorCode.PROVIDER_ERROR)
48
-
49
- return self.Outputs(execution_count=self.attempt_number)
50
-
51
- # WHEN the node is run and throws a None
52
- node = TestNode(state=BaseState())
53
- outputs = node.run()
54
-
55
- # THEN the exception is retried
56
- assert outputs.execution_count == 3
57
-
58
-
59
36
  def test_retry_node__retry_on_error_code__missed():
60
37
  # GIVEN a retry node that is configured to retry on PROVIDER_ERROR
61
38
  @RetryNode.wrap(max_attempts=3, retry_on_error_code=WorkflowErrorCode.PROVIDER_ERROR)
@@ -110,10 +110,10 @@ class _BaseWorkflowMeta(type):
110
110
  nodes.update(node for node in item.nodes)
111
111
  elif inspect.isclass(item) and issubclass(item, BaseNode):
112
112
  nodes.add(item)
113
- elif issubclass(graph_item, BaseNode):
113
+ elif inspect.isclass(graph_item) and issubclass(graph_item, BaseNode):
114
114
  nodes.add(graph_item)
115
115
  else:
116
- raise ValueError(f"Unexpected graph type: {graph_item.__class__}")
116
+ raise TypeError(f"Unexpected graph type: {graph_item.__class__}")
117
117
  return nodes
118
118
 
119
119
  graph_nodes = collect_nodes(dct.get("graph", set()))
@@ -304,3 +304,13 @@ def test_workflow__node_in_both_graph_and_unused():
304
304
 
305
305
  # THEN it should raise an error
306
306
  assert "Node(s) NodeA cannot appear in both graph and unused_graphs" in str(exc_info.value)
307
+
308
+
309
+ def test_workflow__unsupported_graph_item():
310
+ with pytest.raises(TypeError) as exc_info:
311
+ # GIVEN a workflow with an unsupported graph item
312
+ class TestWorkflow(BaseWorkflow[BaseInputs, BaseState]):
313
+ graph = 1 # type: ignore
314
+
315
+ # THEN it should raise an error
316
+ assert "Unexpected graph type: <class 'int'>" in str(exc_info.value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 0.14.22
3
+ Version: 0.14.23
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.9,<4.0