fix(alibaba): use standard DashScope international endpoint (#4133)
* fix(alibaba): use standard DashScope international endpoint The Alibaba Cloud provider was hardcoded to the coding-intl endpoint (https://coding-intl.dashscope.aliyuncs.com/v1) which only accepts Alibaba Coding Plan API keys. Standard DashScope API keys fail with invalid_api_key error against this endpoint. Changed to the international compatible-mode endpoint (https://dashscope-intl.aliyuncs.com/compatible-mode/v1) which works with standard DashScope keys. Users with Coding Plan keys or China-region keys can still override via DASHSCOPE_BASE_URL or config.yaml base_url. Fixes #3912 * fix: update test to match new DashScope default endpoint --------- Co-authored-by: kagura-agent <kagura.chen28@gmail.com>
This commit is contained in:
@@ -160,7 +160,7 @@ PROVIDER_REGISTRY: Dict[str, ProviderConfig] = {
|
|||||||
id="alibaba",
|
id="alibaba",
|
||||||
name="Alibaba Cloud (DashScope)",
|
name="Alibaba Cloud (DashScope)",
|
||||||
auth_type="api_key",
|
auth_type="api_key",
|
||||||
inference_base_url="https://coding-intl.dashscope.aliyuncs.com/v1",
|
inference_base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
||||||
api_key_env_vars=("DASHSCOPE_API_KEY",),
|
api_key_env_vars=("DASHSCOPE_API_KEY",),
|
||||||
base_url_env_var="DASHSCOPE_BASE_URL",
|
base_url_env_var="DASHSCOPE_BASE_URL",
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ def test_alibaba_default_coding_intl_endpoint_uses_chat_completions(monkeypatch)
|
|||||||
|
|
||||||
assert resolved["provider"] == "alibaba"
|
assert resolved["provider"] == "alibaba"
|
||||||
assert resolved["api_mode"] == "chat_completions"
|
assert resolved["api_mode"] == "chat_completions"
|
||||||
assert resolved["base_url"] == "https://coding-intl.dashscope.aliyuncs.com/v1"
|
assert resolved["base_url"] == "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
|
||||||
|
|
||||||
|
|
||||||
def test_alibaba_anthropic_endpoint_override_uses_anthropic_messages(monkeypatch):
|
def test_alibaba_anthropic_endpoint_override_uses_anthropic_messages(monkeypatch):
|
||||||
|
|||||||
Reference in New Issue
Block a user