codeinterpreter-api
codeinterpreter-api copied to clipboard
Error communicating with OpenAI
Very strange, I tried to use other plugins such as chapyter, but apparently there is an API ConnectionError. I already passed in the API key as an environment variable.
An error occurred with the following message while using a proxy environment:
Retrying langchain.chat_models.openai.acompletion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
Retrying langchain.chat_models.openai.acompletion_with_retry.<locals>._completion_with_retry in 2.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
To address this issue, it was confirmed that the problem can be avoided by adding the following code:
import os
import openai
# openai.proxy = 'http://proxy.example.org'
openai.proxy = os.getenv('https_proxy')
It seems that in the asynchronous API used internally, it is necessary to specify the proxy directly instead of using proxy settings through environment variables.
#19 #22
I checked that my openai proxy, when printing it out, was none. I put in the code but the issue remains