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.
Files changed (152) hide show
  1. vellum/client/README.md +2 -2
  2. vellum/client/__init__.py +72 -6
  3. vellum/client/core/client_wrapper.py +1 -1
  4. vellum/client/core/file.py +13 -8
  5. vellum/client/core/http_client.py +26 -14
  6. vellum/client/core/pydantic_utilities.py +2 -2
  7. vellum/client/core/request_options.py +3 -0
  8. vellum/client/resources/ad_hoc/client.py +14 -2
  9. vellum/client/resources/container_images/client.py +6 -0
  10. vellum/client/resources/deployments/client.py +12 -0
  11. vellum/client/resources/document_indexes/client.py +18 -0
  12. vellum/client/resources/documents/client.py +6 -0
  13. vellum/client/resources/folder_entities/client.py +6 -0
  14. vellum/client/resources/metric_definitions/client.py +6 -0
  15. vellum/client/resources/prompts/client.py +6 -0
  16. vellum/client/resources/sandboxes/client.py +12 -0
  17. vellum/client/resources/test_suite_runs/client.py +6 -0
  18. vellum/client/resources/test_suites/client.py +2 -2
  19. vellum/client/resources/workflow_deployments/client.py +6 -0
  20. vellum/client/resources/workflow_sandboxes/client.py +6 -0
  21. vellum/client/resources/workflows/client.py +6 -4
  22. vellum/client/resources/workspace_secrets/client.py +6 -0
  23. vellum/client/types/api_request_parent_context.py +0 -6
  24. vellum/client/types/array_input.py +0 -5
  25. vellum/client/types/code_execution_node_array_result.py +0 -5
  26. vellum/client/types/code_execution_node_result.py +0 -5
  27. vellum/client/types/code_execution_node_result_data.py +0 -5
  28. vellum/client/types/code_executor_response.py +0 -5
  29. vellum/client/types/create_test_suite_test_case_request.py +0 -5
  30. vellum/client/types/deployment_history_item.py +0 -5
  31. vellum/client/types/deployment_read.py +0 -5
  32. vellum/client/types/execute_workflow_response.py +0 -5
  33. vellum/client/types/execution_array_vellum_value.py +0 -5
  34. vellum/client/types/external_test_case_execution.py +0 -5
  35. vellum/client/types/external_test_case_execution_request.py +0 -5
  36. vellum/client/types/fulfilled_execute_workflow_workflow_result_event.py +0 -7
  37. vellum/client/types/fulfilled_workflow_node_result_event.py +0 -5
  38. vellum/client/types/initiated_workflow_node_result_event.py +0 -5
  39. vellum/client/types/metadata_filter_config_request.py +0 -5
  40. vellum/client/types/metric_definition_execution.py +0 -5
  41. vellum/client/types/metric_definition_history_item.py +0 -5
  42. vellum/client/types/named_test_case_array_variable_value.py +0 -5
  43. vellum/client/types/named_test_case_array_variable_value_request.py +0 -7
  44. vellum/client/types/node_execution_fulfilled_event.py +0 -11
  45. vellum/client/types/node_execution_initiated_event.py +0 -11
  46. vellum/client/types/node_execution_paused_event.py +0 -11
  47. vellum/client/types/node_execution_rejected_event.py +0 -11
  48. vellum/client/types/node_execution_resumed_event.py +0 -11
  49. vellum/client/types/node_execution_span.py +0 -11
  50. vellum/client/types/node_execution_streaming_event.py +0 -11
  51. vellum/client/types/node_input_compiled_array_value.py +0 -5
  52. vellum/client/types/node_output_compiled_array_value.py +0 -5
  53. vellum/client/types/node_parent_context.py +0 -6
  54. vellum/client/types/paginated_slim_deployment_read_list.py +0 -5
  55. vellum/client/types/paginated_slim_workflow_deployment_list.py +0 -5
  56. vellum/client/types/paginated_test_suite_run_execution_list.py +0 -5
  57. vellum/client/types/paginated_test_suite_test_case_list.py +0 -5
  58. vellum/client/types/prompt_deployment_parent_context.py +0 -6
  59. vellum/client/types/prompt_exec_config.py +0 -6
  60. vellum/client/types/rejected_workflow_node_result_event.py +0 -5
  61. vellum/client/types/replace_test_suite_test_case_request.py +0 -5
  62. vellum/client/types/search_filters_request.py +0 -7
  63. vellum/client/types/search_request_options_request.py +0 -7
  64. vellum/client/types/slim_deployment_read.py +0 -5
  65. vellum/client/types/slim_workflow_deployment.py +0 -5
  66. vellum/client/types/slim_workflow_execution_read.py +0 -12
  67. vellum/client/types/span_link.py +0 -6
  68. vellum/client/types/streaming_workflow_node_result_event.py +0 -5
  69. vellum/client/types/templating_node_array_result.py +0 -5
  70. vellum/client/types/templating_node_result.py +0 -5
  71. vellum/client/types/templating_node_result_data.py +0 -5
  72. vellum/client/types/terminal_node_array_result.py +0 -5
  73. vellum/client/types/terminal_node_result.py +0 -5
  74. vellum/client/types/terminal_node_result_data.py +0 -5
  75. vellum/client/types/test_case_array_variable_value.py +0 -5
  76. vellum/client/types/test_suite_run_execution.py +0 -5
  77. vellum/client/types/test_suite_run_execution_array_output.py +0 -5
  78. vellum/client/types/test_suite_run_execution_metric_result.py +0 -5
  79. vellum/client/types/test_suite_run_external_exec_config.py +0 -5
  80. vellum/client/types/test_suite_run_external_exec_config_data.py +0 -5
  81. vellum/client/types/test_suite_run_external_exec_config_data_request.py +0 -7
  82. vellum/client/types/test_suite_run_external_exec_config_request.py +0 -7
  83. vellum/client/types/test_suite_run_metric_array_output.py +0 -5
  84. vellum/client/types/test_suite_run_read.py +0 -5
  85. vellum/client/types/test_suite_test_case.py +0 -5
  86. vellum/client/types/test_suite_test_case_create_bulk_operation_request.py +0 -7
  87. vellum/client/types/test_suite_test_case_replace_bulk_operation_request.py +0 -7
  88. vellum/client/types/test_suite_test_case_upsert_bulk_operation_request.py +0 -7
  89. vellum/client/types/upsert_test_suite_test_case_request.py +0 -5
  90. vellum/client/types/vellum_value_logical_condition_group_request.py +0 -3
  91. vellum/client/types/vellum_value_logical_condition_request.py +0 -5
  92. vellum/client/types/vellum_variable.py +0 -5
  93. vellum/client/types/workflow_deployment_event_executions_response.py +0 -26
  94. vellum/client/types/workflow_deployment_history_item.py +0 -5
  95. vellum/client/types/workflow_deployment_parent_context.py +0 -6
  96. vellum/client/types/workflow_deployment_read.py +0 -5
  97. vellum/client/types/workflow_deployment_release.py +0 -5
  98. vellum/client/types/workflow_deployment_release_workflow_version.py +0 -5
  99. vellum/client/types/workflow_event_execution_read.py +0 -12
  100. vellum/client/types/workflow_execution_actual.py +0 -5
  101. vellum/client/types/workflow_execution_fulfilled_event.py +0 -11
  102. vellum/client/types/workflow_execution_initiated_event.py +0 -11
  103. vellum/client/types/workflow_execution_node_result_event.py +0 -5
  104. vellum/client/types/workflow_execution_paused_event.py +0 -11
  105. vellum/client/types/workflow_execution_rejected_event.py +0 -11
  106. vellum/client/types/workflow_execution_resumed_event.py +0 -11
  107. vellum/client/types/workflow_execution_snapshotted_event.py +0 -13
  108. vellum/client/types/workflow_execution_span.py +0 -11
  109. vellum/client/types/workflow_execution_streaming_event.py +0 -11
  110. vellum/client/types/workflow_execution_view_online_eval_metric_result.py +0 -7
  111. vellum/client/types/workflow_execution_workflow_result_event.py +0 -5
  112. vellum/client/types/workflow_output_array.py +0 -5
  113. vellum/client/types/workflow_parent_context.py +0 -6
  114. vellum/client/types/workflow_result_event.py +0 -5
  115. vellum/client/types/workflow_result_event_output_data_array.py +0 -5
  116. vellum/client/types/workflow_sandbox_parent_context.py +0 -6
  117. vellum/workflows/nodes/bases/base.py +26 -6
  118. vellum/workflows/nodes/bases/tests/test_base_node.py +30 -0
  119. vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py +50 -0
  120. vellum/workflows/nodes/utils.py +5 -1
  121. vellum/workflows/types/code_execution_node_wrappers.py +5 -0
  122. {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/METADATA +1 -1
  123. {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/RECORD +152 -152
  124. vellum_cli/__init__.py +3 -2
  125. vellum_cli/image_push.py +15 -3
  126. vellum_cli/tests/test_image_push.py +109 -0
  127. vellum_ee/workflows/display/nodes/base_node_display.py +25 -9
  128. vellum_ee/workflows/display/nodes/get_node_display_class.py +4 -5
  129. vellum_ee/workflows/display/nodes/vellum/api_node.py +11 -0
  130. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +5 -0
  131. vellum_ee/workflows/display/nodes/vellum/error_node.py +22 -16
  132. vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +2 -0
  133. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +47 -13
  134. vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +2 -0
  135. vellum_ee/workflows/display/nodes/vellum/map_node.py +2 -0
  136. vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +2 -0
  137. vellum_ee/workflows/display/nodes/vellum/search_node.py +8 -0
  138. vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +1 -0
  139. vellum_ee/workflows/display/nodes/vellum/templating_node.py +2 -0
  140. vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +1 -1
  141. vellum_ee/workflows/display/nodes/vellum/tests/test_error_node.py +4 -0
  142. vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py +4 -3
  143. vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py +67 -2
  144. vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py +5 -4
  145. vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py +1 -1
  146. vellum_ee/workflows/display/tests/test_base_workflow_display.py +44 -0
  147. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +2 -4
  148. vellum_ee/workflows/display/utils/expressions.py +31 -4
  149. vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +162 -0
  150. {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/LICENSE +0 -0
  151. {vellum_ai-0.14.46.dist-info → vellum_ai-0.14.48.dist-info}/WHEEL +0 -0
  152. {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 is_nested_class(nested: Any, parent: Type) -> bool:
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(is_nested_class(nested, base) for base in parent.__bases__)
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
- attribute = super().__getattribute__(name)
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
- name.startswith("_")
137
- or inspect.isfunction(attribute)
157
+ inspect.isfunction(attribute)
138
158
  or inspect.ismethod(attribute)
139
- or is_nested_class(attribute, cls)
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
 
@@ -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
 
@@ -18,6 +18,11 @@ class ListWrapper(list):
18
18
 
19
19
  return super().__getitem__(key)
20
20
 
21
+ def __getattr__(self, attr):
22
+ if attr == "value":
23
+ return self
24
+ raise AttributeError(f"'list' object has no attribute '{attr}'")
25
+
21
26
 
22
27
  class DictWrapper(dict):
23
28
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 0.14.46
3
+ Version: 0.14.48
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.9,<4.0