langchain +gpt 报错 SSLError

解决版本2种

一加入下面代码:
https://www.zhihu.com/question/588395420

import os
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"

二降低urllib3版本

urllib3== 1.25.11

错误如下

Retrying langchain.embeddings.openai.embed_with_retry.<locals>._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/embeddings (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))).

你可能感兴趣的:(langchain,gpt)