mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-24 16:32:29 +00:00
70 lines
2.7 KiB
TypeScript
70 lines
2.7 KiB
TypeScript
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
import {
|
|
applyModelStudioConfig,
|
|
applyModelStudioConfigCn,
|
|
MODELSTUDIO_DEFAULT_MODEL_REF,
|
|
} from "./onboard.js";
|
|
import { buildModelStudioProvider } from "./provider-catalog.js";
|
|
|
|
const PROVIDER_ID = "modelstudio";
|
|
|
|
export default defineSingleProviderPluginEntry({
|
|
id: PROVIDER_ID,
|
|
name: "Model Studio Provider",
|
|
description: "Bundled Model Studio provider plugin",
|
|
provider: {
|
|
label: "Model Studio",
|
|
docsPath: "/providers/models",
|
|
auth: [
|
|
{
|
|
methodId: "api-key-cn",
|
|
label: "Coding Plan API Key for China (subscription)",
|
|
hint: "Endpoint: coding.dashscope.aliyuncs.com",
|
|
optionKey: "modelstudioApiKeyCn",
|
|
flagName: "--modelstudio-api-key-cn",
|
|
envVar: "MODELSTUDIO_API_KEY",
|
|
promptMessage: "Enter Alibaba Cloud Model Studio Coding Plan API key (China)",
|
|
defaultModel: MODELSTUDIO_DEFAULT_MODEL_REF,
|
|
applyConfig: (cfg) => applyModelStudioConfigCn(cfg),
|
|
noteMessage: [
|
|
"Get your API key at: https://bailian.console.aliyun.com/",
|
|
"Endpoint: coding.dashscope.aliyuncs.com",
|
|
"Models: qwen3.5-plus, glm-4.7, kimi-k2.5, MiniMax-M2.5, etc.",
|
|
].join("\n"),
|
|
noteTitle: "Alibaba Cloud Model Studio Coding Plan (China)",
|
|
wizard: {
|
|
choiceHint: "Endpoint: coding.dashscope.aliyuncs.com",
|
|
groupLabel: "Alibaba Cloud Model Studio",
|
|
groupHint: "Coding Plan API key (CN / Global)",
|
|
},
|
|
},
|
|
{
|
|
methodId: "api-key",
|
|
label: "Coding Plan API Key for Global/Intl (subscription)",
|
|
hint: "Endpoint: coding-intl.dashscope.aliyuncs.com",
|
|
optionKey: "modelstudioApiKey",
|
|
flagName: "--modelstudio-api-key",
|
|
envVar: "MODELSTUDIO_API_KEY",
|
|
promptMessage: "Enter Alibaba Cloud Model Studio Coding Plan API key (Global/Intl)",
|
|
defaultModel: MODELSTUDIO_DEFAULT_MODEL_REF,
|
|
applyConfig: (cfg) => applyModelStudioConfig(cfg),
|
|
noteMessage: [
|
|
"Get your API key at: https://bailian.console.aliyun.com/",
|
|
"Endpoint: coding-intl.dashscope.aliyuncs.com",
|
|
"Models: qwen3.5-plus, glm-4.7, kimi-k2.5, MiniMax-M2.5, etc.",
|
|
].join("\n"),
|
|
noteTitle: "Alibaba Cloud Model Studio Coding Plan (Global/Intl)",
|
|
wizard: {
|
|
choiceHint: "Endpoint: coding-intl.dashscope.aliyuncs.com",
|
|
groupLabel: "Alibaba Cloud Model Studio",
|
|
groupHint: "Coding Plan API key (CN / Global)",
|
|
},
|
|
},
|
|
],
|
|
catalog: {
|
|
buildProvider: buildModelStudioProvider,
|
|
allowExplicitBaseUrl: true,
|
|
},
|
|
},
|
|
});
|