vellum-ai 1.3.11__py3-none-any.whl → 1.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/client/core/client_wrapper.py +2 -2
- vellum/workflows/nodes/tests/test_utils.py +4 -4
- vellum/workflows/nodes/utils.py +4 -4
- {vellum_ai-1.3.11.dist-info → vellum_ai-1.4.0.dist-info}/METADATA +1 -1
- {vellum_ai-1.3.11.dist-info → vellum_ai-1.4.0.dist-info}/RECORD +10 -10
- vellum_ee/workflows/display/workflows/base_workflow_display.py +5 -1
- vellum_ee/workflows/tests/test_serialize_module.py +5 -6
- {vellum_ai-1.3.11.dist-info → vellum_ai-1.4.0.dist-info}/LICENSE +0 -0
- {vellum_ai-1.3.11.dist-info → vellum_ai-1.4.0.dist-info}/WHEEL +0 -0
- {vellum_ai-1.3.11.dist-info → vellum_ai-1.4.0.dist-info}/entry_points.txt +0 -0
@@ -27,10 +27,10 @@ class BaseClientWrapper:
|
|
27
27
|
|
28
28
|
def get_headers(self) -> typing.Dict[str, str]:
|
29
29
|
headers: typing.Dict[str, str] = {
|
30
|
-
"User-Agent": "vellum-ai/1.
|
30
|
+
"User-Agent": "vellum-ai/1.4.0",
|
31
31
|
"X-Fern-Language": "Python",
|
32
32
|
"X-Fern-SDK-Name": "vellum-ai",
|
33
|
-
"X-Fern-SDK-Version": "1.
|
33
|
+
"X-Fern-SDK-Version": "1.4.0",
|
34
34
|
**(self.get_custom_headers() or {}),
|
35
35
|
}
|
36
36
|
if self._api_version is not None:
|
@@ -86,23 +86,23 @@ def test_parse_type_from_str_list_of_models():
|
|
86
86
|
List[str],
|
87
87
|
NodeException,
|
88
88
|
WorkflowErrorCode.INVALID_OUTPUTS,
|
89
|
-
"Invalid JSON
|
89
|
+
"Invalid JSON format: expected a valid JSON array",
|
90
90
|
),
|
91
91
|
(
|
92
92
|
"{invalid json}",
|
93
93
|
Person,
|
94
94
|
NodeException,
|
95
95
|
WorkflowErrorCode.INVALID_OUTPUTS,
|
96
|
-
"Invalid JSON format
|
96
|
+
"Invalid JSON format: unable to parse the provided data",
|
97
97
|
),
|
98
98
|
(
|
99
99
|
"{invalid json}",
|
100
100
|
Json,
|
101
101
|
NodeException,
|
102
102
|
WorkflowErrorCode.INVALID_OUTPUTS,
|
103
|
-
"Invalid JSON format
|
103
|
+
"Invalid JSON format: unable to parse the provided data",
|
104
104
|
),
|
105
|
-
('{"name": "Alice"}', List[str], ValueError, None, "Expected a list of items
|
105
|
+
('{"name": "Alice"}', List[str], ValueError, None, "Expected a list of items, but received dict"),
|
106
106
|
("data", object, ValueError, None, "Unsupported output type: <class 'object'>"),
|
107
107
|
],
|
108
108
|
ids=[
|
vellum/workflows/nodes/utils.py
CHANGED
@@ -129,11 +129,11 @@ def parse_type_from_str(result_as_str: str, output_type: Any) -> Any:
|
|
129
129
|
# raise ValueError("Invalid JSON Array format for result_as_str")
|
130
130
|
raise NodeException(
|
131
131
|
code=WorkflowErrorCode.INVALID_OUTPUTS,
|
132
|
-
message="Invalid JSON
|
132
|
+
message="Invalid JSON format: expected a valid JSON array",
|
133
133
|
)
|
134
134
|
|
135
135
|
if not isinstance(data, list):
|
136
|
-
raise ValueError(f"Expected a list of items
|
136
|
+
raise ValueError(f"Expected a list of items, but received {data.__class__.__name__}")
|
137
137
|
|
138
138
|
inner_type = get_args(output_type)[0]
|
139
139
|
if issubclass(inner_type, BaseModel):
|
@@ -151,7 +151,7 @@ def parse_type_from_str(result_as_str: str, output_type: Any) -> Any:
|
|
151
151
|
except json.JSONDecodeError:
|
152
152
|
raise NodeException(
|
153
153
|
code=WorkflowErrorCode.INVALID_OUTPUTS,
|
154
|
-
message="Invalid JSON format
|
154
|
+
message="Invalid JSON format: unable to parse the provided data",
|
155
155
|
)
|
156
156
|
|
157
157
|
if get_origin(output_type) is Union:
|
@@ -177,7 +177,7 @@ def parse_type_from_str(result_as_str: str, output_type: Any) -> Any:
|
|
177
177
|
except json.JSONDecodeError:
|
178
178
|
raise NodeException(
|
179
179
|
code=WorkflowErrorCode.INVALID_OUTPUTS,
|
180
|
-
message="Invalid JSON format
|
180
|
+
message="Invalid JSON format: unable to parse the provided data",
|
181
181
|
)
|
182
182
|
|
183
183
|
raise ValueError(f"Unsupported output type: {output_type}")
|
@@ -121,7 +121,7 @@ vellum_ee/workflows/display/utils/tests/test_events.py,sha256=42IEBnMbaQrH8gigw5
|
|
121
121
|
vellum_ee/workflows/display/utils/vellum.py,sha256=sZwU0KdmZZTKWW62SyxJTl2tC8tN6p_BpZ-lDoinV-U,5670
|
122
122
|
vellum_ee/workflows/display/vellum.py,sha256=J2mdJZ1sdLW535DDUkq_Vm8Z572vhuxHxVZF9deKSdk,391
|
123
123
|
vellum_ee/workflows/display/workflows/__init__.py,sha256=JTB9ObEV3l4gGGdtfBHwVJtTTKC22uj-a-XjTVwXCyA,148
|
124
|
-
vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=
|
124
|
+
vellum_ee/workflows/display/workflows/base_workflow_display.py,sha256=tlhtdNFT4_NJlBDkcn13CQOA49iy6d1F7kl5ONq21Rw,44032
|
125
125
|
vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py,sha256=gxz76AeCqgAZ9D2lZeTiZzxY9eMgn3qOSfVgiqYcOh8,2028
|
126
126
|
vellum_ee/workflows/display/workflows/tests/test_workflow_display.py,sha256=OKf_WVoPkYPrielOz8CyI5AjWt9MS2nSbWQKpF7HSLI,37847
|
127
127
|
vellum_ee/workflows/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -147,7 +147,7 @@ vellum_ee/workflows/tests/local_workflow/nodes/templating_node.py,sha256=NQwFN61
|
|
147
147
|
vellum_ee/workflows/tests/local_workflow/workflow.py,sha256=A4qOzOPNwePYxWbcAgIPLsmrVS_aVEZEc-wULSv787Q,393
|
148
148
|
vellum_ee/workflows/tests/test_display_meta.py,sha256=PkXJVnMZs9GNooDkd59n4YTBAX3XGPQWeSSVbhehVFM,5112
|
149
149
|
vellum_ee/workflows/tests/test_registry.py,sha256=B8xRIuEyLWfSqrYoPldNQXhKPfe50PllvtAZoI8-uPs,6066
|
150
|
-
vellum_ee/workflows/tests/test_serialize_module.py,sha256=
|
150
|
+
vellum_ee/workflows/tests/test_serialize_module.py,sha256=d4ZpMd3oIxiq-sBXeSQESS6ix6-1P6rdCRFqBEReJIU,2882
|
151
151
|
vellum_ee/workflows/tests/test_server.py,sha256=dXFBraU99Y6cKp2aBhLFXQTScSRcE9WaWjo1z9piqdU,23344
|
152
152
|
vellum_ee/workflows/tests/test_virtual_files.py,sha256=TJEcMR0v2S8CkloXNmCHA0QW0K6pYNGaIjraJz7sFvY,2762
|
153
153
|
vellum/__init__.py,sha256=lv4OTbPgTegugVOpRy5xJPPwMvC1Zqrg4oFMEwY1KSg,47428
|
@@ -155,7 +155,7 @@ vellum/client/README.md,sha256=flqu57ubZNTfpq60CdLtJC9gp4WEkyjb_n_eZ4OYf9w,6497
|
|
155
155
|
vellum/client/__init__.py,sha256=T5Ht_w-Mk_9nzGqdadhQB8V20M0vYj7am06ut0A3P1o,73401
|
156
156
|
vellum/client/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
|
157
157
|
vellum/client/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
158
|
-
vellum/client/core/client_wrapper.py,sha256=
|
158
|
+
vellum/client/core/client_wrapper.py,sha256=s31x1QZneMOjgCfxuF5_0xmRGacwTOb9n0pFobRD42Y,2840
|
159
159
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
160
160
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
161
161
|
vellum/client/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
|
@@ -1916,8 +1916,8 @@ vellum/workflows/nodes/experimental/openai_chat_completion_node/node.py,sha256=c
|
|
1916
1916
|
vellum/workflows/nodes/mocks.py,sha256=a1FjWEIocseMfjzM-i8DNozpUsaW0IONRpZmXBoWlyc,10455
|
1917
1917
|
vellum/workflows/nodes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1918
1918
|
vellum/workflows/nodes/tests/test_mocks.py,sha256=mfPvrs75PKcsNsbJLQAN6PDFoVqs9TmQxpdyFKDdO60,7837
|
1919
|
-
vellum/workflows/nodes/tests/test_utils.py,sha256=
|
1920
|
-
vellum/workflows/nodes/utils.py,sha256=
|
1919
|
+
vellum/workflows/nodes/tests/test_utils.py,sha256=6yn0ieMug-ndcPVR2Z0HLIAMuCuS-4ucKSMnx06qcEc,5674
|
1920
|
+
vellum/workflows/nodes/utils.py,sha256=4u7gJnJtI1CM0RmsS6c-edTeGrJvd340rDiEtP6jRlk,10745
|
1921
1921
|
vellum/workflows/outputs/__init__.py,sha256=AyZ4pRh_ACQIGvkf0byJO46EDnSix1ZCAXfvh-ms1QE,94
|
1922
1922
|
vellum/workflows/outputs/base.py,sha256=zy02zr9DmG3j7Xp3Q8xiOiXFF_c7uNh76jf2LiMS-qE,10132
|
1923
1923
|
vellum/workflows/ports/__init__.py,sha256=bZuMt-R7z5bKwpu4uPW7LlJeePOQWmCcDSXe5frUY5g,101
|
@@ -1987,8 +1987,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
|
|
1987
1987
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1988
1988
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=ptMntHzVyy8ZuzNgeTuk7hREgKQ5UBdgq8VJFSGaW4Y,20832
|
1989
1989
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1990
|
-
vellum_ai-1.
|
1991
|
-
vellum_ai-1.
|
1992
|
-
vellum_ai-1.
|
1993
|
-
vellum_ai-1.
|
1994
|
-
vellum_ai-1.
|
1990
|
+
vellum_ai-1.4.0.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1991
|
+
vellum_ai-1.4.0.dist-info/METADATA,sha256=tI2aW2bZkPjR4_UtYRBydLigbdq2Et_pWewZJw1aKLE,5547
|
1992
|
+
vellum_ai-1.4.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1993
|
+
vellum_ai-1.4.0.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1994
|
+
vellum_ai-1.4.0.dist-info/RECORD,,
|
@@ -17,6 +17,7 @@ from vellum.workflows.descriptors.base import BaseDescriptor
|
|
17
17
|
from vellum.workflows.edges import Edge
|
18
18
|
from vellum.workflows.events.workflow import NodeEventDisplayContext, WorkflowEventDisplayContext
|
19
19
|
from vellum.workflows.inputs.base import BaseInputs
|
20
|
+
from vellum.workflows.inputs.dataset_row import DatasetRow
|
20
21
|
from vellum.workflows.nodes.bases import BaseNode
|
21
22
|
from vellum.workflows.nodes.displayable.bases.utils import primitive_to_vellum_value
|
22
23
|
from vellum.workflows.nodes.displayable.final_output_node.node import FinalOutputNode
|
@@ -913,7 +914,10 @@ class BaseWorkflowDisplay(Generic[WorkflowType]):
|
|
913
914
|
if dataset_attr and isinstance(dataset_attr, list):
|
914
915
|
dataset = []
|
915
916
|
for i, inputs_obj in enumerate(dataset_attr):
|
916
|
-
if isinstance(inputs_obj,
|
917
|
+
if isinstance(inputs_obj, DatasetRow):
|
918
|
+
serialized_inputs = json.loads(json.dumps(inputs_obj.inputs, cls=DefaultStateEncoder))
|
919
|
+
dataset.append({"label": inputs_obj.label, "inputs": serialized_inputs})
|
920
|
+
elif isinstance(inputs_obj, BaseInputs):
|
917
921
|
serialized_inputs = json.loads(json.dumps(inputs_obj, cls=DefaultStateEncoder))
|
918
922
|
dataset.append({"label": f"Scenario {i + 1}", "inputs": serialized_inputs})
|
919
923
|
except (ImportError, AttributeError):
|
@@ -24,12 +24,11 @@ def test_serialize_module_with_actual_dataset():
|
|
24
24
|
assert isinstance(result.dataset, list)
|
25
25
|
assert len(result.dataset) == 2
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
assert "message" in item["inputs"]
|
27
|
+
assert result.dataset[0]["label"] == "Scenario 1"
|
28
|
+
assert result.dataset[0]["inputs"]["message"] == "World"
|
29
|
+
|
30
|
+
assert result.dataset[1]["label"] == "Custom Test"
|
31
|
+
assert result.dataset[1]["inputs"]["message"] == "DatasetRow Test"
|
33
32
|
|
34
33
|
|
35
34
|
def test_serialize_module_happy_path():
|
File without changes
|
File without changes
|
File without changes
|