mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
refactor: rename provider to alicode (Aliyun Coding)
Rename alicloud to alicode to clearly indicate Aliyun's Coding Plan service. - Provider ID: alicode (short for Aliyun Coding) - Model format: alicode/qwen3.5-plus - Simplified mapping - no more bidirectional aliases Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(test:*)",
|
||||
"Bash(PORT=20127 NEXT_PUBLIC_BASE_URL=http://localhost:20127 npm run dev:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -65,3 +65,4 @@ package-lock.json
|
||||
#Ignore vscode AI rules
|
||||
.github/instructions/codacy.instructions.md
|
||||
README1.md
|
||||
.claude/
|
||||
|
||||
@@ -175,7 +175,7 @@ export const PROVIDERS = {
|
||||
},
|
||||
clientVersion: "1.1.3"
|
||||
},
|
||||
alicloud: {
|
||||
alicode: {
|
||||
baseUrl: "https://coding.dashscope.aliyuncs.com/v1/chat/completions",
|
||||
format: "openai",
|
||||
headers: {}
|
||||
|
||||
@@ -160,7 +160,7 @@ export const PROVIDER_MODELS = {
|
||||
"minimax-cn": [
|
||||
{ id: "MiniMax-M2.1", name: "MiniMax M2.1" },
|
||||
],
|
||||
alicloud: [
|
||||
alicode: [
|
||||
{ id: "qwen3.5-plus", name: "Qwen3.5 Plus" },
|
||||
{ id: "kimi-k2.5", name: "Kimi K2.5" },
|
||||
{ id: "glm-5", name: "GLM 5" },
|
||||
@@ -223,7 +223,7 @@ export const PROVIDER_ID_TO_ALIAS = {
|
||||
kimi: "kimi",
|
||||
minimax: "minimax",
|
||||
"minimax-cn": "minimax-cn",
|
||||
alicloud: "alicloud",
|
||||
alicode: "alicode",
|
||||
};
|
||||
|
||||
export function getModelsByProviderId(providerId) {
|
||||
|
||||
@@ -72,7 +72,7 @@ const PROVIDER_MODELS_CONFIG = {
|
||||
authHeader: "x-api-key",
|
||||
parseResponse: (data) => data.data || []
|
||||
},
|
||||
alicloud: {
|
||||
alicode: {
|
||||
url: "https://coding.dashscope.aliyuncs.com/v1/models",
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
||||
@@ -464,7 +464,7 @@ async function testApiKeyConnection(connection) {
|
||||
return { valid, error: valid ? null : "Invalid API key" };
|
||||
}
|
||||
|
||||
case "alicloud": {
|
||||
case "alicode": {
|
||||
// 阿里云百炼 Coding Plan uses OpenAI-compatible API
|
||||
const res = await fetch("https://coding.dashscope.aliyuncs.com/v1/chat/completions", {
|
||||
method: "POST",
|
||||
|
||||
@@ -103,19 +103,19 @@ export async function POST(request) {
|
||||
case "kimi":
|
||||
case "minimax":
|
||||
case "minimax-cn":
|
||||
case "alicloud": {
|
||||
case "alicode": {
|
||||
const claudeBaseUrls = {
|
||||
glm: "https://api.z.ai/api/anthropic/v1/messages",
|
||||
"glm-cn": "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",
|
||||
kimi: "https://api.kimi.com/coding/v1/messages",
|
||||
minimax: "https://api.minimax.io/anthropic/v1/messages",
|
||||
"minimax-cn": "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
alicloud: "https://coding.dashscope.aliyuncs.com/v1/chat/completions",
|
||||
alicode: "https://coding.dashscope.aliyuncs.com/v1/chat/completions",
|
||||
};
|
||||
|
||||
// glm-cn and alicloud use OpenAI format
|
||||
if (provider === "glm-cn" || provider === "alicloud") {
|
||||
const testModel = provider === "alicloud" ? "qwen3.5-plus" : "glm-4.7";
|
||||
// glm-cn and alicode use OpenAI format
|
||||
if (provider === "glm-cn" || provider === "alicode") {
|
||||
const testModel = provider === "alicode" ? "qwen3.5-plus" : "glm-4.7";
|
||||
const glmCnRes = await fetch(claudeBaseUrls[provider], {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
||||
@@ -37,7 +37,7 @@ export const PROVIDER_ENDPOINTS = {
|
||||
kimi: "https://api.kimi.com/coding/v1/messages",
|
||||
minimax: "https://api.minimax.io/anthropic/v1/messages",
|
||||
"minimax-cn": "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
alicloud: "https://coding.dashscope.aliyuncs.com/v1/chat/completions",
|
||||
alicode: "https://coding.dashscope.aliyuncs.com/v1/chat/completions",
|
||||
openai: "https://api.openai.com/v1/chat/completions",
|
||||
anthropic: "https://api.anthropic.com/v1/messages",
|
||||
gemini: "https://generativelanguage.googleapis.com/v1beta/models",
|
||||
|
||||
@@ -24,7 +24,7 @@ export const APIKEY_PROVIDERS = {
|
||||
kimi: { id: "kimi", alias: "kimi", name: "Kimi Coding", icon: "psychology", color: "#1E3A8A", textIcon: "KM" },
|
||||
minimax: { id: "minimax", alias: "minimax", name: "Minimax Coding", icon: "memory", color: "#7C3AED", textIcon: "MM" },
|
||||
"minimax-cn": { id: "minimax-cn", alias: "minimax-cn", name: "Minimax (China)", icon: "memory", color: "#DC2626", textIcon: "MC" },
|
||||
alicloud: { id: "alicloud", alias: "alicloud", name: "阿里云百炼 Coding Plan", icon: "cloud", color: "#FF6A00", textIcon: "ALi" },
|
||||
alicode: { id: "alicode", alias: "alicode", name: "阿里云百炼 Coding Plan", icon: "cloud", color: "#FF6A00", textIcon: "ALi" },
|
||||
openai: { id: "openai", alias: "openai", name: "OpenAI", icon: "auto_awesome", color: "#10A37F", textIcon: "OA" },
|
||||
anthropic: { id: "anthropic", alias: "anthropic", name: "Anthropic", icon: "smart_toy", color: "#D97757", textIcon: "AN" },
|
||||
gemini: { id: "gemini", alias: "gemini", name: "Gemini", icon: "diamond", color: "#4285F4", textIcon: "GE" },
|
||||
|
||||
Reference in New Issue
Block a user