openai-python
openai-python copied to clipboard
Issue with updating the openai.proxy field
Describe the bug
I'm experiencing an issue with updating the openai.proxy . When I make a request to OpenAI using this library, I set the openai.proxy field to a proxy value. However, if the request fails and I change the openai.proxy field to a different value, subsequent requests continue to use the old proxy value instead of the updated one.
To Reproduce
- Create an array of two elements, where the first element is an invalid proxy and the second element is a valid one.
- Run a loop over this array, updating the value of openai.proxy each time, and attempt to make requests to the OpenAI API.
- Requests will fail on all proxies, as the value of openai.proxy does not seem to change. Additionally, if a valid proxy is placed first, all requests will succeed, as if all proxies were valid.
Code snippets
No response
OS
ubuntu
Python version
python:3.8.3
Library version
openai==0.27.2