vellum-ai 0.14.25__py3-none-any.whl → 0.14.27__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 +6 -4
- vellum/client/__init__.py +4 -0
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/core/jsonable_encoder.py +1 -1
- vellum/client/resources/__init__.py +2 -2
- vellum/client/resources/prompts/__init__.py +2 -0
- vellum/client/resources/prompts/client.py +197 -0
- vellum/client/resources/workflows/__init__.py +0 -3
- vellum/client/resources/workflows/client.py +0 -9
- vellum/client/types/__init__.py +4 -2
- vellum/client/types/deployment_release_tag_read.py +7 -1
- vellum/client/types/prompt_exec_config.py +37 -0
- vellum/client/types/{release.py → release_tag_release.py} +1 -1
- vellum/client/types/workflow_release_tag_read.py +2 -2
- vellum/client/types/workflow_release_tag_workflow_deployment_history_item.py +3 -10
- vellum/{types/release.py → resources/prompts/__init__.py} +1 -1
- vellum/resources/{workflows/types/__init__.py → prompts/client.py} +1 -1
- vellum/{resources/workflows/types/workflows_pull_request_format.py → types/prompt_exec_config.py} +1 -1
- vellum/types/release_tag_release.py +3 -0
- vellum/workflows/events/types.py +10 -7
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +2 -4
- vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +2 -4
- vellum/workflows/nodes/displayable/conftest.py +117 -0
- vellum/workflows/nodes/displayable/guardrail_node/node.py +10 -11
- vellum/workflows/nodes/displayable/guardrail_node/test_node.py +38 -0
- vellum/workflows/nodes/displayable/inline_prompt_node/tests/test_node.py +49 -0
- vellum/workflows/nodes/displayable/prompt_deployment_node/tests/test_node.py +49 -0
- vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +2 -5
- vellum/workflows/nodes/displayable/subworkflow_deployment_node/tests/test_node.py +63 -0
- vellum/workflows/references/workflow_input.py +3 -0
- vellum/workflows/runner/runner.py +2 -0
- {vellum_ai-0.14.25.dist-info → vellum_ai-0.14.27.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.25.dist-info → vellum_ai-0.14.27.dist-info}/RECORD +44 -40
- vellum_ee/workflows/display/base.py +13 -7
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py +11 -10
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_default_state_serialization.py +1 -1
- vellum_ee/workflows/display/types.py +5 -9
- vellum_ee/workflows/display/vellum.py +9 -4
- vellum_ee/workflows/display/workflows/base_workflow_display.py +20 -21
- vellum_ee/workflows/display/workflows/vellum_workflow_display.py +7 -35
- vellum_ee/workflows/tests/test_server.py +54 -0
- vellum/client/resources/workflows/types/__init__.py +0 -5
- vellum/client/resources/workflows/types/workflows_pull_request_format.py +0 -5
- {vellum_ai-0.14.25.dist-info → vellum_ai-0.14.27.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.25.dist-info → vellum_ai-0.14.27.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.25.dist-info → vellum_ai-0.14.27.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
|
@@ -69,3 +70,56 @@ class StartNode(BaseNode):
|
|
69
70
|
# AND the lazy reference has the correct name
|
70
71
|
assert start_node.foo.instance
|
71
72
|
assert start_node.foo.instance.name == "StartNode.Outputs.bar"
|
73
|
+
|
74
|
+
|
75
|
+
@pytest.mark.skip(reason="Code execution inspect and get read file from path needs to be fixed")
|
76
|
+
def test_load_from_module__ts_code_in_file_loader():
|
77
|
+
# GIVEN a workflow module with only a code execution node
|
78
|
+
files = {
|
79
|
+
"__init__.py": "",
|
80
|
+
"workflow.py": """\
|
81
|
+
from vellum.workflows import BaseWorkflow
|
82
|
+
from .nodes.code_execution_node import CodeExecutionNode
|
83
|
+
|
84
|
+
class Workflow(BaseWorkflow):
|
85
|
+
graph = CodeExecutionNode
|
86
|
+
""",
|
87
|
+
"nodes/__init__.py": """\
|
88
|
+
from .code_execution_node import CodeExecutionNode
|
89
|
+
|
90
|
+
__all__ = ["CodeExecutionNode"]
|
91
|
+
""",
|
92
|
+
"nodes/code_execution_node.py": """\
|
93
|
+
from typing import Any
|
94
|
+
|
95
|
+
from vellum.workflows.nodes.displayable import CodeExecutionNode as BaseCodeExecutionNode
|
96
|
+
from vellum.workflows.state import BaseState
|
97
|
+
|
98
|
+
class CodeExecutionNode(BaseCodeExecutionNode[BaseState, Any]):
|
99
|
+
filepath = "./script.ts"
|
100
|
+
code_inputs = {}
|
101
|
+
runtime = "TYPESCRIPT_5_3_3"
|
102
|
+
packages = []
|
103
|
+
""",
|
104
|
+
"nodes/code_execution_node/script.ts": """async function main(inputs: {
|
105
|
+
text: string,
|
106
|
+
}): any {
|
107
|
+
const matches = inputs.text.match(/\\((.+?)\\)/gs);
|
108
|
+
return matches;
|
109
|
+
}""",
|
110
|
+
}
|
111
|
+
|
112
|
+
namespace = str(uuid4())
|
113
|
+
|
114
|
+
# AND the virtual file loader is registered
|
115
|
+
sys.meta_path.append(VirtualFileFinder(files, namespace))
|
116
|
+
|
117
|
+
# WHEN the workflow is loaded
|
118
|
+
Workflow = BaseWorkflow.load_from_module(namespace)
|
119
|
+
workflow = Workflow()
|
120
|
+
|
121
|
+
# THEN the workflow is successfully initialized
|
122
|
+
assert workflow
|
123
|
+
|
124
|
+
event = workflow.run()
|
125
|
+
assert event.name == "workflow.execution.fulfilled"
|
File without changes
|
File without changes
|
File without changes
|