Skip to content

The agent engineering platform.

OPENAI_PROXY not working (#14833)

Timothy Jic5a685b10b61
diff --git a/docs/docs/integrations/llms/openai.ipynb b/docs/docs/integrations/llms/openai.ipynb
index fcc4940ce6..3f3bbed3b6 100644
--- a/docs/docs/integrations/llms/openai.ipynb
+++ b/docs/docs/integrations/llms/openai.ipynb
@@ -153,7 +153,7 @@
"id": "58a9ddb1",
"metadata": {},
"source": [
- "If you are behind an explicit proxy, you can use the OPENAI_PROXY environment variable to pass through"
+ "If you are behind an explicit proxy, you can specify the http_client to pass through"
]
},
{
@@ -163,7 +163,11 @@
"metadata": {},
"outputs": [],
"source": [
- "os.environ[\"OPENAI_PROXY\"] = \"http://proxy.yourcompany.com:8080\""
+ "pip install httpx\n",
+ "\n",
+ "import httpx\n",
+ "\n",
+ "openai = OpenAI(model_name=\"gpt-3.5-turbo-instruct\", http_client=httpx.Client(proxies=\"http://proxy.yourcompany.com:8080\"))"
]
}
],