vellum-ai 0.14.40__py3-none-any.whl → 0.14.42__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 (69) hide show
  1. vellum/__init__.py +2 -4
  2. vellum/client/core/client_wrapper.py +1 -1
  3. vellum/client/reference.md +141 -4
  4. vellum/client/resources/ad_hoc/client.py +311 -1
  5. vellum/client/resources/deployments/client.py +2 -2
  6. vellum/client/resources/documents/client.py +0 -6
  7. vellum/client/types/__init__.py +2 -4
  8. vellum/client/types/execute_api_response.py +3 -4
  9. vellum/client/types/execute_api_response_json.py +7 -0
  10. vellum/client/types/prompt_settings.py +1 -0
  11. vellum/client/types/workflow_event_execution_read.py +0 -4
  12. vellum/client/types/workflow_execution_initiated_body.py +0 -9
  13. vellum/client/types/workflow_execution_initiated_event.py +0 -4
  14. vellum/client/types/workflow_execution_span.py +0 -4
  15. vellum/types/{node_event_display_context.py → execute_api_response_json.py} +1 -1
  16. vellum/workflows/inputs/base.py +26 -3
  17. vellum/workflows/inputs/tests/test_inputs.py +15 -0
  18. vellum/workflows/nodes/bases/base_adornment_node.py +9 -0
  19. vellum/workflows/nodes/core/map_node/node.py +3 -2
  20. vellum/workflows/nodes/core/map_node/tests/test_node.py +56 -0
  21. vellum/workflows/nodes/core/retry_node/node.py +2 -1
  22. vellum/workflows/nodes/experimental/tool_calling_node/node.py +6 -28
  23. vellum/workflows/nodes/experimental/tool_calling_node/utils.py +6 -10
  24. vellum/workflows/nodes/utils.py +14 -1
  25. vellum/workflows/references/workflow_input.py +5 -1
  26. vellum/workflows/runner/runner.py +2 -0
  27. vellum/workflows/workflows/base.py +5 -0
  28. {vellum_ai-0.14.40.dist-info → vellum_ai-0.14.42.dist-info}/METADATA +1 -1
  29. {vellum_ai-0.14.40.dist-info → vellum_ai-0.14.42.dist-info}/RECORD +65 -68
  30. vellum_ee/workflows/display/nodes/base_node_display.py +67 -28
  31. vellum_ee/workflows/display/nodes/tests/test_base_node_display.py +18 -0
  32. vellum_ee/workflows/display/nodes/vellum/api_node.py +3 -2
  33. vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py +1 -2
  34. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +3 -2
  35. vellum_ee/workflows/display/nodes/vellum/conditional_node.py +3 -2
  36. vellum_ee/workflows/display/nodes/vellum/error_node.py +2 -2
  37. vellum_ee/workflows/display/nodes/vellum/final_output_node.py +8 -8
  38. vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +3 -2
  39. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +3 -2
  40. vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +3 -2
  41. vellum_ee/workflows/display/nodes/vellum/map_node.py +15 -12
  42. vellum_ee/workflows/display/nodes/vellum/merge_node.py +3 -2
  43. vellum_ee/workflows/display/nodes/vellum/note_node.py +2 -2
  44. vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +3 -4
  45. vellum_ee/workflows/display/nodes/vellum/search_node.py +3 -2
  46. vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +3 -2
  47. vellum_ee/workflows/display/nodes/vellum/templating_node.py +3 -2
  48. vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +2 -2
  49. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py +1 -0
  50. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +3 -0
  51. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +138 -0
  52. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +1 -0
  53. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +1 -0
  54. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +3 -2
  55. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py +1 -0
  56. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +1 -0
  57. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_serialization.py +1 -0
  58. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +1 -0
  59. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py +1 -0
  60. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +2 -2
  61. vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +2 -2
  62. vellum_ee/workflows/display/workflows/base_workflow_display.py +4 -12
  63. vellum/client/types/node_event_display_context.py +0 -30
  64. vellum/client/types/workflow_event_display_context.py +0 -28
  65. vellum/types/workflow_event_display_context.py +0 -3
  66. vellum_ee/workflows/display/nodes/base_node_vellum_display.py +0 -40
  67. {vellum_ai-0.14.40.dist-info → vellum_ai-0.14.42.dist-info}/LICENSE +0 -0
  68. {vellum_ai-0.14.40.dist-info → vellum_ai-0.14.42.dist-info}/WHEEL +0 -0
  69. {vellum_ai-0.14.40.dist-info → vellum_ai-0.14.42.dist-info}/entry_points.txt +0 -0
@@ -154,6 +154,7 @@ def test_serialize_workflow(vellum_client):
154
154
  "module": ["tests", "workflows", "basic_subworkflow_deployment", "workflow"],
155
155
  "name": "ExampleSubworkflowDeploymentNode",
156
156
  },
157
+ "ports": [{"id": "ab0db8a9-7b53-4d88-8667-273b31303273", "name": "default", "type": "DEFAULT"}],
157
158
  }
158
159
 
159
160
  assert not DeepDiff(
@@ -113,6 +113,7 @@ def test_serialize_workflow():
113
113
  "name": "ExampleTemplatingNode",
114
114
  "module": ["tests", "workflows", "basic_templating_node", "workflow_with_json_input"],
115
115
  },
116
+ "ports": [{"id": "39317827-df43-4f5a-bfbc-20bffc839748", "name": "default", "type": "DEFAULT"}],
116
117
  },
117
118
  templating_node,
118
119
  )
@@ -68,7 +68,7 @@ def test_serialize_workflow():
68
68
  "label": "Basic Final Output Node",
69
69
  "name": "basic-final-output-node",
70
70
  "target_handle_id": "0173d3c6-11d1-44b7-b070-ca9ff5119046",
71
- "output_id": "97349956-d228-4b51-a64b-1331f788373f",
71
+ "output_id": "aa63e3f6-fde3-4d19-84ef-29982d44d709",
72
72
  "output_type": "STRING",
73
73
  "node_input_id": "5322567a-f40c-400a-96b3-c3b054db543e",
74
74
  },
@@ -98,7 +98,7 @@ def test_serialize_workflow():
98
98
  },
99
99
  "outputs": [
100
100
  {
101
- "id": "97349956-d228-4b51-a64b-1331f788373f",
101
+ "id": "aa63e3f6-fde3-4d19-84ef-29982d44d709",
102
102
  "name": "value",
103
103
  "type": "STRING",
104
104
  "value": {"type": "WORKFLOW_INPUT", "input_variable_id": "e39a7b63-de15-490a-ae9b-8112c767aea0"},
@@ -92,7 +92,7 @@ def test_serialize_workflow__missing_final_output_node():
92
92
  "label": "First Final Output Node",
93
93
  "name": "first-final-output-node",
94
94
  "target_handle_id": "a0c2eb7a-398e-4f28-b63d-f3bae9b563ee",
95
- "output_id": "5517e50d-7f40-4f7c-acb2-e329d79a25bf",
95
+ "output_id": "0cd02933-c5b9-47c9-aede-e97c5870e8aa",
96
96
  "output_type": "STRING",
97
97
  "node_input_id": "16363762-c14a-4162-8fab-525079d3cffe",
98
98
  },
@@ -122,7 +122,7 @@ def test_serialize_workflow__missing_final_output_node():
122
122
  },
