When trying to use the API via Python, I can’t get past the:
client=OpenAI()
statement. My API key is working, but it returns this error on Spyder:
File ~/opt/anaconda3/lib/python3.9/site-packages/httpx/_transports/default.py:136 in init
self._pool = httpcore.ConnectionPool(
TypeError: init() got an unexpected keyword argument ‘socket_options’
and returns the following error using Jupyter Notebook:
File ~/opt/anaconda3/lib/python3.9/site-packages/httpx/_transports/default.py:136, in HTTPTransport.init(self, verify, cert, http1, http2, limits, trust_env, proxy, uds, local_address, retries, socket_options)
133 ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)
135 if proxy is None:
→ 136 self._pool = httpcore.ConnectionPool(
137 ssl_context=ssl_context,
138 max_connections=limits.max_connections,
139 max_keepalive_connections=limits.max_keepalive_connections,
140 keepalive_expiry=limits.keepalive_expiry,
141 http1=http1,
142 http2=http2,
143 uds=uds,
144 local_address=local_address,
145 retries=retries,
146 socket_options=socket_options,
147 )
148 elif proxy.url.scheme in (“http”, “https”):
149 self._pool = httpcore.HTTPProxy(
150 proxy_url=httpcore.URL(
151 scheme=proxy.url.raw_scheme,
(…)
165 socket_options=socket_options,
166 )
TypeError: init() got an unexpected keyword argument ‘socket_options’
Thanks!
JH