vellum-ai 0.14.46__py3-none-any.whl → 0.14.48__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/client/README.md +2 -2
- vellum/client/__init__.py +72 -6
- vellum/client/core/client_wrapper.py +1 -1
- vellum/client/core/file.py +13 -8
- vellum/client/core/http_client.py +26 -14
- vellum/client/core/pydantic_utilities.py +2 -2
- vellum/client/core/request_options.py +3 -0
- vellum/client/resources/ad_hoc/client.py +14 -2
- vellum/client/resources/container_images/client.py +6 -0
- vellum/client/resources/deployments/client.py +12 -0
- vellum/client/resources/document_indexes/client.py +18 -0
- vellum/client/resources/documents/client.py +6 -0
- vellum/client/resources/folder_entities/client.py +6 -0
- vellum/client/resources/metric_definitions/client.py +6 -0
- vellum/client/resources/prompts/client.py +6 -0
- vellum/client/resources/sandboxes/client.py +12 -0
- vellum/client/resources/test_suite_runs/client.py +6 -0
- vellum/client/resources/test_suites/client.py +2 -2
- vellum/client/resources/workflow_deployments/client.py +6 -0
- vellum/client/resources/workflow_sandboxes/client.py +6 -0
- vellum/client/resources/workflows/client.py +6 -4
- vellum/client/resources/workspace_secrets/client.py +6 -0
- vellum/client/types/api_request_parent_context.py +0 -6
- vellum/client/types/array_input.py +0 -5
- vellum/client/types/code_execution_node_array_result.py +0 -5
- vellum/client/types/code_execution_node_result.py +0 -5
- vellum/client/types/code_execution_node_result_data.py +0 -5
- vellum/client/types/code_executor_response.py +0 -5
- vellum/client/types/create_test_suite_test_case_request.py +0 -5
- vellum/client/types/deployment_history_item.py +0 -5
- vellum/client/types/deployment_read.py +0 -5
- vellum/client/types/execute_workflow_response.py +0 -5
- vellum/client/types/execution_array_vellum_value.py +0 -5
- vellum/client/types/external_test_case_execution.py +0 -5
- vellum/client/types/external_test_case_execution_request.py +0 -5
- vellum/client/types/fulfilled_execute_workflow_workflow_result_event.py +0 -7
- vellum/client/types/fulfilled_workflow_node_result_event.py +0 -5
- vellum/client/types/initiated_workflow_node_result_event.py +0 -5
- vellum/client/types/metadata_filter_config_request.py +0 -5
- vellum/client/types/metric_definition_execution.py +0 -5
- vellum/client/types/metric_definition_history_item.py +0 -5
- vellum/client/types/named_test_case_array_variable_value.py +0 -5
- vellum/client/types/named_test_case_array_variable_value_request.py +0 -7
- vellum/client/types/node_execution_fulfilled_event.py +0 -11
- vellum/client/types/node_execution_initiated_event.py +0 -11
- vellum/client/types/node_execution_paused_event.py +0 -11
- vellum/client/types/node_execution_rejected_event.py +0 -11
- vellum/client/types/node_execution_resumed_event.py +0 -11
- vellum/client/types/node_execution_span.py +0 -11
- vellum/client/types/node_execution_streaming_event.py +0 -11
- vellum/client/types/node_input_compiled_array_value.py +0 -5
- vellum/client/types/node_output_compiled_array_value.py +0 -5
- vellum/client/types/node_parent_context.py +0 -6
- vellum/client/types/paginated_slim_deployment_read_list.py +0 -5
- vellum/client/types/paginated_slim_workflow_deployment_list.py +0 -5
- vellum/client/types/paginated_test_suite_run_execution_list.py +0 -5
- vellum/client/types/paginated_test_suite_test_case_list.py +0 -5
- vellum/client/types/prompt_deployment_parent_context.py +0 -6
- vellum/client/types/prompt_exec_config.py +0 -6
- vellum/client/types/rejected_workflow_node_result_event.py +0 -5
- vellum/client/types/replace_test_suite_test_case_request.py +0 -5
- vellum/client/types/search_filters_request.py +0 -7
- vellum/client/types/search_request_options_request.py +0 -7
- vellum/client/types/slim_deployment_read.py +0 -5
- vellum/client/types/slim_workflow_deployment.py +0 -5
- vellum/client/types/slim_workflow_execution_read.py +0 -12
- vellum/client/types/span_link.py +0 -6
- vellum/client/types/streaming_workflow_node_result_event.py +0 -5
- vellum/client/types/templating_node_array_result.py +0 -5
- vellum/client/types/templating_node_result.py +0 -5
- vellum/client/types/templating_node_result_data.py +0 -5
- vellum/client/types/terminal_node_array_result.py +0 -5
- vellum/client/types/terminal_node_result.py +0 -5
- vellum/client/types/terminal_node_result_data.py +0 -5
- vellum/client/types/test_case_array_variable_value.py +0 -5
- vellum/client/types/test_suite_run_execution.py +0 -5
- vellum/client/types/test_suite_run_execution_array_output.py +0 -5
- vellum/client/types/test_suite_run_execution_metric_result.py +0 -5
- vellum/client/types/test_suite_run_external_exec_config.py +0 -5
- vellum/client/types/test_suite_run_external_exec_config_data.py +0 -5
- vellum/client/types/test_suite_run_external_exec_config_data_request.py +0 -7
- vellum/client/types/test_suite_run_external_exec_config_request.py +0 -7
- vellum/client/types/test_suite_run_metric_array_output.py +0 -5
- vellum/client/types/test_suite_run_read.py +0 -5
- vellum/client/types/test_suite_test_case.py +0 -5
- vellum/client/types/test_suite_test_case_create_bulk_operation_request.py +0 -7
- vellum/client/types/test_suite_test_case_replace_bulk_operation_request.py +0 -7
- vellum/client/types/test_suite_test_case_upsert_bulk_operation_request.py +0 -7
- vellum/client/types/upsert_test_suite_test_case_request.py +0 -5
- vellum/client/types/vellum_value_logical_condition_group_request.py +0 -3
- vellum/client/types/vellum_value_logical_condition_request.py +0 -5
- vellum/client/types/vellum_variable.py +0 -5
- vellum/client/types/workflow_deployment_event_executions_response.py +0 -26
- vellum/client/types/workflow_deployment_history_item.py +0 -5
- vellum/client/types/workflow_deployment_parent_context.py +0 -6
- vellum/client/types/workflow_deployment_read.py +0 -5
- vellum/client/types/workflow_deployment_release.py +0 -5
- vellum/client/types/workflow_deployment_release_workflow_version.py +0 -5
- vellum/client/types/workflow_event_execution_read.py +0 -12
- vellum/client/types/workflow_execution_actual.py +0 -5
- vellum/client/types/workflow_execution_fulfilled_event.py +0 -11
- vellum/client/types/workflow_execution_initiated_event.py +0 -11
- vellum/client/types/workflow_execution_node_result_event.py +0 -5
- vellum/client/types/workflow_execution_paused_event.py +0 -11
- vellum/client/types/workflow_execution_rejected_event.py +0 -11
- vellum/client/types/workflow_execution_resumed_event.py +0 -11
- vellum/client/types/workflow_execution_snapshotted_event.py +0 -13
- vellum/client/types/workflow_execution_span.py +0 -11
- vellum/client/types/workflow_execution_streaming_event.py +0 -11
- vellum/client/types/workflow_execution_view_online_eval_metric_result.py +0 -7
- vellum/client/types/workflow_execution_workflow_result_event.py +0 -5
- vellum/client/types/workflow_output_array.py +0 -5
- vellum/client/types/workflow_parent_context.py +0 -6
- vellum/client/types/workflow_result_event.py +0 -5
- vellum/client/types/workflow_result_event_output_data_array.py +0 -5
- vellum/client/types/workflow_sandbox_parent_context.py +0 -6
- vellum/workflows/nodes/bases/base.py +26 -6
- vellum/workflows/nodes/bases/tests/test_base_node.py +30 -0
- vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py +50 -0
- vellum/workflows/nodes/utils.py +5 -1
- vellum/workflows/types/code_execution_node_wrappers.py +5 -0
- {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/METADATA +1 -1
- {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/RECORD +152 -152
- vellum_cli/__init__.py +3 -2
- vellum_cli/image_push.py +15 -3
- vellum_cli/tests/test_image_push.py +109 -0
- vellum_ee/workflows/display/nodes/base_node_display.py +25 -9
- vellum_ee/workflows/display/nodes/get_node_display_class.py +4 -5
- vellum_ee/workflows/display/nodes/vellum/api_node.py +11 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +5 -0
- vellum_ee/workflows/display/nodes/vellum/error_node.py +22 -16
- vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +47 -13
- vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/map_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/search_node.py +8 -0
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +1 -0
- vellum_ee/workflows/display/nodes/vellum/templating_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_error_node.py +4 -0
- vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py +4 -3
- vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py +67 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py +5 -4
- vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py +1 -1
- vellum_ee/workflows/display/tests/test_base_workflow_display.py +44 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +2 -4
- vellum_ee/workflows/display/utils/expressions.py +31 -4
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +162 -0
- {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/LICENSE +0 -0
- {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/WHEEL +0 -0
- {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionInitiatedEvent(UniversalBaseModel):
|
@@ -38,12 +36,3 @@ class WorkflowExecutionInitiatedEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
47
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
48
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
49
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionInitiatedEvent=WorkflowExecutionInitiatedEvent)
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
import typing
|
7
6
|
from .workflow_node_result_event import WorkflowNodeResultEvent
|
8
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
8
|
import pydantic
|
10
|
-
from ..core.pydantic_utilities import update_forward_refs
|
11
9
|
|
12
10
|
|
13
11
|
class WorkflowExecutionNodeResultEvent(UniversalBaseModel):
|
@@ -29,6 +27,3 @@ class WorkflowExecutionNodeResultEvent(UniversalBaseModel):
|
|
29
27
|
frozen = True
|
30
28
|
smart_union = True
|
31
29
|
extra = pydantic.Extra.allow
|
32
|
-
|
33
|
-
|
34
|
-
update_forward_refs(ArrayVellumValue, WorkflowExecutionNodeResultEvent=WorkflowExecutionNodeResultEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionPausedEvent(UniversalBaseModel):
|
@@ -38,12 +36,3 @@ class WorkflowExecutionPausedEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
47
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
48
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
49
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionPausedEvent=WorkflowExecutionPausedEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionRejectedEvent(UniversalBaseModel):
|
@@ -38,12 +36,3 @@ class WorkflowExecutionRejectedEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
47
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
48
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
49
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionRejectedEvent=WorkflowExecutionRejectedEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionResumedEvent(UniversalBaseModel):
|
@@ -38,12 +36,3 @@ class WorkflowExecutionResumedEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
47
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
48
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
49
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionResumedEvent=WorkflowExecutionResumedEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionSnapshottedEvent(UniversalBaseModel):
|
@@ -38,14 +36,3 @@ class WorkflowExecutionSnapshottedEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
47
|
-
update_forward_refs(
|
48
|
-
WorkflowDeploymentParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent
|
49
|
-
)
|
50
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
51
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionSnapshottedEvent=WorkflowExecutionSnapshottedEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -15,7 +14,6 @@ from .workflow_execution_span_attributes import WorkflowExecutionSpanAttributes
|
|
15
14
|
import datetime as dt
|
16
15
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
17
16
|
import pydantic
|
18
|
-
from ..core.pydantic_utilities import update_forward_refs
|
19
17
|
|
20
18
|
|
21
19
|
class WorkflowExecutionSpan(UniversalBaseModel):
|
@@ -35,12 +33,3 @@ class WorkflowExecutionSpan(UniversalBaseModel):
|
|
35
33
|
frozen = True
|
36
34
|
smart_union = True
|
37
35
|
extra = pydantic.Extra.allow
|
38
|
-
|
39
|
-
|
40
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
41
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
42
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
43
|
-
update_forward_refs(SpanLink, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
44
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
45
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
46
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionSpan=WorkflowExecutionSpan)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .api_request_parent_context import ApiRequestParentContext
|
6
5
|
from .node_parent_context import NodeParentContext
|
@@ -16,7 +15,6 @@ import datetime as dt
|
|
16
15
|
from .api_version_enum import ApiVersionEnum
|
17
16
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
18
17
|
import pydantic
|
19
|
-
from ..core.pydantic_utilities import update_forward_refs
|
20
18
|
|
21
19
|
|
22
20
|
class WorkflowExecutionStreamingEvent(UniversalBaseModel):
|
@@ -38,12 +36,3 @@ class WorkflowExecutionStreamingEvent(UniversalBaseModel):
|
|
38
36
|
frozen = True
|
39
37
|
smart_union = True
|
40
38
|
extra = pydantic.Extra.allow
|
41
|
-
|
42
|
-
|
43
|
-
update_forward_refs(ApiRequestParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
44
|
-
update_forward_refs(NodeParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
45
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
46
|
-
update_forward_refs(SpanLink, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
47
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
48
|
-
update_forward_refs(WorkflowParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
49
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowExecutionStreamingEvent=WorkflowExecutionStreamingEvent)
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
import typing
|
7
6
|
from .execution_vellum_value import ExecutionVellumValue
|
8
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
8
|
import pydantic
|
10
|
-
from ..core.pydantic_utilities import update_forward_refs
|
11
9
|
|
12
10
|
|
13
11
|
class WorkflowExecutionViewOnlineEvalMetricResult(UniversalBaseModel):
|
@@ -23,8 +21,3 @@ class WorkflowExecutionViewOnlineEvalMetricResult(UniversalBaseModel):
|
|
23
21
|
frozen = True
|
24
22
|
smart_union = True
|
25
23
|
extra = pydantic.Extra.allow
|
26
|
-
|
27
|
-
|
28
|
-
update_forward_refs(
|
29
|
-
ArrayVellumValue, WorkflowExecutionViewOnlineEvalMetricResult=WorkflowExecutionViewOnlineEvalMetricResult
|
30
|
-
)
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
import typing
|
7
6
|
from .workflow_result_event import WorkflowResultEvent
|
8
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
8
|
import pydantic
|
10
|
-
from ..core.pydantic_utilities import update_forward_refs
|
11
9
|
|
12
10
|
|
13
11
|
class WorkflowExecutionWorkflowResultEvent(UniversalBaseModel):
|
@@ -29,6 +27,3 @@ class WorkflowExecutionWorkflowResultEvent(UniversalBaseModel):
|
|
29
27
|
frozen = True
|
30
28
|
smart_union = True
|
31
29
|
extra = pydantic.Extra.allow
|
32
|
-
|
33
|
-
|
34
|
-
update_forward_refs(ArrayVellumValue, WorkflowExecutionWorkflowResultEvent=WorkflowExecutionWorkflowResultEvent)
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
import pydantic
|
7
6
|
import typing
|
8
7
|
from .vellum_value import VellumValue
|
9
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
10
|
-
from ..core.pydantic_utilities import update_forward_refs
|
11
9
|
|
12
10
|
|
13
11
|
class WorkflowOutputArray(UniversalBaseModel):
|
@@ -32,6 +30,3 @@ class WorkflowOutputArray(UniversalBaseModel):
|
|
32
30
|
frozen = True
|
33
31
|
smart_union = True
|
34
32
|
extra = pydantic.Extra.allow
|
35
|
-
|
36
|
-
|
37
|
-
update_forward_refs(ArrayVellumValue, WorkflowOutputArray=WorkflowOutputArray)
|
@@ -34,10 +34,4 @@ from .workflow_deployment_parent_context import WorkflowDeploymentParentContext
|
|
34
34
|
from .workflow_sandbox_parent_context import WorkflowSandboxParentContext # noqa: E402
|
35
35
|
from .parent_context import ParentContext # noqa: E402
|
36
36
|
|
37
|
-
update_forward_refs(ApiRequestParentContext, WorkflowParentContext=WorkflowParentContext)
|
38
|
-
update_forward_refs(NodeParentContext, WorkflowParentContext=WorkflowParentContext)
|
39
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowParentContext=WorkflowParentContext)
|
40
|
-
update_forward_refs(SpanLink, WorkflowParentContext=WorkflowParentContext)
|
41
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowParentContext=WorkflowParentContext)
|
42
|
-
update_forward_refs(WorkflowSandboxParentContext, WorkflowParentContext=WorkflowParentContext)
|
43
37
|
update_forward_refs(WorkflowParentContext)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
from .workflow_node_result_event_state import WorkflowNodeResultEventState
|
@@ -12,7 +11,6 @@ from .workflow_output import WorkflowOutput
|
|
12
11
|
from .execution_vellum_value import ExecutionVellumValue
|
13
12
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
14
13
|
import pydantic
|
15
|
-
from ..core.pydantic_utilities import update_forward_refs
|
16
14
|
|
17
15
|
|
18
16
|
class WorkflowResultEvent(UniversalBaseModel):
|
@@ -32,6 +30,3 @@ class WorkflowResultEvent(UniversalBaseModel):
|
|
32
30
|
frozen = True
|
33
31
|
smart_union = True
|
34
32
|
extra = pydantic.Extra.allow
|
35
|
-
|
36
|
-
|
37
|
-
update_forward_refs(ArrayVellumValue, WorkflowResultEvent=WorkflowResultEvent)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from __future__ import annotations
|
4
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
4
|
from .array_vellum_value import ArrayVellumValue
|
6
5
|
import typing
|
@@ -8,7 +7,6 @@ from .workflow_node_result_event_state import WorkflowNodeResultEventState
|
|
8
7
|
import pydantic
|
9
8
|
from .vellum_value import VellumValue
|
10
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
11
|
-
from ..core.pydantic_utilities import update_forward_refs
|
12
10
|
|
13
11
|
|
14
12
|
class WorkflowResultEventOutputDataArray(UniversalBaseModel):
|
@@ -36,6 +34,3 @@ class WorkflowResultEventOutputDataArray(UniversalBaseModel):
|
|
36
34
|
frozen = True
|
37
35
|
smart_union = True
|
38
36
|
extra = pydantic.Extra.allow
|
39
|
-
|
40
|
-
|
41
|
-
update_forward_refs(ArrayVellumValue, WorkflowResultEventOutputDataArray=WorkflowResultEventOutputDataArray)
|
@@ -35,10 +35,4 @@ from .workflow_deployment_parent_context import WorkflowDeploymentParentContext
|
|
35
35
|
from .workflow_parent_context import WorkflowParentContext # noqa: E402
|
36
36
|
from .parent_context import ParentContext # noqa: E402
|
37
37
|
|
38
|
-
update_forward_refs(ApiRequestParentContext, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
39
|
-
update_forward_refs(NodeParentContext, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
40
|
-
update_forward_refs(PromptDeploymentParentContext, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
41
|
-
update_forward_refs(SpanLink, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
42
|
-
update_forward_refs(WorkflowDeploymentParentContext, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
43
|
-
update_forward_refs(WorkflowParentContext, WorkflowSandboxParentContext=WorkflowSandboxParentContext)
|
44
38
|
update_forward_refs(WorkflowSandboxParentContext)
|
@@ -28,7 +28,7 @@ from vellum.workflows.types.utils import get_class_attr_names, get_original_base
|
|
28
28
|
from vellum.workflows.utils.uuids import uuid4_from_hash
|
29
29
|
|
30
30
|
|
31
|
-
def
|
31
|
+
def _is_nested_class(nested: Any, parent: Type) -> bool:
|
32
32
|
return (
|
33
33
|
inspect.isclass(nested)
|
34
34
|
# If a class is defined within a function, we don't consider it nested in the class defining that function
|
@@ -36,7 +36,18 @@ def is_nested_class(nested: Any, parent: Type) -> bool:
|
|
36
36
|
and (len(nested.__qualname__.split(".")) < 2 or nested.__qualname__.split(".")[-2] != "<locals>")
|
37
37
|
and nested.__module__ == parent.__module__
|
38
38
|
and (nested.__qualname__.startswith(parent.__name__) or nested.__qualname__.startswith(parent.__qualname__))
|
39
|
-
) or any(
|
39
|
+
) or any(_is_nested_class(nested, base) for base in parent.__bases__)
|
40
|
+
|
41
|
+
|
42
|
+
def _is_annotated(cls: Type, name: str) -> bool:
|
43
|
+
if name in cls.__annotations__:
|
44
|
+
return True
|
45
|
+
|
46
|
+
for base in cls.__bases__:
|
47
|
+
if _is_annotated(base, name):
|
48
|
+
return True
|
49
|
+
|
50
|
+
return False
|
40
51
|
|
41
52
|
|
42
53
|
class BaseNodeMeta(type):
|
@@ -131,12 +142,21 @@ class BaseNodeMeta(type):
|
|
131
142
|
return {"BaseWorkflow": BaseWorkflow}
|
132
143
|
|
133
144
|
def __getattribute__(cls, name: str) -> Any:
|
134
|
-
|
145
|
+
if name.startswith("_"):
|
146
|
+
return super().__getattribute__(name)
|
147
|
+
|
148
|
+
try:
|
149
|
+
attribute = super().__getattribute__(name)
|
150
|
+
except AttributeError as e:
|
151
|
+
if _is_annotated(cls, name):
|
152
|
+
attribute = None
|
153
|
+
else:
|
154
|
+
raise e
|
155
|
+
|
135
156
|
if (
|
136
|
-
|
137
|
-
or inspect.isfunction(attribute)
|
157
|
+
inspect.isfunction(attribute)
|
138
158
|
or inspect.ismethod(attribute)
|
139
|
-
or
|
159
|
+
or _is_nested_class(attribute, cls)
|
140
160
|
or isinstance(attribute, (property, cached_property))
|
141
161
|
or not issubclass(cls, BaseNode)
|
142
162
|
):
|
@@ -10,6 +10,7 @@ from vellum.workflows.inputs.base import BaseInputs
|
|
10
10
|
from vellum.workflows.nodes import FinalOutputNode
|
11
11
|
from vellum.workflows.nodes.bases.base import BaseNode
|
12
12
|
from vellum.workflows.outputs.base import BaseOutputs
|
13
|
+
from vellum.workflows.references.node import NodeReference
|
13
14
|
from vellum.workflows.references.output import OutputReference
|
14
15
|
from vellum.workflows.state.base import BaseState, StateMeta
|
15
16
|
|
@@ -303,3 +304,32 @@ def test_base_node__iterate_over_attributes__preserves_order():
|
|
303
304
|
|
304
305
|
# THEN the attributes are in the correct order
|
305
306
|
assert attribute_names == ["baz", "qux", "quux", "foo", "bar"], f"Iteration {i} failed"
|
307
|
+
|
308
|
+
|
309
|
+
def test_base_node__node_reference_of_annotation():
|
310
|
+
# GIVEN a node with an annotated attribute
|
311
|
+
class MyNode(BaseNode):
|
312
|
+
foo: str
|
313
|
+
|
314
|
+
# WHEN we reference the attribute
|
315
|
+
node_reference = MyNode.foo
|
316
|
+
|
317
|
+
# THEN the node reference is of the correct type
|
318
|
+
assert isinstance(node_reference, NodeReference)
|
319
|
+
assert node_reference.name == "foo"
|
320
|
+
|
321
|
+
|
322
|
+
def test_base_node__node_reference_of_inherited_annotation():
|
323
|
+
# GIVEN a node with an annotated attribute
|
324
|
+
class MyNode(BaseNode):
|
325
|
+
foo: str
|
326
|
+
|
327
|
+
class InheritedNode(MyNode):
|
328
|
+
bar: str
|
329
|
+
|
330
|
+
# WHEN we reference the attribute
|
331
|
+
node_reference = InheritedNode.foo
|
332
|
+
|
333
|
+
# THEN the node reference is of the correct type
|
334
|
+
assert isinstance(node_reference, NodeReference)
|
335
|
+
assert node_reference.name == "foo"
|
@@ -409,6 +409,56 @@ def main(word: str) -> int:
|
|
409
409
|
assert exc_info.value.message == "Expected an output of type 'int', but received 'str'"
|
410
410
|
|
411
411
|
|
412
|
+
def test_run_node__run_inline__incorrect_output_type_list():
|
413
|
+
"""Confirm that CodeExecutionNodes raise an error if the output type is incorrect during inline execution."""
|
414
|
+
|
415
|
+
# GIVEN a node that subclasses CodeExecutionNode that returns a list but is defined to return an int
|
416
|
+
class ExampleCodeExecutionNode(CodeExecutionNode[BaseState, int]):
|
417
|
+
code = """\
|
418
|
+
def main(output: list[str]) -> int:
|
419
|
+
return output.value
|
420
|
+
"""
|
421
|
+
runtime = "PYTHON_3_11_6"
|
422
|
+
|
423
|
+
code_inputs = {
|
424
|
+
"output": ["hello", "world"],
|
425
|
+
}
|
426
|
+
|
427
|
+
# WHEN we run the node
|
428
|
+
node = ExampleCodeExecutionNode()
|
429
|
+
with pytest.raises(NodeException) as exc_info:
|
430
|
+
node.run()
|
431
|
+
|
432
|
+
# THEN the node should have produced the exception we expected
|
433
|
+
assert exc_info.value.message == "Expected an output of type 'int', but received 'list'"
|
434
|
+
|
435
|
+
|
436
|
+
def test_run_node__run_inline__incorrect_output_type_dict():
|
437
|
+
"""Confirm that CodeExecutionNodes raise an error if the output type is incorrect during inline execution."""
|
438
|
+
|
439
|
+
# GIVEN a node that subclasses CodeExecutionNode that returns a dict but is defined to return an int
|
440
|
+
class ExampleCodeExecutionNode(CodeExecutionNode[BaseState, int]):
|
441
|
+
code = """\
|
442
|
+
def main(output: dict[str, str]) -> int:
|
443
|
+
return output.value
|
444
|
+
"""
|
445
|
+
runtime = "PYTHON_3_11_6"
|
446
|
+
|
447
|
+
code_inputs = {
|
448
|
+
"output": {
|
449
|
+
"foo": "bar",
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
# WHEN we run the node
|
454
|
+
node = ExampleCodeExecutionNode()
|
455
|
+
with pytest.raises(NodeException) as exc_info:
|
456
|
+
node.run()
|
457
|
+
|
458
|
+
# THEN the node should have produced the exception we expected
|
459
|
+
assert exc_info.value.message == "Expected an output of type 'int', but received 'dict'"
|
460
|
+
|
461
|
+
|
412
462
|
def test_run_node__run_inline__valid_dict_to_pydantic():
|
413
463
|
"""Confirm that CodeExecutionNodes can convert a dict to a Pydantic model during inline execution."""
|
414
464
|
|
vellum/workflows/nodes/utils.py
CHANGED
@@ -15,7 +15,7 @@ from vellum.workflows.nodes import BaseNode
|
|
15
15
|
from vellum.workflows.nodes.bases.base_adornment_node import BaseAdornmentNode
|
16
16
|
from vellum.workflows.ports.port import Port
|
17
17
|
from vellum.workflows.state.base import BaseState
|
18
|
-
from vellum.workflows.types.code_execution_node_wrappers import StringValueWrapper
|
18
|
+
from vellum.workflows.types.code_execution_node_wrappers import DictWrapper, ListWrapper, StringValueWrapper
|
19
19
|
from vellum.workflows.types.core import Json
|
20
20
|
from vellum.workflows.types.generics import NodeType
|
21
21
|
|
@@ -180,6 +180,10 @@ def parse_type_from_str(result_as_str: str, output_type: Any) -> Any:
|
|
180
180
|
def _get_type_name(obj: Any) -> str:
|
181
181
|
if inspect.isclass(obj) and issubclass(obj, StringValueWrapper):
|
182
182
|
return "str"
|
183
|
+
if inspect.isclass(obj) and issubclass(obj, ListWrapper):
|
184
|
+
return "list"
|
185
|
+
if inspect.isclass(obj) and issubclass(obj, DictWrapper):
|
186
|
+
return "dict"
|
183
187
|
if isinstance(obj, type):
|
184
188
|
return obj.__name__
|
185
189
|
|