vellum-ai 1.1.1__py3-none-any.whl → 1.1.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.
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/pydantic_utilities.py +10 -3
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.2.dist-info}/METADATA +1 -1
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.2.dist-info}/RECORD +7 -7
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.2.dist-info}/LICENSE +0 -0
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.2.dist-info}/WHEEL +0 -0
- {vellum_ai-1.1.1.dist-info → vellum_ai-1.1.2.dist-info}/entry_points.txt +0 -0
@@ -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.1.
|
28
|
+
"User-Agent": "vellum-ai/1.1.2",
|
29
29
|
"X-Fern-Language": "Python",
|
30
30
|
"X-Fern-SDK-Name": "vellum-ai",
|
31
|
-
"X-Fern-SDK-Version": "1.1.
|
31
|
+
"X-Fern-SDK-Version": "1.1.2",
|
32
32
|
}
|
33
33
|
if self._api_version is not None:
|
34
34
|
headers["X-API-Version"] = self._api_version
|
@@ -55,12 +55,19 @@ else:
|
|
55
55
|
|
56
56
|
T = typing.TypeVar("T")
|
57
57
|
Model = typing.TypeVar("Model", bound=pydantic.BaseModel)
|
58
|
+
type_adapter_cache: typing.Dict[typing.Type, pydantic.TypeAdapter] = {}
|
59
|
+
annotated_types = {"ExecuteApiResponse"}
|
58
60
|
|
59
61
|
|
60
|
-
def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T:
|
61
|
-
|
62
|
+
def parse_obj_as(type_: typing.Type[T], object_: typing.Any, convert_metadata: bool = False) -> T:
|
63
|
+
if hasattr(type_, "__name__") and type_.__name__ in annotated_types:
|
64
|
+
dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read")
|
65
|
+
else:
|
66
|
+
dealiased_object = object_
|
62
67
|
if IS_PYDANTIC_V2:
|
63
|
-
adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2
|
68
|
+
adapter = pydantic.TypeAdapter(type_) if type_ not in type_adapter_cache else type_adapter_cache[type_] # type: ignore # Pydantic v2
|
69
|
+
if type_ not in type_adapter_cache:
|
70
|
+
type_adapter_cache[type_] = adapter
|
64
71
|
return adapter.validate_python(dealiased_object)
|
65
72
|
else:
|
66
73
|
return pydantic.parse_obj_as(type_, dealiased_object)
|
@@ -147,13 +147,13 @@ vellum/client/README.md,sha256=isKIKsunq_JOIkKDgA67k5yNO7QFaok-RrUlxX634zc,3757
|
|
147
147
|
vellum/client/__init__.py,sha256=zs7kH7o3QHvIeulMc1nw3zn8I1OK1VqbA8_kMFDJwyo,93222
|
148
148
|
vellum/client/core/__init__.py,sha256=JZDozMOUlhvOLnOO6kGBxye5Ctfg_KDOjeUTSUoMmV8,1542
|
149
149
|
vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
150
|
-
vellum/client/core/client_wrapper.py,sha256=
|
150
|
+
vellum/client/core/client_wrapper.py,sha256=VXq8nOWajBONQONOHs5wCSjJknQxudGiKKk9hCz6qyE,2383
|
151
151
|
vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
152
152
|
vellum/client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
153
153
|
vellum/client/core/http_client.py,sha256=cKs2w0ybDBk1wHQf-fTALm_MmvaMe3cZKcYJxqmCxkE,19539
|
154
154
|
vellum/client/core/http_response.py,sha256=Argerx6pFZdCpe637AT3EejZw5zlMGgsshZq6rb7krQ,1005
|
155
155
|
vellum/client/core/jsonable_encoder.py,sha256=hGgcEEeX11sqxxsll7h15pO3pTNVxk_n79Kcn0laoWA,3655
|
156
|
-
vellum/client/core/pydantic_utilities.py,sha256=
|
156
|
+
vellum/client/core/pydantic_utilities.py,sha256=sLkq8EEND-Gxd3IdQM59rzCeRwCBoUvwOCj2ahOq_Fs,12691
|
157
157
|
vellum/client/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
|
158
158
|
vellum/client/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
|
159
159
|
vellum/client/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
|
@@ -1824,8 +1824,8 @@ vellum/workflows/workflows/event_filters.py,sha256=GSxIgwrX26a1Smfd-6yss2abGCnad
|
|
1824
1824
|
vellum/workflows/workflows/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1825
1825
|
vellum/workflows/workflows/tests/test_base_workflow.py,sha256=ptMntHzVyy8ZuzNgeTuk7hREgKQ5UBdgq8VJFSGaW4Y,20832
|
1826
1826
|
vellum/workflows/workflows/tests/test_context.py,sha256=VJBUcyWVtMa_lE5KxdhgMu0WYNYnUQUDvTF7qm89hJ0,2333
|
1827
|
-
vellum_ai-1.1.
|
1828
|
-
vellum_ai-1.1.
|
1829
|
-
vellum_ai-1.1.
|
1830
|
-
vellum_ai-1.1.
|
1831
|
-
vellum_ai-1.1.
|
1827
|
+
vellum_ai-1.1.2.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
|
1828
|
+
vellum_ai-1.1.2.dist-info/METADATA,sha256=OVlK0KuCbzqxBWKi6wQFdvSCn_dQi4uELNHCSisdL9Q,5554
|
1829
|
+
vellum_ai-1.1.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1830
|
+
vellum_ai-1.1.2.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
|
1831
|
+
vellum_ai-1.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|