vellum-ai 1.2.2__py3-none-any.whl → 1.2.3__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 (85) hide show
  1. vellum/__init__.py +40 -0
  2. vellum/client/core/client_wrapper.py +2 -2
  3. vellum/client/core/pydantic_utilities.py +3 -2
  4. vellum/client/reference.md +16 -0
  5. vellum/client/resources/workflow_executions/client.py +28 -4
  6. vellum/client/resources/workflow_executions/raw_client.py +32 -2
  7. vellum/client/types/__init__.py +40 -0
  8. vellum/client/types/audio_input_request.py +30 -0
  9. vellum/client/types/delimiter_chunker_config.py +20 -0
  10. vellum/client/types/delimiter_chunker_config_request.py +20 -0
  11. vellum/client/types/delimiter_chunking.py +21 -0
  12. vellum/client/types/delimiter_chunking_request.py +21 -0
  13. vellum/client/types/document_index_chunking.py +4 -1
  14. vellum/client/types/document_index_chunking_request.py +2 -1
  15. vellum/client/types/document_input_request.py +30 -0
  16. vellum/client/types/execution_audio_vellum_value.py +31 -0
  17. vellum/client/types/execution_document_vellum_value.py +31 -0
  18. vellum/client/types/execution_image_vellum_value.py +31 -0
  19. vellum/client/types/execution_vellum_value.py +8 -0
  20. vellum/client/types/execution_video_vellum_value.py +31 -0
  21. vellum/client/types/image_input_request.py +30 -0
  22. vellum/client/types/logical_operator.py +1 -0
  23. vellum/client/types/node_input_compiled_audio_value.py +23 -0
  24. vellum/client/types/node_input_compiled_document_value.py +23 -0
  25. vellum/client/types/node_input_compiled_image_value.py +23 -0
  26. vellum/client/types/node_input_compiled_video_value.py +23 -0
  27. vellum/client/types/node_input_variable_compiled_value.py +8 -0
  28. vellum/client/types/prompt_deployment_input_request.py +13 -1
  29. vellum/client/types/prompt_request_audio_input.py +26 -0
  30. vellum/client/types/prompt_request_document_input.py +26 -0
  31. vellum/client/types/prompt_request_image_input.py +26 -0
  32. vellum/client/types/prompt_request_input.py +13 -1
  33. vellum/client/types/prompt_request_video_input.py +26 -0
  34. vellum/client/types/video_input_request.py +30 -0
  35. vellum/types/audio_input_request.py +3 -0
  36. vellum/types/delimiter_chunker_config.py +3 -0
  37. vellum/types/delimiter_chunker_config_request.py +3 -0
  38. vellum/types/delimiter_chunking.py +3 -0
  39. vellum/types/delimiter_chunking_request.py +3 -0
  40. vellum/types/document_input_request.py +3 -0
  41. vellum/types/execution_audio_vellum_value.py +3 -0
  42. vellum/types/execution_document_vellum_value.py +3 -0
  43. vellum/types/execution_image_vellum_value.py +3 -0
  44. vellum/types/execution_video_vellum_value.py +3 -0
  45. vellum/types/image_input_request.py +3 -0
  46. vellum/types/node_input_compiled_audio_value.py +3 -0
  47. vellum/types/node_input_compiled_document_value.py +3 -0
  48. vellum/types/node_input_compiled_image_value.py +3 -0
  49. vellum/types/node_input_compiled_video_value.py +3 -0
  50. vellum/types/prompt_request_audio_input.py +3 -0
  51. vellum/types/prompt_request_document_input.py +3 -0
  52. vellum/types/prompt_request_image_input.py +3 -0
  53. vellum/types/prompt_request_video_input.py +3 -0
  54. vellum/types/video_input_request.py +3 -0
  55. vellum/workflows/context.py +27 -9
  56. vellum/workflows/events/context.py +53 -78
  57. vellum/workflows/events/node.py +5 -5
  58. vellum/workflows/events/relational_threads.py +41 -0
  59. vellum/workflows/events/tests/test_basic_workflow.py +50 -0
  60. vellum/workflows/events/workflow.py +12 -1
  61. vellum/workflows/expressions/contains.py +7 -0
  62. vellum/workflows/expressions/tests/test_contains.py +175 -0
  63. vellum/workflows/graph/graph.py +52 -8
  64. vellum/workflows/graph/tests/test_graph.py +17 -0
  65. vellum/workflows/integrations/mcp_service.py +35 -5
  66. vellum/workflows/integrations/tests/test_mcp_service.py +81 -0
  67. vellum/workflows/nodes/core/error_node/node.py +4 -0
  68. vellum/workflows/nodes/core/map_node/node.py +7 -0
  69. vellum/workflows/nodes/core/map_node/tests/test_node.py +19 -0
  70. vellum/workflows/nodes/displayable/final_output_node/node.py +4 -0
  71. vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +1 -1
  72. vellum/workflows/ports/node_ports.py +3 -0
  73. vellum/workflows/ports/port.py +7 -0
  74. vellum/workflows/state/context.py +35 -4
  75. vellum/workflows/utils/uuids.py +15 -0
  76. {vellum_ai-1.2.2.dist-info → vellum_ai-1.2.3.dist-info}/METADATA +1 -1
  77. {vellum_ai-1.2.2.dist-info → vellum_ai-1.2.3.dist-info}/RECORD +85 -39
  78. vellum_ee/workflows/display/nodes/vellum/error_node.py +1 -5
  79. vellum_ee/workflows/display/nodes/vellum/final_output_node.py +1 -5
  80. vellum_ee/workflows/display/utils/events.py +24 -0
  81. vellum_ee/workflows/display/utils/tests/test_events.py +69 -0
  82. vellum_ee/workflows/tests/test_server.py +95 -0
  83. {vellum_ai-1.2.2.dist-info → vellum_ai-1.2.3.dist-info}/LICENSE +0 -0
  84. {vellum_ai-1.2.2.dist-info → vellum_ai-1.2.3.dist-info}/WHEEL +0 -0
  85. {vellum_ai-1.2.2.dist-info → vellum_ai-1.2.3.dist-info}/entry_points.txt +0 -0
