Skip to content

support dashscope https://bailian.console.aliyun.com/ #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from api.openrouter_client import OpenRouterClient
from api.bedrock_client import BedrockClient
from api.azureai_client import AzureAIClient
from api.dashscope_client import DashscopeClient
from adalflow import GoogleGenAIClient, OllamaClient

# Get API keys from environment variables
Expand Down Expand Up @@ -53,7 +54,8 @@
"OpenRouterClient": OpenRouterClient,
"OllamaClient": OllamaClient,
"BedrockClient": BedrockClient,
"AzureAIClient": AzureAIClient
"AzureAIClient": AzureAIClient,
"DashscopeClient": DashscopeClient
}

def replace_env_placeholders(config: Union[Dict[str, Any], List[Any], str, Any]) -> Union[Dict[str, Any], List[Any], str, Any]:
Expand Down Expand Up @@ -121,14 +123,15 @@ def load_generator_config():
if provider_config.get("client_class") in CLIENT_CLASSES:
provider_config["model_client"] = CLIENT_CLASSES[provider_config["client_class"]]
# Fall back to default mapping based on provider_id
elif provider_id in ["google", "openai", "openrouter", "ollama", "bedrock", "azure"]:
elif provider_id in ["google", "openai", "openrouter", "ollama", "bedrock", "azure", "dashscope"]:
default_map = {
"google": GoogleGenAIClient,
"openai": OpenAIClient,
"openrouter": OpenRouterClient,
"ollama": OllamaClient,
"bedrock": BedrockClient,
"azure": AzureAIClient
"azure": AzureAIClient,
"dashscope": DashscopeClient
}
provider_config["model_client"] = default_map[provider_id]
else:
Expand Down
18 changes: 18 additions & 0 deletions api/config/generator.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
{
"default_provider": "google",
"providers": {
"dashscope": {
"default_model": "qwen-plus",
"supportsCustomModel": true,
"models": {
"qwen-plus": {
"temperature": 0.7,
"top_p": 0.8
},
"qwen-turbo": {
"temperature": 0.7,
"top_p": 0.8
},
"deepseek-r1": {
"temperature": 0.7,
"top_p": 0.8
}
}
},
"google": {
"default_model": "gemini-2.0-flash",
"supportsCustomModel": true,
Expand Down
Loading