feat(providers): add Alibaba (Qwen via DashScope) declarative provider (#9443)
Signed-off-by: Jeremy Dawes <jeremy@jezweb.net>
This commit is contained in:
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"name": "alibaba",
|
||||||
|
"engine": "openai",
|
||||||
|
"display_name": "Alibaba (Qwen)",
|
||||||
|
"description": "Alibaba Qwen models via DashScope's OpenAI-compatible API.",
|
||||||
|
"api_key_env": "DASHSCOPE_API_KEY",
|
||||||
|
"base_url": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
||||||
|
"catalog_provider_id": "alibaba",
|
||||||
|
"dynamic_models": true,
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "qwen3.7-max",
|
||||||
|
"context_limit": 262144
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3.7-max-preview",
|
||||||
|
"context_limit": 262144
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3.6-max-preview",
|
||||||
|
"context_limit": 262144
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3.6-plus",
|
||||||
|
"context_limit": 1000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3-max",
|
||||||
|
"context_limit": 262144
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen-plus",
|
||||||
|
"context_limit": 1000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen-turbo",
|
||||||
|
"context_limit": 1000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen-flash",
|
||||||
|
"context_limit": 1000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3-coder-plus",
|
||||||
|
"context_limit": 1048576
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "qwen3-coder-flash",
|
||||||
|
"context_limit": 1000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preserves_thinking": true,
|
||||||
|
"supports_streaming": true,
|
||||||
|
"model_doc_link": "https://www.alibabacloud.com/help/en/model-studio/models",
|
||||||
|
"setup_steps": [
|
||||||
|
"Sign in to https://modelstudio.console.alibabacloud.com (international) or https://bailian.console.aliyun.com (China)",
|
||||||
|
"Open API Keys in the left sidebar and create a new key",
|
||||||
|
"Copy the key and paste it above"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -314,6 +314,33 @@ mod tests {
|
|||||||
assert!(api_key.primary, "NEARAI_API_KEY should be primary");
|
assert!(api_key.primary, "NEARAI_API_KEY should be primary");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_alibaba_declarative_provider_registry_wiring() {
|
||||||
|
let alibaba = get_from_registry("alibaba")
|
||||||
|
.await
|
||||||
|
.expect("alibaba provider should be registered");
|
||||||
|
let meta = alibaba.metadata();
|
||||||
|
|
||||||
|
assert_eq!(alibaba.provider_type(), ProviderType::Declarative);
|
||||||
|
assert!(alibaba.supports_inventory_refresh());
|
||||||
|
assert_eq!(meta.display_name, "Alibaba (Qwen)");
|
||||||
|
assert_eq!(meta.default_model, "qwen3.7-max");
|
||||||
|
assert_eq!(
|
||||||
|
meta.model_doc_link,
|
||||||
|
"https://www.alibabacloud.com/help/en/model-studio/models"
|
||||||
|
);
|
||||||
|
assert!(!meta.setup_steps.is_empty());
|
||||||
|
|
||||||
|
let api_key = meta
|
||||||
|
.config_keys
|
||||||
|
.iter()
|
||||||
|
.find(|k| k.name == "DASHSCOPE_API_KEY")
|
||||||
|
.expect("DASHSCOPE_API_KEY config key should exist");
|
||||||
|
assert!(api_key.required, "DASHSCOPE_API_KEY should be required");
|
||||||
|
assert!(api_key.secret, "DASHSCOPE_API_KEY should be secret");
|
||||||
|
assert!(api_key.primary, "DASHSCOPE_API_KEY should be primary");
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_openai_compatible_providers_config_keys() {
|
async fn test_openai_compatible_providers_config_keys() {
|
||||||
let providers_list = providers().await;
|
let providers_list = providers().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user