Skip to content

Commit c5a685b

Browse files
authored
OPENAI_PROXY not working (#14833)
Replace this entire comment with: - **Description:** OPENAI_PROXY is not working for openai==1.3.9, The `proxies` argument is deprecated. The `http_client` argument should be passed instead, - **Issue:** OPENAI_PROXY is not working, - **Dependencies:** None, - **Tag maintainer:** @hwchase17 , - **Twitter handle:** timothy66666
1 parent d82a382 commit c5a685b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/docs/integrations/llms/openai.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"id": "58a9ddb1",
154154
"metadata": {},
155155
"source": [
156-
"If you are behind an explicit proxy, you can use the OPENAI_PROXY environment variable to pass through"
156+
"If you are behind an explicit proxy, you can specify the http_client to pass through"
157157
]
158158
},
159159
{
@@ -163,7 +163,11 @@
163163
"metadata": {},
164164
"outputs": [],
165165
"source": [
166-
"os.environ[\"OPENAI_PROXY\"] = \"http://proxy.yourcompany.com:8080\""
166+
"pip install httpx\n",
167+
"\n",
168+
"import httpx\n",
169+
"\n",
170+
"openai = OpenAI(model_name=\"gpt-3.5-turbo-instruct\", http_client=httpx.Client(proxies=\"http://proxy.yourcompany.com:8080\"))"
167171
]
168172
}
169173
],

0 commit comments

Comments
 (0)