-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIConnectionError: Error communicating with OpenAI. #5296
Comments
I got this bug, too. Could you tell me how to fix this bug. |
I've got this error only with async functions of langchain, but the error does not say much (on train, I though my connection is just terrible). Later I've set max_retries to lower number: |
I get the same problem and find the wrong is from VPN. Sometimes the VPN rules will only support part of OPENAI. |
This happens mostly on apple silicon machines. Fixed it by,
|
thanks, it works! This happens mostly on apple silicon machines. Fixed it by, bash /Applications/Python*/Install\ Certificates.command |
i got the same question when using agent.arun(). I use windows, the mac problem does not fit me
same error
|
Is this ok? |
Was this issue resolved? I'm also using fastapi and I face this issue after sometime. Initially I receive the responses and after some idle time I receive the same error |
Hi, did you fix it? I am also encounter the same error on my linux machine. |
I am having this issue with Langchain, FastAPI and StreamingResponse in Docker. I am using LCEL, including standard Runnables and custom Runnables. The issue does not occur when calling the LCEL chain directly - even on the same machine. Any insights would be useful. |
@imarquart In my case this was caused by SSL issue, I’m behind my company’s firewall. Maybe you can have a look. |
Hi, @AvikantSrivastava, I'm helping the LangChain team manage their backlog and am marking this issue as stale. The issue you raised pertains to a streaming endpoint in FastAPI encountering an APIConnectionError when communicating with OpenAI due to a certificate verification failure. Several potential solutions have been shared, including adjusting max_retries, using a Web IDE like Colab, and resolving SSL issues. Users have reported experiencing the issue on different platforms, such as Apple silicon machines and Linux. The issue remains unresolved, and it has garnered attention from multiple users seeking assistance and sharing their experiences with similar problems. Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you! |
System Info
python 3.11
Who can help?
@agola11
@hwchase17
Information
Related Components
Reproduction
I am trying to create a streaming endpoint in Fast API, below are the files
main.py
src/chat_stream.py
Expected behavior
The Endpoint should stream the response from LLM Chain, instead I am getting this error
The text was updated successfully, but these errors were encountered: