vellum-ai 1.7.10__py3-none-any.whl → 1.7.11__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.
Potentially problematic release.
This version of vellum-ai might be problematic. Click here for more details.
- vellum/client/core/client_wrapper.py +2 -2
- vellum/workflows/events/tests/test_event.py +1 -0
- vellum/workflows/events/workflow.py +3 -0
- vellum/workflows/exceptions.py +3 -0
- vellum/workflows/integrations/mcp_service.py +7 -0
- vellum/workflows/integrations/tests/test_mcp_service.py +48 -0
- vellum/workflows/loaders/__init__.py +3 -0
- vellum/workflows/loaders/base.py +21 -0
- vellum/workflows/tests/triggers/test_vellum_integration_trigger.py +225 -0
- vellum/workflows/triggers/__init__.py +2 -1
- vellum/workflows/triggers/vellum_integration.py +383 -0
- vellum/workflows/types/__init__.py +3 -0
- vellum/workflows/types/tests/test_utils.py +11 -0
- vellum/workflows/types/trigger_exec_config.py +63 -0
- vellum/workflows/types/utils.py +22 -0
- vellum/workflows/utils/names.py +20 -0
- vellum/workflows/workflows/base.py +13 -1
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/METADATA +1 -1
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/RECORD +31 -25
- vellum_cli/pull.py +6 -5
- vellum_cli/push.py +35 -2
- vellum_cli/tests/test_push.py +122 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_list_vellum_document_serialization.py +65 -0
- vellum_ee/workflows/display/utils/events.py +6 -3
- vellum_ee/workflows/display/utils/tests/test_events.py +29 -0
- vellum_ee/workflows/server/virtual_file_loader.py +15 -4
- vellum_ee/workflows/tests/test_serialize_module.py +48 -0
- vellum_ee/workflows/tests/test_server.py +105 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/LICENSE +0 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/WHEEL +0 -0
- {vellum_ai-1.7.10.dist-info → vellum_ai-1.7.11.dist-info}/entry_points.txt +0 -0
|
@@ -584,6 +584,111 @@ class BrokenNode(BaseNode):
|
|
|
584
584
|
assert "UndefinedClass" in error_message or "not defined" in error_message
|
|
585
585
|
|
|
586
586
|
|
|
587
|
+
def test_load_from_module__module_not_found_error():
|
|
588
|
+
"""
|
|
589
|
+
Tests that a ModuleNotFoundError raises WorkflowInitializationException with user-facing message.
|
|
590
|
+
"""
|
|
591
|
+
# GIVEN a workflow module that imports a non-existent module
|
|
592
|
+
files = {
|
|
593
|
+
"__init__.py": "",
|
|
594
|
+
"workflow.py": """\
|
|
595
|
+
from vellum.workflows import BaseWorkflow
|
|
596
|
+
from .non_existent_module import SomeClass
|
|
597
|
+
|
|
598
|
+
class Workflow(BaseWorkflow):
|
|
599
|
+
graph = None
|
|
600
|
+
""",
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
namespace = str(uuid4())
|
|
604
|
+
|
|
605
|
+
# AND the virtual file loader is registered
|
|
606
|
+
sys.meta_path.append(VirtualFileFinder(files, namespace, source_module="test"))
|
|
607
|
+
|
|
608
|
+
# WHEN we attempt to load the workflow
|
|
609
|
+
# THEN it should raise WorkflowInitializationException
|
|
610
|
+
with pytest.raises(WorkflowInitializationException) as exc_info:
|
|
611
|
+
BaseWorkflow.load_from_module(namespace)
|
|
612
|
+
|
|
613
|
+
# AND the error message should be user-friendly and show source_module instead of namespace
|
|
614
|
+
error_message = str(exc_info.value)
|
|
615
|
+
assert error_message == "Workflow module not found: No module named 'test.non_existent_module'"
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
def test_load_from_module__module_not_found_error_with_external_package():
|
|
619
|
+
"""
|
|
620
|
+
Tests that when ModuleNotFoundError occurs for an external package (not containing the namespace),
|
|
621
|
+
the exception includes vellum_on_error_action set to CREATE_CUSTOM_IMAGE in raw_data.
|
|
622
|
+
"""
|
|
623
|
+
|
|
624
|
+
# GIVEN a workflow module that imports a non-existent external package
|
|
625
|
+
files = {
|
|
626
|
+
"__init__.py": "",
|
|
627
|
+
"workflow.py": """\
|
|
628
|
+
from vellum.workflows import BaseWorkflow
|
|
629
|
+
import some_external_package
|
|
630
|
+
|
|
631
|
+
class Workflow(BaseWorkflow):
|
|
632
|
+
graph = None
|
|
633
|
+
""",
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
namespace = str(uuid4())
|
|
637
|
+
|
|
638
|
+
# AND the virtual file loader is registered
|
|
639
|
+
finder = VirtualFileFinder(files, namespace, source_module="test")
|
|
640
|
+
sys.meta_path.append(finder)
|
|
641
|
+
|
|
642
|
+
# WHEN we attempt to load the workflow
|
|
643
|
+
# THEN it should raise WorkflowInitializationException
|
|
644
|
+
with pytest.raises(WorkflowInitializationException) as exc_info:
|
|
645
|
+
BaseWorkflow.load_from_module(namespace)
|
|
646
|
+
|
|
647
|
+
# AND the error message should be user-friendly
|
|
648
|
+
error_message = str(exc_info.value)
|
|
649
|
+
assert "Workflow module not found:" in error_message
|
|
650
|
+
assert "some_external_package" in error_message
|
|
651
|
+
|
|
652
|
+
assert exc_info.value.raw_data is not None
|
|
653
|
+
assert exc_info.value.raw_data["vellum_on_error_action"] == "CREATE_CUSTOM_IMAGE"
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
def test_load_from_module__module_not_found_error_with_internal_package():
|
|
657
|
+
"""
|
|
658
|
+
Tests that when ModuleNotFoundError occurs for an internal module (containing the namespace),
|
|
659
|
+
the exception does NOT include vellum_on_error_action in raw_data.
|
|
660
|
+
"""
|
|
661
|
+
|
|
662
|
+
# GIVEN a workflow module that imports a non-existent internal module
|
|
663
|
+
files = {
|
|
664
|
+
"__init__.py": "",
|
|
665
|
+
"workflow.py": """\
|
|
666
|
+
from vellum.workflows import BaseWorkflow
|
|
667
|
+
from .non_existent_module import SomeClass
|
|
668
|
+
|
|
669
|
+
class Workflow(BaseWorkflow):
|
|
670
|
+
graph = None
|
|
671
|
+
""",
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
namespace = str(uuid4())
|
|
675
|
+
|
|
676
|
+
# AND the virtual file loader is registered
|
|
677
|
+
finder = VirtualFileFinder(files, namespace, source_module="test")
|
|
678
|
+
sys.meta_path.append(finder)
|
|
679
|
+
|
|
680
|
+
# WHEN we attempt to load the workflow
|
|
681
|
+
# THEN it should raise WorkflowInitializationException
|
|
682
|
+
with pytest.raises(WorkflowInitializationException) as exc_info:
|
|
683
|
+
BaseWorkflow.load_from_module(namespace)
|
|
684
|
+
|
|
685
|
+
# AND the error message should be user-friendly
|
|
686
|
+
error_message = str(exc_info.value)
|
|
687
|
+
assert "Workflow module not found:" in error_message
|
|
688
|
+
|
|
689
|
+
assert exc_info.value.raw_data is None
|
|
690
|
+
|
|
691
|
+
|
|
587
692
|
def test_serialize_module__tool_calling_node_with_single_tool():
|
|
588
693
|
"""Test that serialize_module works with a tool calling node that has a single tool."""
|
|
589
694
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|