vellum-ai 1.0.1__py3-none-any.whl → 1.0.2__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.
@@ -25,10 +25,10 @@ class BaseClientWrapper:
25
25
 
26
26
  def get_headers(self) -> typing.Dict[str, str]:
27
27
  headers: typing.Dict[str, str] = {
28
- "User-Agent": "vellum-ai/1.0.1",
28
+ "User-Agent": "vellum-ai/1.0.2",
29
29
  "X-Fern-Language": "Python",
30
30
  "X-Fern-SDK-Name": "vellum-ai",
31
- "X-Fern-SDK-Version": "1.0.1",
31
+ "X-Fern-SDK-Version": "1.0.2",
32
32
  }
33
33
  if self._api_version is not None:
34
34
  headers["X-API-Version"] = self._api_version
@@ -21,13 +21,13 @@ from vellum.client.types.chat_message_request import ChatMessageRequest
21
21
  from vellum.client.types.prompt_exec_config import PromptExecConfig
22
22
  from vellum.client.types.prompt_settings import PromptSettings
23
23
  from vellum.client.types.rich_text_child_block import RichTextChildBlock
24
+ from vellum.prompts.constants import DEFAULT_PROMPT_PARAMETERS
24
25
  from vellum.workflows.context import get_execution_context
25
26
  from vellum.workflows.errors import WorkflowErrorCode
26
27
  from vellum.workflows.errors.types import vellum_error_to_workflow_error
27
28
  from vellum.workflows.events.types import default_serializer
28
29
  from vellum.workflows.exceptions import NodeException
29
30
  from vellum.workflows.nodes.displayable.bases.base_prompt_node import BasePromptNode
30
- from vellum.workflows.nodes.displayable.bases.inline_prompt_node.constants import DEFAULT_PROMPT_PARAMETERS
31
31
  from vellum.workflows.outputs import BaseOutput
32
32
  from vellum.workflows.types import MergeBehavior
33
33
  from vellum.workflows.types.definition import DeploymentDefinition
@@ -2,6 +2,7 @@ from typing import ClassVar, Iterator, List, Optional, Set
2
2
 
3
3
  from vellum import ChatMessage, PromptBlock
4
4
  from vellum.client.types.prompt_parameters import PromptParameters
5
+ from vellum.prompts.constants import DEFAULT_PROMPT_PARAMETERS
5
6
  from vellum.workflows.context import execution_context, get_parent_context
6
7
  from vellum.workflows.errors.types import WorkflowErrorCode
7
8
  from vellum.workflows.events.workflow import is_workflow_event
@@ -9,7 +10,6 @@ from vellum.workflows.exceptions import NodeException
9
10
  from vellum.workflows.graph.graph import Graph
10
11
  from vellum.workflows.inputs.base import BaseInputs
11
12
  from vellum.workflows.nodes.bases import BaseNode
12
- from vellum.workflows.nodes.displayable.bases.inline_prompt_node.constants import DEFAULT_PROMPT_PARAMETERS
13
13
  from vellum.workflows.nodes.displayable.tool_calling_node.state import ToolCallingState
14
14
  from vellum.workflows.nodes.displayable.tool_calling_node.utils import (
15
15
  create_function_node,
@@ -10,10 +10,10 @@ from vellum.client.types.initiated_execute_prompt_event import InitiatedExecuteP
10
10
  from vellum.client.types.string_chat_message_content import StringChatMessageContent
11
11
  from vellum.client.types.string_vellum_value import StringVellumValue
12
12
  from vellum.client.types.variable_prompt_block import VariablePromptBlock
13
+ from vellum.prompts.constants import DEFAULT_PROMPT_PARAMETERS
13
14
  from vellum.workflows import BaseWorkflow
14
15
  from vellum.workflows.inputs.base import BaseInputs
15
16
  from vellum.workflows.nodes.bases import BaseNode
16
- from vellum.workflows.nodes.displayable.bases.inline_prompt_node.constants import DEFAULT_PROMPT_PARAMETERS
17
17
  from vellum.workflows.nodes.displayable.tool_calling_node.node import ToolCallingNode
18
18
  from vellum.workflows.nodes.displayable.tool_calling_node.utils import create_function_node, create_tool_router_node
19
19
  from vellum.workflows.outputs.base import BaseOutputs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.9,<4.0
@@ -111,7 +111,7 @@ vellum_ee/workflows/display/utils/tests/test_auto_layout.py,sha256=vfXI769418s9v
111
111
  vellum_ee/workflows/display/utils/vellum.py,sha256=mtoXmSYwR7rvrq-d6CzCW_auaJXTct0Mi1F0xpRCiNQ,5627
112
112
  vellum_ee/workflows/display/vellum.py,sha256=J2mdJZ1sdLW535DDUkq_Vm8Z572vhuxHxVZF9deKSdk,391
113
113
  vellum_ee/workflows/display/workflows/__init__.py,sha256=JTB9ObEV3l4gGGdtfBHwVJtTTKC22uj-a-XjTVwXCyA,148
114
- vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=KXUoIDwbFUdQwA_1JgIy0p_zy0ItuMhMcAGmbkwXmLY,41683
114
+ vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=DNR5LuhC6m2r1XzeFsDuX98lL2ka6tYorInhsNC8O_Y,41535
115
115
  vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=gxz76AeCqgAZ9D2lZeTiZzxY9eMgn3qOSfVgiqYcOh8,2028
116
116
  vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=9CkgKbM_zgq0l2bwst1hLFGyOigpjsBO4ZU6qSMXND4,36027
117
117
  vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -144,7 +144,7 @@ vellum/client/README.md,sha256=Dle5iytCXxP1pNeNd7uZyhFo0rl7tp7vU7s8gmi10OQ,4863
144
144
  vellum/client/__init__.py,sha256=yIMTLkqrMput0mnWPw7OQayz3mW7w478E9RmZsiTtWM,124904
145
145
  vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
146
146
  vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
147
- vellum/client/core/client_wrapper.py,sha256=7X0BHR_yppYC9e92N48mJRYUthlXwF0_UprOqI8itSU,2383
147
+ vellum/client/core/client_wrapper.py,sha256=mZtpQvxbGA88AaGaNdeIKUV2KCodk0iJqUYs3dXpFR4,2383
148
148
  vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
149
149
  vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
150
150
  vellum/client/core/http_client.py,sha256=cKs2w0ybDBk1wHQf-fTALm_MmvaMe3cZKcYJxqmCxkE,19539
@@ -855,6 +855,7 @@ vellum/prompts/blocks/helpers.py,sha256=7G1Qi6N3V1K73iqTypMTcl6Rum7wk449yHStkakL
855
855
  vellum/prompts/blocks/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
856
856
  vellum/prompts/blocks/tests/test_compilation.py,sha256=EOUtdzJDFGbGhoc_y5XTMyO0HOpOM7FYJssPzd_yRVg,5235
857
857
  vellum/prompts/blocks/types.py,sha256=6aSJQco-5kKeadfKVVXF_SrQPlIJgMYVNc-C7so1sY8,975
858
+ vellum/prompts/constants.py,sha256=fnjiRWLoRlC4Puo5oQcpZD5Hd-EesxsAo9l5tGAkpZQ,270
858
859
  vellum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
859
860
  vellum/resources/__init__.py,sha256=sQWK7g_Z4EM7pa7fy6vy3d_DMdTJ4wVcozBn3Lx4Qpo,141
860
861
  vellum/resources/ad_hoc/__init__.py,sha256=UD01D9nS_M7sRKmMbEg4Tv9SlfFj3cWahVxwUEaSLAY,148
@@ -1630,8 +1631,7 @@ vellum/workflows/nodes/displayable/bases/api_node/node.py,sha256=JDYe21Ou8WGkVRx
1630
1631
  vellum/workflows/nodes/displayable/bases/base_prompt_node/__init__.py,sha256=Org3xTvgp1pA0uUXFfnJr29D3HzCey2lEdYF4zbIUgo,70
1631
1632
  vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py,sha256=EJsGaz8Umss6-JWGGYbJp93ZHx3IlZQWAySlHAdNYtY,4466
1632
1633
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/__init__.py,sha256=Hl35IAoepRpE-j4cALaXVJIYTYOF3qszyVbxTj4kS1s,82
1633
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/constants.py,sha256=fnjiRWLoRlC4Puo5oQcpZD5Hd-EesxsAo9l5tGAkpZQ,270
1634
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=6zzgeBTUwCiYTLRhrZAqmi-nU2r4q0gX-ytnatY5kwY,12896
1634
+ vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=hy_fy4zImhpnHuPczKtOLhv_uOmvxvJsQA9Zl9DTmSw,12851
1635
1635
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1636
1636
  vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py,sha256=H1xEaL3vgEPAGQaF_rt8kLl46qmVJEEhcORXT7oRdPk,22626
1637
1637
  vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py,sha256=0a40fkkZkFMmZN0CsWf6EP_y1H6x36EGa3WcfVNyOsM,9797
@@ -1685,10 +1685,10 @@ vellum/workflows/nodes/displayable/tests/test_search_node_error_handling.py,sha2
1685
1685
  vellum/workflows/nodes/displayable/tests/test_search_node_wth_text_output.py,sha256=VepO5z1277c1y5N6LLIC31nnWD1aak2m5oPFplfJHHs,6935
1686
1686
  vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py,sha256=dc3EEn1sOICpr3GdS8eyeFtExaGwWWcw9eHSdkRhQJU,2584
1687
1687
  vellum/workflows/nodes/displayable/tool_calling_node/__init__.py,sha256=3n0-ysmFKsr40CVxPthc0rfJgqVJeZuUEsCmYudLVRg,117
1688
- vellum/workflows/nodes/displayable/tool_calling_node/node.py,sha256=8l_iZe84eYgsZABuDTUo07Js9SR3ZRMTe0706mZwMZM,6549
1688
+ vellum/workflows/nodes/displayable/tool_calling_node/node.py,sha256=BRA6YRCEOk0Nw3DCIT13WY7WCZ7Gx30s-egJe_md0FA,6504
1689
1689
  vellum/workflows/nodes/displayable/tool_calling_node/state.py,sha256=oQg_GAtc349nPB5BL_oeDYYD7q1qSDPAqjj8iA8OoAw,215
1690
1690
  vellum/workflows/nodes/displayable/tool_calling_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1691
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py,sha256=qBNRlfXi-MNB0KGEDyb3cIV77wg-pPYoACLv3IBIWdA,8024
1691
+ vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py,sha256=raY_E5-EgtYNXEPbO2I-Ythe4YeuFdGsXGZ_BAN98uI,7979
1692
1692
  vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py,sha256=eu6WTyENhGLg9pGp_j69rysZjf_qiQXske1YdZn9PzU,1718
1693
1693
  vellum/workflows/nodes/displayable/tool_calling_node/utils.py,sha256=cWlQpEyeLwJX3peMxuTNG3uy26JoXuaQPG4zTuonB5Y,12671
1694
1694
  vellum/workflows/nodes/experimental/README.md,sha256=eF6DfIL8t-HbF9-mcofOMymKrraiBHDLKTlnBa51ZiE,284
@@ -1763,8 +1763,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
1763
1763
  vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1764
1764
  vellum/workflows/workflows/tests/test_base_workflow.py,sha256=ptMntHzVyy8ZuzNgeTuk7hREgKQ5UBdgq8VJFSGaW4Y,20832
1765
1765
  vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
1766
- vellum_ai-1.0.1.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1767
- vellum_ai-1.0.1.dist-info/METADATA,sha256=tDSfFvlpD2ojKn-Rxlg-p0fVoSgi3ea6a0_epIqN6YE,5554
1768
- vellum_ai-1.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1769
- vellum_ai-1.0.1.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1770
- vellum_ai-1.0.1.dist-info/RECORD,,
1766
+ vellum_ai-1.0.2.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1767
+ vellum_ai-1.0.2.dist-info/METADATA,sha256=Sv-txgzIuaWBix0TomAvHzXE1zda-jYNcFRqfD7Npic,5554
1768
+ vellum_ai-1.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1769
+ vellum_ai-1.0.2.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1770
+ vellum_ai-1.0.2.dist-info/RECORD,,
@@ -137,10 +137,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
137
137
  else None
138
138
  )
