vellum-ai 0.14.45__py3-none-any.whl → 0.14.47__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 (162) 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/core/try_node/node.py +3 -6
  120. vellum/workflows/nodes/core/try_node/tests/test_node.py +0 -24
  121. vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +8 -14
  122. vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py +112 -0
  123. vellum/workflows/nodes/displayable/code_execution_node/utils.py +3 -54
  124. vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +5 -6
  125. vellum/workflows/nodes/utils.py +8 -0
  126. vellum/workflows/types/code_execution_node_wrappers.py +69 -0
  127. vellum/workflows/vellum_client.py +19 -7
  128. {vellum_ai-0.14.45.dist-info → vellum_ai-0.14.47.dist-info}/METADATA +1 -1
  129. {vellum_ai-0.14.45.dist-info → vellum_ai-0.14.47.dist-info}/RECORD +162 -161
  130. vellum_cli/config.py +7 -2
  131. vellum_cli/push.py +5 -1
  132. vellum_cli/tests/test_push.py +192 -8
  133. vellum_ee/workflows/display/nodes/base_node_display.py +17 -6
  134. vellum_ee/workflows/display/nodes/get_node_display_class.py +4 -5
  135. vellum_ee/workflows/display/nodes/vellum/api_node.py +11 -0
  136. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +5 -0
  137. vellum_ee/workflows/display/nodes/vellum/error_node.py +22 -16
  138. vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +2 -0
  139. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +46 -12
  140. vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +2 -0
  141. vellum_ee/workflows/display/nodes/vellum/map_node.py +2 -0
  142. vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +3 -5
  143. vellum_ee/workflows/display/nodes/vellum/search_node.py +8 -0
  144. vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +2 -5
  145. vellum_ee/workflows/display/nodes/vellum/templating_node.py +2 -0
  146. vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +1 -1
  147. vellum_ee/workflows/display/nodes/vellum/tests/test_error_node.py +4 -0
  148. vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_deployment_node.py +4 -3
  149. vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py +36 -2
  150. vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py +5 -4
  151. vellum_ee/workflows/display/nodes/vellum/tests/test_templating_node.py +1 -1
  152. vellum_ee/workflows/display/tests/test_base_workflow_display.py +44 -0
  153. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +2 -4
  154. vellum_ee/workflows/display/types.py +3 -0
  155. vellum_ee/workflows/display/utils/expressions.py +3 -3
  156. vellum_ee/workflows/display/utils/vellum.py +1 -3
  157. vellum_ee/workflows/display/workflows/base_workflow_display.py +10 -0
  158. vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +3 -0
  159. vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +53 -0
  160. {vellum_ai-0.14.45.dist-info → vellum_ai-0.14.47.dist-info}/LICENSE +0 -0
  161. {vellum_ai-0.14.45.dist-info → vellum_ai-0.14.47.dist-info}/WHEEL +0 -0
  162. {vellum_ai-0.14.45.dist-info → vellum_ai-0.14.47.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"
@@ -1,4 +1,4 @@
1
- from typing import Callable, Generic, Iterator, Optional, Set, Type, Union
1
+ from typing import Callable, Generic, Iterator, Optional, Set, Type
2
2
 
3
3
  from vellum.workflows.context import execution_context, get_parent_context
4
4
  from vellum.workflows.errors.types import WorkflowError, WorkflowErrorCode
@@ -21,8 +21,7 @@ class TryNode(BaseAdornmentNode[StateType], Generic[StateType]):
21
21
  subworkflow: Type["BaseWorkflow"] - The Subworkflow to execute
22
22
  """
23
23
 
24
- # TODO: We could remove str after we support generating enum values.
25
- on_error_code: Optional[Union[WorkflowErrorCode, str]] = None
24
+ on_error_code: Optional[WorkflowErrorCode] = None
26
25
 
27
26
  class Outputs(BaseAdornmentNode.Outputs):
28
27
  error: Optional[WorkflowError] = None
@@ -66,9 +65,7 @@ class TryNode(BaseAdornmentNode[StateType], Generic[StateType]):
66
65
  message="Subworkflow unexpectedly paused within Try Node",
67
66
  )
68
67
  elif event.name == "workflow.execution.rejected":
69
- # TODO: We should remove this once we support generating enum values.
70
- event_error_code = event.error.code.value if isinstance(self.on_error_code, str) else event.error.code
71
- if self.on_error_code and self.on_error_code != event_error_code:
68
+ if self.on_error_code and self.on_error_code != event.error.code:
72
69
  exception = NodeException(
73
70
  code=WorkflowErrorCode.INVALID_OUTPUTS,
74
71
  message=f"""Unexpected rejection: {event.error.code.value}.
@@ -57,30 +57,6 @@ def test_try_node__retry_on_error_code__missed():
57
57
  assert exc_info.value.code == WorkflowErrorCode.INVALID_OUTPUTS
58
58
 
59
59
 
60
- def test_try_node__on_error_code__str():
61
- # GIVEN a try node that is configured to catch PROVIDER_ERROR
62
- @TryNode.wrap(on_error_code="PROVIDER_ERROR") # type: ignore
63
- class TestNode(BaseNode):
64
- class Outputs(BaseOutputs):
65
- value: int
66
-
67
- def run(self) -> Outputs:
68
- raise NodeException(message="This will be caught", code=WorkflowErrorCode.PROVIDER_ERROR)
69
-
70
- # WHEN the node is run and throws a PROVIDER_ERROR
71
- node = TestNode(state=BaseState())
72
- outputs = [o for o in node.run()]
73
-
74
- # THEN the exception is caught
75
- assert len(outputs) == 2
76
- assert set(outputs) == {
77
- BaseOutput(name="value"),
78
- BaseOutput(
79
- name="error", value=WorkflowError(message="This will be caught", code=WorkflowErrorCode.PROVIDER_ERROR)
80
- ),
81
- }
82
-
83
-
84
60
  def test_try_node__use_parent_inputs_and_state():
85
61
  # GIVEN a parent workflow Inputs and State
86
62
  class Inputs(BaseInputs):
@@ -15,7 +15,7 @@ from vellum import (
15
15
  )
16
16
  from vellum.client import ApiError, RequestOptions
17
17
  from vellum.client.types.chat_message_request import ChatMessageRequest
18
- from vellum.workflows.constants import LATEST_RELEASE_TAG, OMIT
18
+ from vellum.workflows.constants import LATEST_RELEASE_TAG
19
19
  from vellum.workflows.context import get_execution_context
20
20
  from vellum.workflows.errors import WorkflowErrorCode
21
21
  from vellum.workflows.errors.types import vellum_error_to_workflow_error
@@ -48,13 +48,13 @@ class BasePromptDeploymentNode(BasePromptNode, Generic[StateType]):
48
48
  deployment: ClassVar[Union[UUID, str]]
49
49
 
50
50
  release_tag: str = LATEST_RELEASE_TAG
51
- external_id: Optional[str] = OMIT
51
+ external_id: Optional[str] = None
52
52
 
53
- expand_meta: Optional[PromptDeploymentExpandMetaRequest] = OMIT
54
- raw_overrides: Optional[RawPromptExecutionOverridesRequest] = OMIT
55
- expand_raw: Optional[Sequence[str]] = OMIT
56
- metadata: Optional[Dict[str, Optional[Any]]] = OMIT
57
- ml_model_fallbacks: Optional[Sequence[str]] = OMIT
53
+ expand_meta: Optional[PromptDeploymentExpandMetaRequest] = None
54
+ raw_overrides: Optional[RawPromptExecutionOverridesRequest] = None
55
+ expand_raw: Optional[Sequence[str]] = None
56
+ metadata: Optional[Dict[str, Optional[Any]]] = None
57
+ ml_model_fallbacks: Optional[Sequence[str]] = None
58
58
 
59
59
  class Trigger(BasePromptNode.Trigger):
60
60
  merge_behavior = MergeBehavior.AWAIT_ANY
@@ -103,12 +103,7 @@ class BasePromptDeploymentNode(BasePromptNode, Generic[StateType]):
103
103
  prompt_event_stream = self._get_prompt_event_stream()
104
104
  next(prompt_event_stream)
105
105
  except ApiError as e:
106
- if (
107
- e.status_code
108
- and e.status_code < 500
109
- and self.ml_model_fallbacks is not OMIT
110
- and self.ml_model_fallbacks is not None
111
- ):
106
+ if e.status_code and e.status_code < 500 and self.ml_model_fallbacks is not None:
112
107
  prompt_event_stream = self._retry_prompt_stream_with_fallbacks(tried_fallbacks)
113
108
  else:
114
109
  self._handle_api_error(e)
@@ -127,7 +122,6 @@ class BasePromptDeploymentNode(BasePromptNode, Generic[StateType]):
127
122
  if (
128
123
  event.error
129
124
  and event.error.code == WorkflowErrorCode.PROVIDER_ERROR.value
130
- and self.ml_model_fallbacks is not OMIT
131
125
  and self.ml_model_fallbacks is not None
132
126
  ):
133
127
  try: