Skip to content

Commit 72b6c63

Browse files
stainless-app[bot]stainless-bot
authored andcommittedNov 28, 2024
fix(client): compat with new httpx 0.28.0 release (#1904)
1 parent 95bd258 commit 72b6c63

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/openai/_base_client.py

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

808809
if transport is not None:
810+
kwargs["transport"] = transport
809811
warnings.warn(
810812
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
811813
category=DeprecationWarning,
@@ -815,6 +817,7 @@ def __init__(
815817
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
816818

817819
if proxies is not None:
820+
kwargs["proxies"] = proxies
818821
warnings.warn(
819822
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
820823
category=DeprecationWarning,
@@ -858,10 +861,9 @@ def __init__(
858861
base_url=base_url,
859862
# cast to a valid type because mypy doesn't understand our type narrowing
860863
timeout=cast(Timeout, timeout),
861-
proxies=proxies,
862-
transport=transport,
863864
limits=limits,
864865
follow_redirects=True,
866+
**kwargs, # type: ignore
865867
)
866868

867869
def is_closed(self) -> bool:
@@ -1375,6 +1377,7 @@ def __init__(
13751377
custom_headers: Mapping[str, str] | None = None,
13761378
custom_query: Mapping[str, object] | None = None,
13771379
) -> None:
1380+
kwargs: dict[str, Any] = {}
13781381
if limits is not None:
13791382
warnings.warn(
13801383
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1387,6 +1390,7 @@ def __init__(
13871390
limits = DEFAULT_CONNECTION_LIMITS
13881391

13891392
if transport is not None:
1393+
kwargs["transport"] = transport
13901394
warnings.warn(
13911395
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
13921396
category=DeprecationWarning,
@@ -1396,6 +1400,7 @@ def __init__(
13961400
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
13971401

13981402
if proxies is not None:
1403+
kwargs["proxies"] = proxies
13991404
warnings.warn(
14001405
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
14011406
category=DeprecationWarning,
@@ -1439,10 +1444,9 @@ def __init__(
14391444
base_url=base_url,
14401445
# cast to a valid type because mypy doesn't understand our type narrowing
14411446
timeout=cast(Timeout, timeout),
1442-
proxies=proxies,
1443-
transport=transport,
14441447
limits=limits,
14451448
follow_redirects=True,
1449+
**kwargs, # type: ignore
14461450
)
14471451

14481452
def is_closed(self) -> bool:

0 commit comments

Comments
 (0)