139
139
 
140
- # An input is required if it has no default value AND is not optional
141
- has_default = workflow_input_reference.instance is not undefined
142
- is_optional = type(None) in workflow_input_reference.types
143
- is_required = not has_default and not is_optional
140
+ is_required = self._is_reference_required(workflow_input_reference)
144
141
 
145
142
  input_variables.append(
146
143
  {
@@ -159,10 +156,7 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
159
156
  primitive_to_vellum_value(state_value_reference.instance) if state_value_reference.instance else None
160
157
  )
161
158
 
162
- # A state variable is required if it has no default value AND is not optional
163
- has_default = state_value_reference.instance is not undefined
164
- is_optional = type(None) in state_value_reference.types
165
- is_required = not has_default and not is_optional
159
+ is_required = self._is_reference_required(state_value_reference)
166
160
 
167
161
  state_variables.append(
168
162
  {
@@ -950,5 +944,12 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
950
944
 
951
945
  return additional_files
952
946
 
947
+ @staticmethod
948
+ def _is_reference_required(reference: BaseDescriptor) -> bool:
949
+ has_default = reference.instance is not undefined
950
+ is_optional = type(None) in reference.types
951
+ is_required = not has_default and not is_optional
952
+ return is_required
953
+
953
954
 
954
955
  register_workflow_display_class(workflow_class=BaseWorkflow, workflow_display_class=BaseWorkflowDisplay)