vellum-ai 1.6.4__py3-none-any.whl → 1.7.1__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 +2 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/reference.md +81 -0
- vellum/client/resources/container_images/client.py +8 -2
- vellum/client/resources/container_images/raw_client.py +8 -0
- vellum/client/resources/workflows/client.py +81 -0
- vellum/client/resources/workflows/raw_client.py +85 -0
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/workflow_resolved_state.py +31 -0
- vellum/types/workflow_resolved_state.py +3 -0
- vellum/workflows/descriptors/base.py +3 -0
- vellum/workflows/errors/types.py +1 -0
- vellum/workflows/inputs/base.py +4 -1
- vellum/workflows/inputs/tests/test_inputs.py +21 -0
- vellum/workflows/resolvers/resolver.py +13 -46
- vellum/workflows/resolvers/tests/test_resolver.py +27 -112
- vellum/workflows/runner/runner.py +16 -0
- vellum/workflows/workflows/base.py +2 -0
- {vellum_ai-1.6.4.dist-info → vellum_ai-1.7.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.6.4.dist-info → vellum_ai-1.7.1.dist-info}/RECORD +39 -37
- vellum_ee/assets/node-definitions.json +203 -18
- vellum_ee/workflows/display/exceptions.py +2 -6
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +11 -4
- vellum_ee/workflows/display/nodes/vellum/search_node.py +4 -4
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +11 -4
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +1 -1
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py +30 -0
- vellum_ee/workflows/display/utils/exceptions.py +19 -0
- vellum_ee/workflows/display/utils/expressions.py +19 -11
- vellum_ee/workflows/display/utils/vellum.py +7 -1
- vellum_ee/workflows/display/workflows/base_workflow_display.py +11 -3
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +54 -1
- vellum_ee/workflows/tests/test_server.py +41 -0
- {vellum_ai-1.6.4.dist-info → vellum_ai-1.7.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.6.4.dist-info → vellum_ai-1.7.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.6.4.dist-info → vellum_ai-1.7.1.dist-info}/entry_points.txt +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
import pytest
|
1
2
|
import sys
|
2
3
|
from uuid import uuid4
|
3
4
|
from typing import Type, cast
|
@@ -6,6 +7,7 @@ from vellum.client.core.pydantic_utilities import UniversalBaseModel
|
|
6
7
|
from vellum.client.types.code_executor_response import CodeExecutorResponse
|
7
8
|
from vellum.client.types.number_vellum_value import NumberVellumValue
|
8
9
|
from vellum.workflows import BaseWorkflow
|
10
|
+
from vellum.workflows.exceptions import WorkflowInitializationException
|
9
11
|
from vellum.workflows.nodes import BaseNode
|
10
12
|
from vellum.workflows.state.context import WorkflowContext
|
11
13
|
from vellum.workflows.utils.uuids import generate_workflow_deployment_prefix
|
@@ -499,6 +501,45 @@ class MapNodeWorkflow(BaseWorkflow):
|
|
499
501
|
assert event.body.outputs == {"results": [1.0, 1.0, 1.0]}
|
500
502
|
|
501
503
|
|
504
|
+
def test_load_from_module__syntax_error_in_node_file():
|
505
|
+
"""
|
506
|
+
Tests that a syntax error in a node file raises WorkflowInitializationException with user-facing message.
|
507
|
+
"""
|
508
|
+
# GIVEN a workflow module with a node file containing a syntax error (missing colon)
|
509
|
+
files = {
|
510
|
+
"__init__.py": "",
|
511
|
+
"workflow.py": """\
|
512
|
+
from vellum.workflows import BaseWorkflow
|
513
|
+
from .nodes.broken_node import BrokenNode
|
514
|
+
|
515
|
+
class Workflow(BaseWorkflow):
|
516
|
+
graph = BrokenNode
|
517
|
+
""",
|
518
|
+
"nodes/__init__.py": "",
|
519
|
+
"nodes/broken_node.py": """\
|
520
|
+
from vellum.workflows.nodes import BaseNode
|
521
|
+
|
522
|
+
class BrokenNode(BaseNode) # Missing colon
|
523
|
+
\"\"\"This node has a syntax error.\"\"\"
|
524
|
+
""",
|
525
|
+
}
|
526
|
+
|
527
|
+
namespace = str(uuid4())
|
528
|
+
|
529
|
+
# AND the virtual file loader is registered
|
530
|
+
sys.meta_path.append(VirtualFileFinder(files, namespace))
|
531
|
+
|
532
|
+
# WHEN we attempt to load the workflow
|
533
|
+
# THEN it should raise WorkflowInitializationException
|
534
|
+
with pytest.raises(WorkflowInitializationException) as exc_info:
|
535
|
+
BaseWorkflow.load_from_module(namespace)
|
536
|
+
|
537
|
+
# AND the error message should be user-friendly
|
538
|
+
error_message = str(exc_info.value)
|
539
|
+
assert "Failed to load workflow module:" in error_message
|
540
|
+
assert "invalid syntax" in error_message or "expected ':'" in error_message
|
541
|
+
|
542
|
+
|
502
543
|
def test_serialize_module__tool_calling_node_with_single_tool():
|
503
544
|
"""Test that serialize_module works with a tool calling node that has a single tool."""
|
504
545
|
|
File without changes
|
File without changes
|
File without changes
|