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.
- vellum/__init__.py +122 -0
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/resources/workflow_deployments/client.py +250 -0
- vellum/client/types/__init__.py +122 -0
- vellum/client/types/api_request_parent_context.py +41 -0
- vellum/client/types/api_version_enum.py +5 -0
- vellum/client/types/base_output.py +21 -0
- vellum/client/types/code_resource_definition.py +31 -0
- vellum/client/types/external_input_descriptor.py +23 -0
- vellum/client/types/invoked_port.py +19 -0
- vellum/client/types/ml_model_usage_wrapper.py +21 -0
- vellum/client/types/node_event_display_context.py +30 -0
- vellum/client/types/node_execution_fulfilled_body.py +24 -0
- vellum/client/types/node_execution_fulfilled_event.py +49 -0
- vellum/client/types/node_execution_initiated_body.py +21 -0
- vellum/client/types/node_execution_initiated_event.py +49 -0
- vellum/client/types/node_execution_paused_body.py +20 -0
- vellum/client/types/node_execution_paused_event.py +49 -0
- vellum/client/types/node_execution_rejected_body.py +22 -0
- vellum/client/types/node_execution_rejected_event.py +49 -0
- vellum/client/types/node_execution_resumed_body.py +20 -0
- vellum/client/types/node_execution_resumed_event.py +49 -0
- vellum/client/types/node_execution_span.py +46 -0
- vellum/client/types/node_execution_span_attributes.py +19 -0
- vellum/client/types/node_execution_streaming_body.py +22 -0
- vellum/client/types/node_execution_streaming_event.py +49 -0
- vellum/client/types/node_parent_context.py +43 -0
- vellum/client/types/parent_context.py +21 -0
- vellum/client/types/prompt_deployment_parent_context.py +49 -0
- vellum/client/types/slim_workflow_execution_read.py +54 -0
- vellum/client/types/span_link.py +41 -0
- vellum/client/types/span_link_type_enum.py +5 -0
- vellum/client/types/vellum_code_resource_definition.py +25 -0
- vellum/client/types/vellum_node_execution_event.py +18 -0
- vellum/client/types/vellum_sdk_error.py +21 -0
- vellum/client/types/vellum_sdk_error_code_enum.py +20 -0
- vellum/client/types/vellum_span.py +7 -0
- vellum/client/types/vellum_workflow_execution_event.py +20 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +55 -0
- vellum/client/types/workflow_deployment_parent_context.py +49 -0
- vellum/client/types/workflow_error.py +7 -0
- vellum/client/types/workflow_event_display_context.py +28 -0
- vellum/client/types/workflow_event_execution_read.py +60 -0
- vellum/client/types/workflow_execution_actual.py +30 -0
- vellum/client/types/workflow_execution_fulfilled_body.py +21 -0
- vellum/client/types/workflow_execution_fulfilled_event.py +49 -0
- vellum/client/types/workflow_execution_initiated_body.py +30 -0
- vellum/client/types/workflow_execution_initiated_event.py +53 -0
- vellum/client/types/workflow_execution_paused_body.py +22 -0
- vellum/client/types/workflow_execution_paused_event.py +49 -0
- vellum/client/types/workflow_execution_rejected_body.py +22 -0
- vellum/client/types/workflow_execution_rejected_event.py +49 -0
- vellum/client/types/workflow_execution_resumed_body.py +20 -0
- vellum/client/types/workflow_execution_resumed_event.py +49 -0
- vellum/client/types/workflow_execution_snapshotted_body.py +21 -0
- vellum/client/types/workflow_execution_snapshotted_event.py +51 -0
- vellum/client/types/workflow_execution_span.py +50 -0
- vellum/client/types/workflow_execution_span_attributes.py +19 -0
- vellum/client/types/workflow_execution_streaming_body.py +22 -0
- vellum/client/types/workflow_execution_streaming_event.py +49 -0
- vellum/client/types/workflow_execution_usage_calculation_fulfilled_body.py +22 -0
- vellum/client/types/workflow_execution_view_online_eval_metric_result.py +30 -0
- vellum/client/types/workflow_initialization_error.py +24 -0
- vellum/client/types/workflow_parent_context.py +43 -0
- vellum/client/types/workflow_sandbox_parent_context.py +44 -0
- vellum/types/api_request_parent_context.py +3 -0
- vellum/types/api_version_enum.py +3 -0
- vellum/types/base_output.py +3 -0
- vellum/types/code_resource_definition.py +3 -0
- vellum/types/external_input_descriptor.py +3 -0
- vellum/types/invoked_port.py +3 -0
- vellum/types/ml_model_usage_wrapper.py +3 -0
- vellum/types/node_event_display_context.py +3 -0
- vellum/types/node_execution_fulfilled_body.py +3 -0
- vellum/types/node_execution_fulfilled_event.py +3 -0
- vellum/types/node_execution_initiated_body.py +3 -0
- vellum/types/node_execution_initiated_event.py +3 -0
- vellum/types/node_execution_paused_body.py +3 -0
- vellum/types/node_execution_paused_event.py +3 -0
- vellum/types/node_execution_rejected_body.py +3 -0
- vellum/types/node_execution_rejected_event.py +3 -0
- vellum/types/node_execution_resumed_body.py +3 -0
- vellum/types/node_execution_resumed_event.py +3 -0
- vellum/types/node_execution_span.py +3 -0
- vellum/types/node_execution_span_attributes.py +3 -0
- vellum/types/node_execution_streaming_body.py +3 -0
- vellum/types/node_execution_streaming_event.py +3 -0
- vellum/types/node_parent_context.py +3 -0
- vellum/types/parent_context.py +3 -0
- vellum/types/prompt_deployment_parent_context.py +3 -0
- vellum/types/slim_workflow_execution_read.py +3 -0
- vellum/types/span_link.py +3 -0
- vellum/types/span_link_type_enum.py +3 -0
- vellum/types/vellum_code_resource_definition.py +3 -0
- vellum/types/vellum_node_execution_event.py +3 -0
- vellum/types/vellum_sdk_error.py +3 -0
- vellum/types/vellum_sdk_error_code_enum.py +3 -0
- vellum/types/vellum_span.py +3 -0
- vellum/types/vellum_workflow_execution_event.py +3 -0
- vellum/types/workflow_deployment_event_executions_response.py +3 -0
- vellum/types/workflow_deployment_parent_context.py +3 -0
- vellum/types/workflow_error.py +3 -0
- vellum/types/workflow_event_display_context.py +3 -0
- vellum/types/workflow_event_execution_read.py +3 -0
- vellum/types/workflow_execution_actual.py +3 -0
- vellum/types/workflow_execution_fulfilled_body.py +3 -0
- vellum/types/workflow_execution_fulfilled_event.py +3 -0
- vellum/types/workflow_execution_initiated_body.py +3 -0
- vellum/types/workflow_execution_initiated_event.py +3 -0
- vellum/types/workflow_execution_paused_body.py +3 -0
- vellum/types/workflow_execution_paused_event.py +3 -0
- vellum/types/workflow_execution_rejected_body.py +3 -0
- vellum/types/workflow_execution_rejected_event.py +3 -0
- vellum/types/workflow_execution_resumed_body.py +3 -0
- vellum/types/workflow_execution_resumed_event.py +3 -0
- vellum/types/workflow_execution_snapshotted_body.py +3 -0
- vellum/types/workflow_execution_snapshotted_event.py +3 -0
- vellum/types/workflow_execution_span.py +3 -0
- vellum/types/workflow_execution_span_attributes.py +3 -0
- vellum/types/workflow_execution_streaming_body.py +3 -0
- vellum/types/workflow_execution_streaming_event.py +3 -0
- vellum/types/workflow_execution_usage_calculation_fulfilled_body.py +3 -0
- vellum/types/workflow_execution_view_online_eval_metric_result.py +3 -0
- vellum/types/workflow_initialization_error.py +3 -0
- vellum/types/workflow_parent_context.py +3 -0
- vellum/types/workflow_sandbox_parent_context.py +3 -0
- vellum/workflows/nodes/core/retry_node/tests/test_node.py +0 -23
- vellum/workflows/workflows/base.py +2 -2
- vellum/workflows/workflows/tests/test_base_workflow.py +10 -0
- {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/RECORD +139 -17
- vellum_ee/workflows/display/nodes/vellum/final_output_node.py +8 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +8 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +12 -8
- vellum_ee/workflows/display/workflows/base_workflow_display.py +0 -6
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +14 -0
- {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.22.dist-info → vellum_ai-0.14.23.dist-info}/entry_points.txt +0 -0
@@ -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
|
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)
|