You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to python and very interesting in this project :
When i just run the webLangChain locally, i meet this problem. Then another problem occured:
Retrying langchain_community.chat_models.openai.acompletion_with_retry.._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
Task exception was never retrieved
future: <Task finished name='Task-99' coro=<<async_generator_athrow without name>()> exception=APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None)>
The complete logs as follows:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/serialization.py", line 90, in default
return super().default(obj)
^^^^^^^
RuntimeError: super(): class cell not found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/cors.py", line 91, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/cors.py", line 146, in simple_response
await self.app(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 758, in call
await self.middleware_stack(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 778, in app
await route.handle(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 299, in handle
await self.app(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 79, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
await response(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 255, in call
async with anyio.create_task_group() as task_group:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 597, in aexit
raise exceptions[0]
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 258, in wrap
await func()
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 245, in stream_response
async for data in self.body_iterator:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/api_handler.py", line 1105, in _stream_log
"data": self._serializer.dumps(data).decode("utf-8"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/serialization.py", line 168, in dumps
return orjson.dumps(obj, default=default)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: numpy.float64
Retrying langchain_community.chat_models.openai.acompletion_with_retry.._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
Task exception was never retrieved
future: <Task finished name='Task-99' coro=<<async_generator_athrow without name>()> exception=APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None)>
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1120, in create_connection
raise exceptions[0]
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1102, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1005, in _connect_sock
await self.sock_connect(sock, address)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/selector_events.py", line 651, in sock_connect
return await fut
^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/selector_events.py", line 691, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 60] Connect call failed ('202.160.128.40', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 678, in arequest_raw
result = await session.request(**request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
raise last_exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.openai.com:443 ssl:default [Connect call failed ('202.160.128.40', 443)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 616, in _astream_log_implementation
await task
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 570, in consume_astream
async for chunk in runnable.astream(input, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 4149, in astream
async for item in self.bound.astream(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2471, in astream
async for chunk in self.atransform(input_aiter(), config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2454, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1611, in _atransform_stream_with_config
chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 237, in tap_output_aiter
async for chunk in output:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2424, in _atransform
async for output in final_pipeline:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 4185, in atransform
async for item in self.bound.atransform(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2454, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1611, in _atransform_stream_with_config
chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 237, in tap_output_aiter
async for chunk in output:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2424, in _atransform
async for output in final_pipeline:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/output_parsers/transform.py", line 60, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1576, in _atransform_stream_with_config
final_input: Optional[Input] = await py_anext(input_for_tracing, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/utils/aiter.py", line 62, in anext_impl
return await anext(iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/utils/aiter.py", line 97, in tee_peer
item = await iterator.anext()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/configurable.py", line 218, in atransform
async for chunk in runnable.atransform(input, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1087, in atransform
async for output in self.astream(final, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 308, in astream
raise e
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 292, in astream
async for chunk in self._astream(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 490, in _astream
async for chunk in await acompletion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 114, in acompletion_with_retry
return await _completion_with_retry(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/init.py", line 325, in iter
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/init.py", line 158, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 112, in _completion_with_retry
return await llm.client.acreate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_resources/chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 219, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 374, in arequest
result = await self.arequest_raw(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 695, in arequest_raw
raise error.APIConnectionError("Error communicating with OpenAI") from e
openai.error.APIConnectionError: Error communicating with OpenAI
i doubt that if there is something wrong with some packages, maybe i installed the incompatible version but i idk which one.
this is my packages info:
Package Version
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm new to python and very interesting in this project :
When i just run the webLangChain locally, i meet this problem. Then another problem occured:
Retrying langchain_community.chat_models.openai.acompletion_with_retry.._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
Task exception was never retrieved
future: <Task finished name='Task-99' coro=<<async_generator_athrow without name>()> exception=APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None)>
The complete logs as follows:
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/serialization.py", line 90, in default
return super().default(obj)
^^^^^^^
RuntimeError: super(): class cell not found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/cors.py", line 91, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/cors.py", line 146, in simple_response
await self.app(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 758, in call
await self.middleware_stack(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 778, in app
await route.handle(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 299, in handle
await self.app(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 79, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
await response(scope, receive, send)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 255, in call
async with anyio.create_task_group() as task_group:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 597, in aexit
raise exceptions[0]
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 258, in wrap
await func()
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/sse_starlette/sse.py", line 245, in stream_response
async for data in self.body_iterator:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/api_handler.py", line 1105, in _stream_log
"data": self._serializer.dumps(data).decode("utf-8"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langserve/serialization.py", line 168, in dumps
return orjson.dumps(obj, default=default)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: numpy.float64
Retrying langchain_community.chat_models.openai.acompletion_with_retry.._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
Task exception was never retrieved
future: <Task finished name='Task-99' coro=<<async_generator_athrow without name>()> exception=APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None)>
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1120, in create_connection
raise exceptions[0]
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1102, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/base_events.py", line 1005, in _connect_sock
await self.sock_connect(sock, address)
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/selector_events.py", line 651, in sock_connect
return await fut
^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/asyncio/selector_events.py", line 691, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 60] Connect call failed ('202.160.128.40', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 678, in arequest_raw
result = await session.request(**request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
raise last_exc
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.openai.com:443 ssl:default [Connect call failed ('202.160.128.40', 443)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 616, in _astream_log_implementation
await task
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 570, in consume_astream
async for chunk in runnable.astream(input, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 4149, in astream
async for item in self.bound.astream(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2471, in astream
async for chunk in self.atransform(input_aiter(), config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2454, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1611, in _atransform_stream_with_config
chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 237, in tap_output_aiter
async for chunk in output:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2424, in _atransform
async for output in final_pipeline:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 4185, in atransform
async for item in self.bound.atransform(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2454, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1611, in _atransform_stream_with_config
chunk: Output = await asyncio.create_task( # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/tracers/log_stream.py", line 237, in tap_output_aiter
async for chunk in output:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2424, in _atransform
async for output in final_pipeline:
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/output_parsers/transform.py", line 60, in atransform
async for chunk in self._atransform_stream_with_config(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1576, in _atransform_stream_with_config
final_input: Optional[Input] = await py_anext(input_for_tracing, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/utils/aiter.py", line 62, in anext_impl
return await anext(iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/utils/aiter.py", line 97, in tee_peer
item = await iterator.anext()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/configurable.py", line 218, in atransform
async for chunk in runnable.atransform(input, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1087, in atransform
async for output in self.astream(final, config, **kwargs):
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 308, in astream
raise e
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 292, in astream
async for chunk in self._astream(
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 490, in _astream
async for chunk in await acompletion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 114, in acompletion_with_retry
return await _completion_with_retry(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/init.py", line 325, in iter
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/init.py", line 158, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/langchain_community/chat_models/openai.py", line 112, in _completion_with_retry
return await llm.client.acreate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_resources/chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 219, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 374, in arequest
result = await self.arequest_raw(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xian_w/opt/anaconda3/envs/py312/lib/python3.12/site-packages/openai/api_requestor.py", line 695, in arequest_raw
raise error.APIConnectionError("Error communicating with OpenAI") from e
openai.error.APIConnectionError: Error communicating with OpenAI
i doubt that if there is something wrong with some packages, maybe i installed the incompatible version but i idk which one.
this is my packages info:
Package Version
aiohttp 3.9.3
aiosignal 1.3.1
anthropic 0.19.1
anyio 3.7.1
async-timeout 4.0.3
attrs 23.1.0
cachetools 5.3.1
certifi 2023.7.22
charset-normalizer 3.3.0
click 8.1.7
colorama 0.4.6
dataclasses-json 0.6.1
distro 1.9.0
fastapi 0.110.0
filelock 3.12.4
frozenlist 1.4.0
fsspec 2023.9.2
gitdb 4.0.11
GitPython 3.1.42
google-api-core 2.12.0
google-auth 2.23.3
google-cloud-core 2.3.3
google-crc32c 1.5.0
google-resumable-media 2.6.0
googleapis-common-protos 1.61.0
greenlet 3.0.0
grpc-google-iam-v1 0.12.6
grpcio 1.59.0
grpcio-status 1.59.0
h11 0.14.0
httpcore 1.0.4
httplib2 0.22.0
httpx 0.27.0
httpx-sse 0.4.0
huggingface-hub 0.17.3
idna 3.4
jsonpatch 1.33
jsonpointer 2.4
kay 0.1.2
langchain 0.1.9
langchain-cli 0.0.21
langchain-community 0.0.25
langchain-core 0.1.29
langchain-openai 0.0.1
langserve 0.0.47
langsmith 0.1.10
markdown-it-py 3.0.0
marshmallow 3.20.1
mdurl 0.1.2
multidict 6.0.4
mypy-extensions 1.0.0
numpy 1.26.4
openai 0.28.1
orjson 3.9.15
packaging 23.2
pip 23.3.1
proto-plus 1.22.3
protobuf 4.24.4
pyasn1 0.5.0
pyasn1-modules 0.3.0
pydantic 1.10.0
Pygments 2.17.2
pyparsing 3.1.1
python-dateutil 2.8.2
PyYAML 6.0.1
regex 2023.12.25
requests 2.31.0
rich 13.7.0
rsa 4.9
setuptools 68.2.2
shellingham 1.5.4
six 1.16.0
smmap 5.0.1
sniffio 1.3.0
SQLAlchemy 2.0.22
sse-starlette 1.8.2
starlette 0.36.3
tavily-python 0.3.1
tenacity 8.2.3
tiktoken 0.5.2
tokenizers 0.15.2
tomlkit 0.12.4
tqdm 4.66.1
typer 0.9.0
typing_extensions 4.8.0
typing-inspect 0.9.0
urllib3 2.0.7
uvicorn 0.23.2
wheel 0.41.2
yarl 1.9.2
Or maybe something wrong with my openai api key. But i can't solve the problem now. I just want to run it on my computer, is there anyone help me out.
Beta Was this translation helpful? Give feedback.
All reactions