File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 15
15
from .. import _ApiType , __version__
16
16
from ._api import register_commands
17
17
from ._utils import can_use_http2
18
- from .._types import ProxiesDict
19
18
from ._errors import CLIError , display_error
20
19
from .._compat import PYDANTIC_V2 , ConfigDict , model_parse
21
20
from .._models import BaseModel
@@ -167,17 +166,17 @@ def _main() -> None:
167
166
if args .verbosity != 0 :
168
167
sys .stderr .write ("Warning: --verbosity isn't supported yet\n " )
169
168
170
- proxies : ProxiesDict = {}
169
+ proxies : dict [ str , httpx . BaseTransport ] = {}
171
170
if args .proxy is not None :
172
171
for proxy in args .proxy :
173
172
key = "https://" if proxy .startswith ("https" ) else "http://"
174
173
if key in proxies :
175
174
raise CLIError (f"Multiple { key } proxies given - only the last one would be used" )
176
175
177
- proxies [key ] = proxy
176
+ proxies [key ] = httpx . HTTPTransport ( proxy = httpx . Proxy ( httpx . URL ( proxy )))
178
177
179
178
http_client = httpx .Client (
180
- proxies = proxies or None ,
179
+ mounts = proxies or None ,
181
180
http2 = can_use_http2 (),
182
181
)
183
182
openai .http_client = http_client
You can’t perform that action at this time.
0 commit comments