fix(doctor): retry DashScope China endpoint

This commit is contained in:
LeonSGP43 2026-05-03 19:36:48 +08:00 committed by Teknium
parent 14f38822fa
commit 5ead126709
2 changed files with 64 additions and 0 deletions

View file

@ -1225,6 +1225,16 @@ def run_doctor(args):
headers=_headers,
timeout=10,
)
if (
_pname == "Alibaba/DashScope"
and not _base
and _resp.status_code == 401
):
_resp = httpx.get(
"https://dashscope.aliyuncs.com/compatible-mode/v1/models",
headers=_headers,
timeout=10,
)
if _resp.status_code == 200:
print(f"\r {color('', Colors.GREEN)} {_label} ")
elif _resp.status_code == 401: