Skip to content

openai.proxy settings should override env var HTTPS_PROXY #339

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

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

bojieli
Copy link
Contributor

@bojieli bojieli commented Mar 24, 2023

By default, the Requests library use the proxy settings from the environment variable HTTPS_PROXY. It has higher priority than the "proxies" setting in the session, which may lead to confusing behaviors if both environment variables and the "openai.proxy" config are set. This patch explicitly informs the Requests library to use the "openai.proxy" config when generating requests.

… defaults

By default, the Requests library use the proxy settings from the environment variable HTTPS_PROXY.
It has higher priority than the "proxies" setting in the session, which may lead to confusing behaviors
if both environment variables and the "openai.proxy" config are set.
This patch explicitly informs the Requests library to use the "openai.proxy" config.
Copy link
Collaborator

@hallacy hallacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thank you!

@hallacy hallacy merged commit 47ce295 into openai:main Mar 30, 2023
davedittrich pushed a commit to davedittrich/openai-python that referenced this pull request Nov 14, 2023
… defaults (openai#339)

By default, the Requests library use the proxy settings from the environment variable HTTPS_PROXY.
It has higher priority than the "proxies" setting in the session, which may lead to confusing behaviors
if both environment variables and the "openai.proxy" config are set.
This patch explicitly informs the Requests library to use the "openai.proxy" config.
cgayapr pushed a commit to cgayapr/openai-python that referenced this pull request Dec 14, 2024
… defaults (openai#339)

By default, the Requests library use the proxy settings from the environment variable HTTPS_PROXY.
It has higher priority than the "proxies" setting in the session, which may lead to confusing behaviors
if both environment variables and the "openai.proxy" config are set.
This patch explicitly informs the Requests library to use the "openai.proxy" config.
stainless-app bot pushed a commit that referenced this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants