From c5a685b10b615cb0d863aba47addda9135eba1d3 Mon Sep 17 00:00:00 2001 From: Timothy Ji Date: Tue, 19 Dec 2023 10:06:14 +0800 Subject: [PATCH] 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 --- docs/docs/integrations/llms/openai.ipynb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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\"))" ] } ],