123
123
  "outputs": [
124
124
  {
125
- "id": "5517e50d-7f40-4f7c-acb2-e329d79a25bf",
125
+ "id": "0cd02933-c5b9-47c9-aede-e97c5870e8aa",
126
126
  "name": "value",
127
127
  "type": "STRING",
128
128
  "value": {
@@ -31,7 +31,6 @@ from vellum_ee.workflows.display.base import (
31
31
  )
32
32
  from vellum_ee.workflows.display.editor.types import NodeDisplayData
33
33
  from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
34
- from vellum_ee.workflows.display.nodes.base_node_vellum_display import BaseNodeVellumDisplay
35
34
  from vellum_ee.workflows.display.nodes.get_node_display_class import get_node_display_class
36
35
  from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplay
37
36
  from vellum_ee.workflows.display.nodes.utils import raise_if_descriptor
@@ -241,14 +240,9 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
241
240
  )
242
241
 
243
242
  if source_node_display:
244
- if isinstance(source_node_display, BaseNodeVellumDisplay):
245
- source_handle_id = source_node_display.get_source_handle_id(
246
- port_displays=self.display_context.port_displays
247
- )
248
- else:
249
- source_handle_id = source_node_display.get_node_port_display(
250
- source_node_display._node.Ports.default
251
- ).id
243
+ source_handle_id = source_node_display.get_source_handle_id(
244
+ port_displays=self.display_context.port_displays
245
+ )
252
246
 
253
247
  synthetic_output_edges.append(
254
248
  {
@@ -617,9 +611,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
617
611
  node_event_displays = {}
618
612
  for node_id in node_displays:
619
613
  node, current_node_display = node_displays[node_id]
620
- input_display = {}
621
- if isinstance(current_node_display, BaseNodeVellumDisplay):
622
- input_display = current_node_display.node_input_ids_by_name
614
+ input_display = current_node_display.node_input_ids_by_name
623
615
  output_display = {
624
616
  output.name: current_node_display.output_display[output].id
625
617
  for output in current_node_display.output_display
@@ -1,30 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from __future__ import annotations
4
- from ..core.pydantic_utilities import UniversalBaseModel
5
- import typing
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
- import pydantic
8
- from ..core.pydantic_utilities import update_forward_refs
9
-
10
-
11
- class NodeEventDisplayContext(UniversalBaseModel):
12
- input_display: typing.Dict[str, str]
13
- output_display: typing.Dict[str, str]
14
- port_display: typing.Dict[str, str]
15
- subworkflow_display: typing.Optional["WorkflowEventDisplayContext"] = None
16
-
17
- if IS_PYDANTIC_V2:
18
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
- else:
20
-
21
- class Config:
22
- frozen = True
23
- smart_union = True
24
- extra = pydantic.Extra.allow
25
-
26
-
27
- from .workflow_event_display_context import WorkflowEventDisplayContext # noqa: E402
28
-
29
- update_forward_refs(WorkflowEventDisplayContext, NodeEventDisplayContext=NodeEventDisplayContext)
30
- update_forward_refs(NodeEventDisplayContext)
@@ -1,28 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from __future__ import annotations
4
- from ..core.pydantic_utilities import UniversalBaseModel
5
- import typing
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
- import pydantic
8
- from ..core.pydantic_utilities import update_forward_refs
9
-
10
-
11
- class WorkflowEventDisplayContext(UniversalBaseModel):
12
- node_displays: typing.Dict[str, "NodeEventDisplayContext"]
13
- workflow_inputs: typing.Dict[str, str]
14
- workflow_outputs: typing.Dict[str, str]
15
-
16
- if IS_PYDANTIC_V2:
17
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
- else:
19
-
20
- class Config:
21
- frozen = True
22
- smart_union = True
23
- extra = pydantic.Extra.allow
24
-
25
-
26
- from .node_event_display_context import NodeEventDisplayContext # noqa: E402
27
-
28
- update_forward_refs(WorkflowEventDisplayContext)
@@ -1,3 +0,0 @@
1
- # WARNING: This file will be removed in a future release. Please import from "vellum.client" instead.
2
-
3
- from vellum.client.types.workflow_event_display_context import *
@@ -1,40 +0,0 @@
1
- from uuid import UUID
2
- from typing import ClassVar, Dict, Optional
3
-
4
- from vellum.workflows.nodes.utils import get_unadorned_node
5
- from vellum.workflows.ports import Port
6
- from vellum.workflows.types.generics import NodeType
7
- from vellum_ee.workflows.display.editor.types import NodeDisplayComment, NodeDisplayData
8
- from vellum_ee.workflows.display.nodes.base_node_display import BaseNodeDisplay
9
- from vellum_ee.workflows.display.nodes.types import PortDisplay
10
-
11
-
12
- class BaseNodeVellumDisplay(BaseNodeDisplay[NodeType]):
13
- # Used to explicitly set display data for a node
14
- display_data: ClassVar[Optional[NodeDisplayData]] = None
15
-
16
- def get_display_data(self) -> NodeDisplayData:
17
- explicit_value = self._get_explicit_node_display_attr("display_data", NodeDisplayData)
18
- docstring = self._node.__doc__
19
-
20
- if explicit_value and explicit_value.comment and docstring:
21
- comment = (
22
- NodeDisplayComment(value=docstring, expanded=explicit_value.comment.expanded)
23
- if explicit_value.comment.expanded
24
- else NodeDisplayComment(value=docstring)
25
- )
26
- return NodeDisplayData(
27
- position=explicit_value.position,
28
- width=explicit_value.width,
29
- height=explicit_value.height,
30
- comment=comment,
31
- )
32
-
33
- return explicit_value if explicit_value else NodeDisplayData()
34
-
35
- def get_source_handle_id(self, port_displays: Dict[Port, PortDisplay]) -> UUID:
36
- unadorned_node = get_unadorned_node(self._node)
37
- default_port = unadorned_node.Ports.default
38
-
39
- default_port_display = port_displays[default_port]
40
- return default_port_display.id