Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de51f60

Browse files
stainless-app[bot]stainless-bot
authored andcommittedNov 28, 2024·
fix(client): compat with new httpx 0.28.0 release (#765)
1 parent bce763a commit de51f60

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/anthropic/_base_client.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ def __init__(
793793
custom_query: Mapping[str, object] | None = None,
794794
_strict_response_validation: bool,
795795
) -> None:
796+
kwargs: dict[str, Any] = {}
796797
if limits is not None:
797798
warnings.warn(
798799
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -805,6 +806,7 @@ def __init__(
805806
limits = DEFAULT_CONNECTION_LIMITS
806807

807808
if transport is not None:
809+
kwargs["transport"] = transport
808810
warnings.warn(
809811
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
810812
category=DeprecationWarning,
@@ -814,6 +816,7 @@ def __init__(
814816
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
815817

816818
if proxies is not None:
819+
kwargs["proxies"] = proxies
817820
warnings.warn(
818821
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
819822
category=DeprecationWarning,
@@ -857,10 +860,9 @@ def __init__(
857860
base_url=base_url,
858861
# cast to a valid type because mypy doesn't understand our type narrowing
859862
timeout=cast(Timeout, timeout),
860-
proxies=proxies,
861-
transport=transport,
862863
limits=limits,
863864
follow_redirects=True,
865+
**kwargs, # type: ignore
864866
)
865867

866868
def is_closed(self) -> bool:
@@ -1374,6 +1376,7 @@ def __init__(
13741376
custom_headers: Mapping[str, str] | None = None,
13751377
custom_query: Mapping[str, object] | None = None,
13761378
) -> None:
1379+
kwargs: dict[str, Any] = {}
13771380
if limits is not None:
13781381
warnings.warn(
13791382
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1386,6 +1389,7 @@ def __init__(
13861389
limits = DEFAULT_CONNECTION_LIMITS
13871390

13881391
if transport is not None:
1392+
kwargs["transport"] = transport
13891393
warnings.warn(
13901394
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
13911395
category=DeprecationWarning,
@@ -1395,6 +1399,7 @@ def __init__(
13951399
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
13961400

13971401
if proxies is not None:
1402+
kwargs["proxies"] = proxies
13981403
warnings.warn(
13991404
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
14001405
category=DeprecationWarning,
@@ -1438,10 +1443,9 @@ def __init__(
14381443
base_url=base_url,
14391444
# cast to a valid type because mypy doesn't understand our type narrowing
14401445
timeout=cast(Timeout, timeout),
1441-
proxies=proxies,
1442-
transport=transport,
14431446
limits=limits,
14441447
follow_redirects=True,
1448+
**kwargs, # type: ignore
14451449
)
14461450

14471451
def is_closed(self) -> bool:

0 commit comments

Comments
 (0)
Please sign in to comment.