mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-09 08:45:44 +08:00
修复代理为空的问题
(cherry picked from commit a655608d01a1ff44c8f6a3e0ab6ed07cb4e217c4)
This commit is contained in:
parent
fc6a3b07ed
commit
48338207bd
@ -514,10 +514,11 @@ def get_httpx_client(
|
||||
default_proxies.update({host: None})
|
||||
|
||||
# get proxies from system envionrent
|
||||
# proxy not str empty string, None, False, 0, [] or {}
|
||||
default_proxies.update({
|
||||
"http://": os.environ.get("http_proxy"),
|
||||
"https://": os.environ.get("https_proxy"),
|
||||
"all://": os.environ.get("all_proxy"),
|
||||
"http://": os.environ.get("http_proxy") if len(os.environ.get("http_proxy").strip()) > 0 else None,
|
||||
"https://": os.environ.get("https_proxy") if len(os.environ.get("https_proxy").strip()) > 0 else None,
|
||||
"all://": os.environ.get("all_proxy") if len(os.environ.get("all_proxy").strip()) > 0 else None,
|
||||
})
|
||||
for host in os.environ.get("no_proxy", "").split(","):
|
||||
if host := host.strip():
|
||||
@ -532,6 +533,7 @@ def get_httpx_client(
|
||||
|
||||
# construct Client
|
||||
kwargs.update(timeout=timeout, proxies=default_proxies)
|
||||
print(kwargs)
|
||||
if use_async:
|
||||
return httpx.AsyncClient(**kwargs)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user