@@ -8,6 +8,7 @@ from vellum.client.types.number_vellum_value import NumberVellumValue
8
8
  from vellum.workflows import BaseWorkflow
9
9
  from vellum.workflows.nodes import BaseNode
10
10
  from vellum.workflows.state.context import WorkflowContext
11
+ from vellum.workflows.utils.uuids import generate_workflow_deployment_prefix
11
12
  from vellum_ee.workflows.display.workflows.base_workflow_display import BaseWorkflowDisplay
12
13
  from vellum_ee.workflows.server.virtual_file_loader import VirtualFileFinder
13
14
 
@@ -566,3 +567,97 @@ class Workflow(BaseWorkflow[Inputs, BaseState]):
566
567
 
567
568
  # THEN the serialization should complete successfully
568
569
  assert result is not None
570
+
571
+
572
+ def test_resolve_workflow_deployment__returns_workflow_with_generated_files():
573
+ """
574
+ Test that resolve_workflow_deployment returns a workflow with artifacts
575
+ in generated_files using the correct prefix format.
576
+ """
577
+ # GIVEN a deployment name and release tag
578
+ deployment_name = "test_deployment"
579
+ release_tag = "LATEST"
580
+
581
+ expected_prefix = generate_workflow_deployment_prefix(deployment_name, release_tag)
582
+
583
+ # Create a simple test node for the resolved workflow
584
+ test_node_code = """
585
+ from vellum.workflows.nodes.bases.base import BaseNode
586
+ from vellum.workflows.outputs import BaseOutputs
587
+
588
+ class TestNode(BaseNode):
589
+ template = "Hello"
590
+
591
+ class Outputs(BaseOutputs):
592
+ result: str
593
+
594
+ def run(self):
595
+ return self.Outputs(result="Hello, {template}")
596
+ """
597
+
598
+ mock_workflow_code = """
599
+ from vellum.workflows import BaseWorkflow
600
+ from .nodes.test_node import TestNode
601
+
602
+ class ResolvedWorkflow(BaseWorkflow):
603
+ graph = TestNode
604
+ """
605
+
606
+ # Create parent workflow files that reference the subworkflow deployment
607
+ parent_workflow_code = """
608
+ from vellum.workflows import BaseWorkflow
609
+ from .nodes.subworkflow_deployment_node import TestSubworkflowDeploymentNode
610
+
611
+ class ParentWorkflow(BaseWorkflow):
612
+ graph = TestSubworkflowDeploymentNode
613
+ """
614
+
615
+ parent_node_code = """
616
+ from vellum.workflows.nodes import SubworkflowDeploymentNode
617
+ from vellum.workflows.outputs import BaseOutputs
618
+
619
+ class TestSubworkflowDeploymentNode(SubworkflowDeploymentNode):
620
+ deployment = "test_deployment"
621
+
622
+ class Outputs(BaseOutputs):
623
+ result: str
624
+
625
+ subworkflow_inputs = {"message": "test"}
626
+ """
627
+
628
+ files = {
629
+ "__init__.py": "",
630
+ "workflow.py": parent_workflow_code,
631
+ "nodes/__init__.py": """
632
+ from .subworkflow_deployment_node import TestSubworkflowDeploymentNode
633
+
634
+ __all__ = ["TestSubworkflowDeploymentNode"]
635
+ """,
636
+ "nodes/subworkflow_deployment_node.py": parent_node_code,
637
+ f"{expected_prefix}/__init__.py": "",
638
+ f"{expected_prefix}/workflow.py": mock_workflow_code,
639
+ f"{expected_prefix}/nodes/__init__.py": """
640
+ from .test_node import TestNode
641
+
642
+ __all__ = ["TestNode"]
643
+ """,
644
+ f"{expected_prefix}/nodes/test_node.py": test_node_code,
645
+ }
646
+
647
+ namespace = str(uuid4())
648
+
649
+ # AND the virtual file loader is registered
650
+ finder = VirtualFileFinder(files, namespace)
651
+ sys.meta_path.append(finder)
652
+
653
+ # WHEN we execute the root workflow
654
+ Workflow = BaseWorkflow.load_from_module(namespace)
655
+ workflow = Workflow(context=WorkflowContext(generated_files=files, namespace=namespace))
656
+
657
+ # THEN the workflow should be successfully initialized
658
+ assert workflow
659
+
660
+ event = workflow.run()
661
+
662
+ # AND the method should return a workflow (not None) - this will pass once implemented
663
+ assert event.name == "workflow.execution.fulfilled"