@openclaw/qwen-provider 2026.9.1-beta.1 → 2026.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/index.js +21 -10
- package/dist/media-understanding-provider.js +4 -4
- package/dist/models-DIZ7f-Lx.js +499 -0
- package/dist/models.js +2 -260
- package/dist/onboard.js +1 -1
- package/dist/provider-catalog.js +1 -1
- package/dist/stream.js +34 -20
- package/dist/video-generation-provider.js +1 -1
- package/openclaw.plugin.json +263 -9
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as applyModelStudioNativeStreamingUsageCompat, C as QWEN_TOKEN_PLAN_CN_BASE_URL, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, E as QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, F as buildQwenModelCatalogForBaseUrl, H as isQwenStandardOnlyModelId, I as buildQwenModelDefinition, L as isNativeModelStudioBaseUrl, M as buildModelStudioDefaultModelDefinition, N as buildModelStudioModelDefinition, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, P as buildQwenDefaultModelDefinition, R as isNativeQwenBaseUrl, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, V as isQwenCodingPlanBaseUrl, _ as QWEN_DEFAULT_MODEL_ID, a as MODELSTUDIO_DEFAULT_MODEL_REF, b as QWEN_MODEL_CATALOG, c as MODELSTUDIO_STANDARD_CN_BASE_URL, d as QWEN_36_PLUS_MODEL_ID, f as QWEN_37_MAX_MODEL_ID, g as QWEN_DEFAULT_COST, h as QWEN_CN_BASE_URL, i as MODELSTUDIO_DEFAULT_MODEL_ID, j as applyQwenNativeStreamingUsageCompat, k as QWEN_TOKEN_PLAN_PROVIDER_ID, l as MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, m as QWEN_BASE_URL, n as MODELSTUDIO_CN_BASE_URL, o as MODELSTUDIO_GLOBAL_BASE_URL, p as QWEN_37_PLUS_MODEL_ID, q as resolveQwenTokenPlanBaseUrl, r as MODELSTUDIO_DEFAULT_COST, s as MODELSTUDIO_MODEL_CATALOG, t as MODELSTUDIO_BASE_URL, u as QWEN_36_FLASH_MODEL_ID, v as QWEN_DEFAULT_MODEL_REF, w as QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, x as QWEN_STANDARD_CN_BASE_URL, y as QWEN_GLOBAL_BASE_URL, z as isQwen36PlusSupportedBaseUrl } from "./models-DIZ7f-Lx.js";
|
|
2
2
|
import { buildModelStudioProvider, buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
|
|
3
3
|
import { createQwenThinkingWrapper, wrapQwenProviderStream } from "./stream.js";
|
|
4
4
|
export { MODELSTUDIO_BASE_URL, MODELSTUDIO_CN_BASE_URL, MODELSTUDIO_DEFAULT_COST, MODELSTUDIO_DEFAULT_MODEL_ID, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL, MODELSTUDIO_MODEL_CATALOG, MODELSTUDIO_STANDARD_CN_BASE_URL, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, QWEN_36_FLASH_MODEL_ID, QWEN_36_PLUS_MODEL_ID, QWEN_37_MAX_MODEL_ID, QWEN_37_PLUS_MODEL_ID, QWEN_BASE_URL, QWEN_CN_BASE_URL, QWEN_DEFAULT_COST, QWEN_DEFAULT_MODEL_ID, QWEN_DEFAULT_MODEL_REF, QWEN_GLOBAL_BASE_URL, QWEN_MODEL_CATALOG, QWEN_STANDARD_CN_BASE_URL, QWEN_STANDARD_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_CN_BASE_URL, QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, QWEN_TOKEN_PLAN_MODEL_CATALOG, QWEN_TOKEN_PLAN_PROVIDER_ID, applyModelStudioNativeStreamingUsageCompat, applyQwenNativeStreamingUsageCompat, buildModelStudioDefaultModelDefinition, buildModelStudioModelDefinition, buildModelStudioProvider, buildQwenDefaultModelDefinition, buildQwenModelCatalogForBaseUrl, buildQwenModelDefinition, buildQwenProvider, buildQwenTokenPlanProvider, createQwenThinkingWrapper, isNativeModelStudioBaseUrl, isNativeQwenBaseUrl, isQwen36PlusSupportedBaseUrl, isQwenCodingPlanBaseUrl, isQwenStandardOnlyModelId, resolveQwenTokenPlanBaseUrl, wrapQwenProviderStream };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
|
|
3
|
-
import { wrapQwenProviderStream } from "./stream.js";
|
|
4
|
-
import "./api.js";
|
|
1
|
+
import { B as isQwen38ModelId, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, H as isQwenStandardOnlyModelId, J as supportsQwenTokenPlanGlmMaxThinking, K as isQwenTokenPlanThinkingOnlyModelId, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, U as isQwenTokenPlanDeepSeekV4ModelId, V as isQwenCodingPlanBaseUrl, W as isQwenTokenPlanGlmModelId, k as QWEN_TOKEN_PLAN_PROVIDER_ID, v as QWEN_DEFAULT_MODEL_REF } from "./models-DIZ7f-Lx.js";
|
|
5
2
|
import { buildQwenMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
3
|
+
import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
|
|
6
4
|
import { applyQwenConfig, applyQwenConfigCn, applyQwenStandardConfig, applyQwenStandardConfigCn, applyQwenTokenPlanConfig } from "./onboard.js";
|
|
5
|
+
import { wrapQwenProviderStream } from "./stream.js";
|
|
7
6
|
import { qwenVideoGenerationProvider } from "./video-generation-provider.js";
|
|
8
7
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
9
8
|
import { buildOpenAICompatibleLiveModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
@@ -67,6 +66,8 @@ function createQwenTokenPlanAuthMethod(region) {
|
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
function resolveQwenTokenPlanThinkingProfile(modelId) {
|
|
69
|
+
const qwenProfile = resolveQwenThinkingProfile(modelId);
|
|
70
|
+
if (qwenProfile) return qwenProfile;
|
|
70
71
|
if (isQwenTokenPlanThinkingOnlyModelId(modelId)) return {
|
|
71
72
|
levels: [{
|
|
72
73
|
id: "low",
|
|
@@ -84,6 +85,17 @@ function resolveQwenTokenPlanThinkingProfile(modelId) {
|
|
|
84
85
|
defaultLevel: "high"
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
function resolveQwenThinkingProfile(modelId) {
|
|
89
|
+
return isQwen38ModelId(modelId) ? {
|
|
90
|
+
levels: [
|
|
91
|
+
"off",
|
|
92
|
+
"low",
|
|
93
|
+
"medium",
|
|
94
|
+
"xhigh"
|
|
95
|
+
].map((id) => ({ id })),
|
|
96
|
+
defaultLevel: "xhigh"
|
|
97
|
+
} : void 0;
|
|
98
|
+
}
|
|
87
99
|
var qwen_default = defineSingleProviderPluginEntry({
|
|
88
100
|
id: PROVIDER_ID,
|
|
89
101
|
name: "Qwen Provider",
|
|
@@ -107,7 +119,7 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
107
119
|
"Manage API keys: https://home.qwencloud.com/api-keys",
|
|
108
120
|
"Docs: https://docs.qwencloud.com/",
|
|
109
121
|
"Endpoint: dashscope.aliyuncs.com/compatible-mode/v1",
|
|
110
|
-
"Models: qwen3.
|
|
122
|
+
"Models: qwen3.8-max, qwen3.8-flash, qwen3.7-plus, and other discovered models."
|
|
111
123
|
].join("\n"),
|
|
112
124
|
noteTitle: "Qwen Cloud Standard (China)",
|
|
113
125
|
wizard: {
|
|
@@ -130,7 +142,7 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
130
142
|
"Manage API keys: https://home.qwencloud.com/api-keys",
|
|
131
143
|
"Docs: https://docs.qwencloud.com/",
|
|
132
144
|
"Endpoint: dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
133
|
-
"Models: qwen3.
|
|
145
|
+
"Models: qwen3.8-max, qwen3.8-flash, qwen3.7-plus, and other discovered models."
|
|
134
146
|
].join("\n"),
|
|
135
147
|
noteTitle: "Qwen Cloud Standard (Global/Intl)",
|
|
136
148
|
wizard: {
|
|
@@ -200,8 +212,8 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
200
212
|
},
|
|
201
213
|
staticRun: async () => ({ provider: buildQwenProvider() })
|
|
202
214
|
},
|
|
203
|
-
applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
|
|
204
215
|
wrapStreamFn: wrapQwenProviderStream,
|
|
216
|
+
resolveThinkingProfile: ({ modelId }) => resolveQwenThinkingProfile(modelId),
|
|
205
217
|
normalizeConfig: ({ providerConfig }) => {
|
|
206
218
|
if (!isQwenCodingPlanBaseUrl(providerConfig.baseUrl)) return;
|
|
207
219
|
const models = providerConfig.models?.filter((model) => !isQwenStandardOnlyModelId(model.id));
|
|
@@ -223,9 +235,10 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
223
235
|
run: async (ctx) => {
|
|
224
236
|
const auth = ctx.resolveProviderApiKey(QWEN_TOKEN_PLAN_PROVIDER_ID);
|
|
225
237
|
if (!auth.apiKey) return null;
|
|
238
|
+
const baseUrl = resolveConfiguredQwenTokenPlanBaseUrl(ctx.config);
|
|
226
239
|
return { provider: await buildOpenAICompatibleLiveModelProviderConfig({
|
|
227
240
|
providerId: QWEN_TOKEN_PLAN_PROVIDER_ID,
|
|
228
|
-
providerConfig: buildQwenTokenPlanProvider({ baseUrl
|
|
241
|
+
providerConfig: buildQwenTokenPlanProvider({ baseUrl }),
|
|
229
242
|
apiKey: auth.apiKey,
|
|
230
243
|
discoveryApiKey: auth.discoveryApiKey
|
|
231
244
|
}) };
|
|
@@ -235,7 +248,6 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
235
248
|
order: "simple",
|
|
236
249
|
run: async () => ({ provider: buildQwenTokenPlanProvider() })
|
|
237
250
|
},
|
|
238
|
-
applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
|
|
239
251
|
wrapStreamFn: wrapQwenProviderStream,
|
|
240
252
|
resolveThinkingProfile: ({ modelId }) => resolveQwenTokenPlanThinkingProfile(modelId)
|
|
241
253
|
});
|
|
@@ -244,7 +256,6 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
244
256
|
label: "Alibaba Token Plan (legacy custom config)",
|
|
245
257
|
docsPath: "/providers/qwen",
|
|
246
258
|
auth: [],
|
|
247
|
-
applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
|
|
248
259
|
wrapStreamFn: wrapQwenProviderStream
|
|
249
260
|
});
|
|
250
261
|
api.registerMediaUnderstandingProvider(buildQwenMediaUnderstandingProvider());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QWEN_STANDARD_GLOBAL_BASE_URL } from "./models.js";
|
|
2
|
-
import {
|
|
1
|
+
import { S as QWEN_STANDARD_GLOBAL_BASE_URL } from "./models-DIZ7f-Lx.js";
|
|
2
|
+
import { describeOpenAiCompatibleVideo } from "openclaw/plugin-sdk/media-understanding";
|
|
3
3
|
//#region extensions/qwen/media-understanding-provider.ts
|
|
4
4
|
const DEFAULT_QWEN_MEDIA_MODEL = "qwen3.6-plus";
|
|
5
5
|
const DEFAULT_QWEN_VIDEO_PROMPT = "Describe the video in detail.";
|
|
@@ -22,8 +22,8 @@ function buildQwenMediaUnderstandingProvider() {
|
|
|
22
22
|
video: DEFAULT_QWEN_MEDIA_MODEL
|
|
23
23
|
},
|
|
24
24
|
autoPriority: { video: 15 },
|
|
25
|
-
describeImage:
|
|
26
|
-
describeImages:
|
|
25
|
+
describeImage: void 0,
|
|
26
|
+
describeImages: void 0,
|
|
27
27
|
describeVideo: describeQwenVideo
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { applyProviderNativeStreamingUsageCompat, buildManifestModelProviderConfig, supportsNativeStreamingUsageCompat } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
//#region extensions/qwen/openclaw.plugin.json
|
|
3
|
+
var modelCatalog = {
|
|
4
|
+
"modelsDev": {
|
|
5
|
+
"qwen": "alibaba-coding-plan",
|
|
6
|
+
"qwen-token-plan": "alibaba-token-plan"
|
|
7
|
+
},
|
|
8
|
+
"suppressions": [
|
|
9
|
+
{
|
|
10
|
+
"provider": "qwen",
|
|
11
|
+
"model": "qwen3.8-max",
|
|
12
|
+
"reason": "qwen3.8-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
|
|
13
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"provider": "qwen",
|
|
17
|
+
"model": "qwen3.8-flash",
|
|
18
|
+
"reason": "qwen3.8-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
|
|
19
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"provider": "modelstudio",
|
|
23
|
+
"model": "qwen3.8-max",
|
|
24
|
+
"reason": "qwen3.8-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
|
|
25
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"provider": "modelstudio",
|
|
29
|
+
"model": "qwen3.8-flash",
|
|
30
|
+
"reason": "qwen3.8-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
|
|
31
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"provider": "qwen",
|
|
35
|
+
"model": "qwen3.6-flash",
|
|
36
|
+
"reason": "qwen3.6-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
|
|
37
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"provider": "qwen",
|
|
41
|
+
"model": "qwen3.7-max",
|
|
42
|
+
"reason": "qwen3.7-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
|
|
43
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"provider": "modelstudio",
|
|
47
|
+
"model": "qwen3.6-flash",
|
|
48
|
+
"reason": "qwen3.6-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
|
|
49
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"provider": "modelstudio",
|
|
53
|
+
"model": "qwen3.7-max",
|
|
54
|
+
"reason": "qwen3.7-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
|
|
55
|
+
"when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"providers": {
|
|
59
|
+
"qwen": {
|
|
60
|
+
"api": "openai-completions",
|
|
61
|
+
"models": [
|
|
62
|
+
{
|
|
63
|
+
"id": "qwen3.5-plus",
|
|
64
|
+
"reasoning": false,
|
|
65
|
+
"input": ["text", "image"],
|
|
66
|
+
"contextWindow": 1e6,
|
|
67
|
+
"maxTokens": 65536
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "qwen3.6-flash",
|
|
71
|
+
"reasoning": true,
|
|
72
|
+
"input": ["text", "image"],
|
|
73
|
+
"contextWindow": 1e6,
|
|
74
|
+
"maxTokens": 65536
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "qwen3.6-plus",
|
|
78
|
+
"reasoning": true,
|
|
79
|
+
"input": ["text", "image"],
|
|
80
|
+
"contextWindow": 1e6,
|
|
81
|
+
"maxTokens": 65536
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "qwen3.7-max",
|
|
85
|
+
"reasoning": true,
|
|
86
|
+
"input": ["text"],
|
|
87
|
+
"contextWindow": 1e6,
|
|
88
|
+
"maxTokens": 65536
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "qwen3.7-plus",
|
|
92
|
+
"reasoning": true,
|
|
93
|
+
"input": ["text", "image"],
|
|
94
|
+
"contextWindow": 1e6,
|
|
95
|
+
"maxTokens": 65536
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "qwen3.8-max",
|
|
99
|
+
"reasoning": true,
|
|
100
|
+
"input": ["text", "image"],
|
|
101
|
+
"contextWindow": 1e6,
|
|
102
|
+
"maxTokens": 131072,
|
|
103
|
+
"thinkingLevelMap": {
|
|
104
|
+
"minimal": "low",
|
|
105
|
+
"high": "xhigh",
|
|
106
|
+
"max": "xhigh"
|
|
107
|
+
},
|
|
108
|
+
"compat": {
|
|
109
|
+
"codeMode": "capable",
|
|
110
|
+
"supportsReasoningEffort": true,
|
|
111
|
+
"supportedReasoningEfforts": [
|
|
112
|
+
"low",
|
|
113
|
+
"medium",
|
|
114
|
+
"xhigh"
|
|
115
|
+
],
|
|
116
|
+
"reasoningEffortMap": {
|
|
117
|
+
"minimal": "low",
|
|
118
|
+
"high": "xhigh",
|
|
119
|
+
"max": "xhigh"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "qwen3.8-flash",
|
|
125
|
+
"reasoning": true,
|
|
126
|
+
"input": ["text", "image"],
|
|
127
|
+
"contextWindow": 1e6,
|
|
128
|
+
"maxTokens": 131072,
|
|
129
|
+
"thinkingLevelMap": {
|
|
130
|
+
"minimal": "low",
|
|
131
|
+
"high": "xhigh",
|
|
132
|
+
"max": "xhigh"
|
|
133
|
+
},
|
|
134
|
+
"compat": {
|
|
135
|
+
"supportsReasoningEffort": true,
|
|
136
|
+
"supportedReasoningEfforts": [
|
|
137
|
+
"low",
|
|
138
|
+
"medium",
|
|
139
|
+
"xhigh"
|
|
140
|
+
],
|
|
141
|
+
"reasoningEffortMap": {
|
|
142
|
+
"minimal": "low",
|
|
143
|
+
"high": "xhigh",
|
|
144
|
+
"max": "xhigh"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "qwen3-max-2026-01-23",
|
|
150
|
+
"reasoning": false,
|
|
151
|
+
"input": ["text"],
|
|
152
|
+
"contextWindow": 262144,
|
|
153
|
+
"maxTokens": 65536
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "qwen3-coder-next",
|
|
157
|
+
"reasoning": false,
|
|
158
|
+
"input": ["text"],
|
|
159
|
+
"contextWindow": 262144,
|
|
160
|
+
"maxTokens": 65536
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "qwen3-coder-plus",
|
|
164
|
+
"reasoning": false,
|
|
165
|
+
"input": ["text"],
|
|
166
|
+
"contextWindow": 1e6,
|
|
167
|
+
"maxTokens": 65536
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "MiniMax-M2.5",
|
|
171
|
+
"reasoning": true,
|
|
172
|
+
"input": ["text"],
|
|
173
|
+
"contextWindow": 1e6,
|
|
174
|
+
"maxTokens": 65536
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"id": "glm-5",
|
|
178
|
+
"reasoning": false,
|
|
179
|
+
"input": ["text"],
|
|
180
|
+
"contextWindow": 202752,
|
|
181
|
+
"maxTokens": 16384
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "glm-4.7",
|
|
185
|
+
"reasoning": false,
|
|
186
|
+
"input": ["text"],
|
|
187
|
+
"contextWindow": 202752,
|
|
188
|
+
"maxTokens": 16384
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "kimi-k2.5",
|
|
192
|
+
"reasoning": false,
|
|
193
|
+
"input": ["text", "image"],
|
|
194
|
+
"contextWindow": 262144,
|
|
195
|
+
"maxTokens": 32768
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"qwen-token-plan": {
|
|
200
|
+
"baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
|
|
201
|
+
"api": "openai-completions",
|
|
202
|
+
"models": [
|
|
203
|
+
{
|
|
204
|
+
"id": "qwen3.7-plus",
|
|
205
|
+
"name": "qwen3.7-plus",
|
|
206
|
+
"reasoning": true,
|
|
207
|
+
"input": ["text", "image"],
|
|
208
|
+
"cost": {
|
|
209
|
+
"input": 0,
|
|
210
|
+
"output": 0,
|
|
211
|
+
"cacheRead": 0,
|
|
212
|
+
"cacheWrite": 0
|
|
213
|
+
},
|
|
214
|
+
"contextWindow": 1e6,
|
|
215
|
+
"maxTokens": 65536
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "qwen3.8-max",
|
|
219
|
+
"name": "qwen3.8-max",
|
|
220
|
+
"reasoning": true,
|
|
221
|
+
"input": ["text", "image"],
|
|
222
|
+
"cost": {
|
|
223
|
+
"input": 0,
|
|
224
|
+
"output": 0,
|
|
225
|
+
"cacheRead": 0,
|
|
226
|
+
"cacheWrite": 0
|
|
227
|
+
},
|
|
228
|
+
"contextWindow": 1e6,
|
|
229
|
+
"maxTokens": 131072,
|
|
230
|
+
"thinkingLevelMap": {
|
|
231
|
+
"minimal": "low",
|
|
232
|
+
"high": "xhigh",
|
|
233
|
+
"max": "xhigh"
|
|
234
|
+
},
|
|
235
|
+
"compat": {
|
|
236
|
+
"codeMode": "capable",
|
|
237
|
+
"supportsReasoningEffort": true,
|
|
238
|
+
"supportedReasoningEfforts": [
|
|
239
|
+
"low",
|
|
240
|
+
"medium",
|
|
241
|
+
"xhigh"
|
|
242
|
+
],
|
|
243
|
+
"reasoningEffortMap": {
|
|
244
|
+
"minimal": "low",
|
|
245
|
+
"high": "xhigh",
|
|
246
|
+
"max": "xhigh"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"id": "qwen3.8-flash",
|
|
252
|
+
"name": "qwen3.8-flash",
|
|
253
|
+
"reasoning": true,
|
|
254
|
+
"input": ["text", "image"],
|
|
255
|
+
"cost": {
|
|
256
|
+
"input": 0,
|
|
257
|
+
"output": 0,
|
|
258
|
+
"cacheRead": 0,
|
|
259
|
+
"cacheWrite": 0
|
|
260
|
+
},
|
|
261
|
+
"contextWindow": 1e6,
|
|
262
|
+
"maxTokens": 131072,
|
|
263
|
+
"thinkingLevelMap": {
|
|
264
|
+
"minimal": "low",
|
|
265
|
+
"high": "xhigh",
|
|
266
|
+
"max": "xhigh"
|
|
267
|
+
},
|
|
268
|
+
"compat": {
|
|
269
|
+
"supportsReasoningEffort": true,
|
|
270
|
+
"supportedReasoningEfforts": [
|
|
271
|
+
"low",
|
|
272
|
+
"medium",
|
|
273
|
+
"xhigh"
|
|
274
|
+
],
|
|
275
|
+
"reasoningEffortMap": {
|
|
276
|
+
"minimal": "low",
|
|
277
|
+
"high": "xhigh",
|
|
278
|
+
"max": "xhigh"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"id": "qwen3.6-plus",
|
|
284
|
+
"name": "qwen3.6-plus",
|
|
285
|
+
"reasoning": true,
|
|
286
|
+
"input": ["text", "image"],
|
|
287
|
+
"cost": {
|
|
288
|
+
"input": 0,
|
|
289
|
+
"output": 0,
|
|
290
|
+
"cacheRead": 0,
|
|
291
|
+
"cacheWrite": 0
|
|
292
|
+
},
|
|
293
|
+
"contextWindow": 1e6,
|
|
294
|
+
"maxTokens": 65536
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"id": "qwen3-coder-next",
|
|
298
|
+
"name": "qwen3-coder-next",
|
|
299
|
+
"reasoning": true,
|
|
300
|
+
"input": ["text"],
|
|
301
|
+
"cost": {
|
|
302
|
+
"input": 0,
|
|
303
|
+
"output": 0,
|
|
304
|
+
"cacheRead": 0,
|
|
305
|
+
"cacheWrite": 0
|
|
306
|
+
},
|
|
307
|
+
"contextWindow": 262144,
|
|
308
|
+
"maxTokens": 65536,
|
|
309
|
+
"status": "deprecated",
|
|
310
|
+
"replacedBy": "qwen3.7-plus"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"id": "kimi-k2.5",
|
|
314
|
+
"name": "kimi-k2.5",
|
|
315
|
+
"reasoning": true,
|
|
316
|
+
"input": ["text", "image"],
|
|
317
|
+
"cost": {
|
|
318
|
+
"input": 0,
|
|
319
|
+
"output": 0,
|
|
320
|
+
"cacheRead": 0,
|
|
321
|
+
"cacheWrite": 0
|
|
322
|
+
},
|
|
323
|
+
"contextWindow": 262144,
|
|
324
|
+
"maxTokens": 98304
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"id": "glm-5",
|
|
328
|
+
"name": "glm-5",
|
|
329
|
+
"reasoning": true,
|
|
330
|
+
"input": ["text"],
|
|
331
|
+
"cost": {
|
|
332
|
+
"input": 0,
|
|
333
|
+
"output": 0,
|
|
334
|
+
"cacheRead": 0,
|
|
335
|
+
"cacheWrite": 0
|
|
336
|
+
},
|
|
337
|
+
"contextWindow": 202752,
|
|
338
|
+
"maxTokens": 16384
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"id": "MiniMax-M2.5",
|
|
342
|
+
"name": "MiniMax-M2.5",
|
|
343
|
+
"reasoning": true,
|
|
344
|
+
"input": ["text"],
|
|
345
|
+
"cost": {
|
|
346
|
+
"input": 0,
|
|
347
|
+
"output": 0,
|
|
348
|
+
"cacheRead": 0,
|
|
349
|
+
"cacheWrite": 0
|
|
350
|
+
},
|
|
351
|
+
"contextWindow": 196608,
|
|
352
|
+
"maxTokens": 32768
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"discovery": {
|
|
358
|
+
"qwen": "runtime",
|
|
359
|
+
"qwen-token-plan": "refreshable"
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region extensions/qwen/models.ts
|
|
364
|
+
const QWEN_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1";
|
|
365
|
+
const QWEN_GLOBAL_BASE_URL = QWEN_BASE_URL;
|
|
366
|
+
const QWEN_CN_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1";
|
|
367
|
+
const QWEN_STANDARD_CN_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
|
|
368
|
+
const QWEN_STANDARD_GLOBAL_BASE_URL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
|
|
369
|
+
const QWEN_TOKEN_PLAN_PROVIDER_ID = "qwen-token-plan";
|
|
370
|
+
const QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID = "bailian-token-plan";
|
|
371
|
+
const QWEN_TOKEN_PLAN_GLOBAL_BASE_URL = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
|
|
372
|
+
const QWEN_TOKEN_PLAN_CN_BASE_URL = "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1";
|
|
373
|
+
const QWEN_DEFAULT_MODEL_ID = "qwen3.5-plus";
|
|
374
|
+
const QWEN_36_FLASH_MODEL_ID = "qwen3.6-flash";
|
|
375
|
+
const QWEN_36_PLUS_MODEL_ID = "qwen3.6-plus";
|
|
376
|
+
const QWEN_37_MAX_MODEL_ID = "qwen3.7-max";
|
|
377
|
+
const QWEN_37_PLUS_MODEL_ID = "qwen3.7-plus";
|
|
378
|
+
const QWEN_38_MODEL_IDS = /* @__PURE__ */ new Set(["qwen3.8-max", "qwen3.8-flash"]);
|
|
379
|
+
function isQwen38ModelId(modelId) {
|
|
380
|
+
return QWEN_38_MODEL_IDS.has(modelId.trim().toLowerCase());
|
|
381
|
+
}
|
|
382
|
+
const QWEN_DEFAULT_COST = {
|
|
383
|
+
input: 0,
|
|
384
|
+
output: 0,
|
|
385
|
+
cacheRead: 0,
|
|
386
|
+
cacheWrite: 0
|
|
387
|
+
};
|
|
388
|
+
const QWEN_DEFAULT_MODEL_REF = `qwen/${QWEN_DEFAULT_MODEL_ID}`;
|
|
389
|
+
const QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID = QWEN_37_PLUS_MODEL_ID;
|
|
390
|
+
const QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF = `${QWEN_TOKEN_PLAN_PROVIDER_ID}/${QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID}`;
|
|
391
|
+
function isQwenTokenPlanThinkingOnlyModelId(modelId) {
|
|
392
|
+
const normalized = modelId.trim().toLowerCase();
|
|
393
|
+
return normalized === "minimax-m2.5" || normalized.startsWith("kimi-k2.7-code");
|
|
394
|
+
}
|
|
395
|
+
function isQwenTokenPlanDeepSeekV4ModelId(modelId) {
|
|
396
|
+
return modelId.trim().toLowerCase().startsWith("deepseek-v4");
|
|
397
|
+
}
|
|
398
|
+
function isQwenTokenPlanKimiModelId(modelId) {
|
|
399
|
+
return modelId.trim().toLowerCase().startsWith("kimi-");
|
|
400
|
+
}
|
|
401
|
+
function isQwenTokenPlanGlmModelId(modelId) {
|
|
402
|
+
return modelId.trim().toLowerCase().startsWith("glm-");
|
|
403
|
+
}
|
|
404
|
+
function supportsQwenTokenPlanGlmMaxThinking(modelId) {
|
|
405
|
+
return modelId.trim().toLowerCase() === "glm-5.2";
|
|
406
|
+
}
|
|
407
|
+
const QWEN_TOKEN_PLAN_BASE_URLS = {
|
|
408
|
+
global: QWEN_TOKEN_PLAN_GLOBAL_BASE_URL,
|
|
409
|
+
cn: QWEN_TOKEN_PLAN_CN_BASE_URL
|
|
410
|
+
};
|
|
411
|
+
function resolveQwenTokenPlanBaseUrl(region) {
|
|
412
|
+
return QWEN_TOKEN_PLAN_BASE_URLS[region];
|
|
413
|
+
}
|
|
414
|
+
const QWEN_TOKEN_PLAN_MODEL_CATALOG = buildManifestModelProviderConfig({
|
|
415
|
+
providerId: QWEN_TOKEN_PLAN_PROVIDER_ID,
|
|
416
|
+
catalog: modelCatalog.providers[QWEN_TOKEN_PLAN_PROVIDER_ID]
|
|
417
|
+
}).models;
|
|
418
|
+
const QWEN_MODEL_CATALOG = buildManifestModelProviderConfig({
|
|
419
|
+
providerId: "qwen",
|
|
420
|
+
catalog: {
|
|
421
|
+
...modelCatalog.providers.qwen,
|
|
422
|
+
baseUrl: QWEN_BASE_URL
|
|
423
|
+
}
|
|
424
|
+
}).models;
|
|
425
|
+
function isQwenCodingPlanBaseUrl(baseUrl) {
|
|
426
|
+
const trimmed = baseUrl?.trim();
|
|
427
|
+
if (!trimmed) return false;
|
|
428
|
+
try {
|
|
429
|
+
const hostname = new URL(trimmed).hostname.toLowerCase().replace(/\.+$/, "");
|
|
430
|
+
return hostname === "coding.dashscope.aliyuncs.com" || hostname === "coding-intl.dashscope.aliyuncs.com";
|
|
431
|
+
} catch {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function isQwen36PlusSupportedBaseUrl(_baseUrl) {
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
const QWEN_STANDARD_ONLY_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
439
|
+
QWEN_36_FLASH_MODEL_ID,
|
|
440
|
+
QWEN_37_MAX_MODEL_ID,
|
|
441
|
+
...QWEN_38_MODEL_IDS
|
|
442
|
+
]);
|
|
443
|
+
function isQwenStandardOnlyModelId(modelId) {
|
|
444
|
+
return QWEN_STANDARD_ONLY_MODEL_IDS.has(modelId);
|
|
445
|
+
}
|
|
446
|
+
function buildQwenModelCatalogForBaseUrl(baseUrl) {
|
|
447
|
+
return isQwenCodingPlanBaseUrl(baseUrl) ? QWEN_MODEL_CATALOG.filter((model) => !isQwenStandardOnlyModelId(model.id)) : QWEN_MODEL_CATALOG;
|
|
448
|
+
}
|
|
449
|
+
function isNativeQwenBaseUrl(baseUrl) {
|
|
450
|
+
return supportsNativeStreamingUsageCompat({
|
|
451
|
+
providerId: "qwen",
|
|
452
|
+
baseUrl
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function applyQwenNativeStreamingUsageCompat(provider) {
|
|
456
|
+
return applyProviderNativeStreamingUsageCompat({
|
|
457
|
+
providerId: "qwen",
|
|
458
|
+
providerConfig: provider
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function buildQwenModelDefinition(params) {
|
|
462
|
+
const catalog = QWEN_MODEL_CATALOG.find((model) => model.id === params.id);
|
|
463
|
+
return {
|
|
464
|
+
id: params.id,
|
|
465
|
+
name: params.name ?? catalog?.name ?? params.id,
|
|
466
|
+
reasoning: params.reasoning ?? catalog?.reasoning ?? false,
|
|
467
|
+
input: params.input ?? (catalog?.input ? [...catalog.input] : ["text"]),
|
|
468
|
+
cost: params.cost ?? catalog?.cost ?? QWEN_DEFAULT_COST,
|
|
469
|
+
contextWindow: params.contextWindow ?? catalog?.contextWindow ?? 262144,
|
|
470
|
+
maxTokens: params.maxTokens ?? catalog?.maxTokens ?? 65536
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
function buildQwenDefaultModelDefinition() {
|
|
474
|
+
return buildQwenModelDefinition({ id: QWEN_DEFAULT_MODEL_ID });
|
|
475
|
+
}
|
|
476
|
+
/** @deprecated Use QWEN_BASE_URL. */
|
|
477
|
+
const MODELSTUDIO_BASE_URL = QWEN_BASE_URL;
|
|
478
|
+
/** @deprecated Use QWEN_GLOBAL_BASE_URL. */
|
|
479
|
+
const MODELSTUDIO_GLOBAL_BASE_URL = QWEN_GLOBAL_BASE_URL;
|
|
480
|
+
/** @deprecated Use QWEN_CN_BASE_URL. */
|
|
481
|
+
const MODELSTUDIO_CN_BASE_URL = QWEN_CN_BASE_URL;
|
|
482
|
+
/** @deprecated Use QWEN_STANDARD_CN_BASE_URL. */
|
|
483
|
+
const MODELSTUDIO_STANDARD_CN_BASE_URL = QWEN_STANDARD_CN_BASE_URL;
|
|
484
|
+
/** @deprecated Use QWEN_STANDARD_GLOBAL_BASE_URL. */
|
|
485
|
+
const MODELSTUDIO_STANDARD_GLOBAL_BASE_URL = QWEN_STANDARD_GLOBAL_BASE_URL;
|
|
486
|
+
/** @deprecated Use QWEN_DEFAULT_MODEL_ID. */
|
|
487
|
+
const MODELSTUDIO_DEFAULT_MODEL_ID = QWEN_DEFAULT_MODEL_ID;
|
|
488
|
+
/** @deprecated Use QWEN_DEFAULT_COST. */
|
|
489
|
+
const MODELSTUDIO_DEFAULT_COST = QWEN_DEFAULT_COST;
|
|
490
|
+
/** @deprecated Use qwen/${QWEN_DEFAULT_MODEL_ID}. */
|
|
491
|
+
const MODELSTUDIO_DEFAULT_MODEL_REF = `modelstudio/${QWEN_DEFAULT_MODEL_ID}`;
|
|
492
|
+
/** @deprecated Use QWEN_MODEL_CATALOG. */
|
|
493
|
+
const MODELSTUDIO_MODEL_CATALOG = QWEN_MODEL_CATALOG;
|
|
494
|
+
const isNativeModelStudioBaseUrl = isNativeQwenBaseUrl;
|
|
495
|
+
const applyModelStudioNativeStreamingUsageCompat = applyQwenNativeStreamingUsageCompat;
|
|
496
|
+
const buildModelStudioModelDefinition = buildQwenModelDefinition;
|
|
497
|
+
const buildModelStudioDefaultModelDefinition = buildQwenDefaultModelDefinition;
|
|
498
|
+
//#endregion
|
|
499
|
+
export { applyModelStudioNativeStreamingUsageCompat as A, isQwen38ModelId as B, QWEN_TOKEN_PLAN_CN_BASE_URL as C, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID as D, QWEN_TOKEN_PLAN_GLOBAL_BASE_URL as E, buildQwenModelCatalogForBaseUrl as F, isQwenTokenPlanKimiModelId as G, isQwenStandardOnlyModelId as H, buildQwenModelDefinition as I, supportsQwenTokenPlanGlmMaxThinking as J, isQwenTokenPlanThinkingOnlyModelId as K, isNativeModelStudioBaseUrl as L, buildModelStudioDefaultModelDefinition as M, buildModelStudioModelDefinition as N, QWEN_TOKEN_PLAN_MODEL_CATALOG as O, buildQwenDefaultModelDefinition as P, isNativeQwenBaseUrl as R, QWEN_STANDARD_GLOBAL_BASE_URL as S, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF as T, isQwenTokenPlanDeepSeekV4ModelId as U, isQwenCodingPlanBaseUrl as V, isQwenTokenPlanGlmModelId as W, QWEN_DEFAULT_MODEL_ID as _, MODELSTUDIO_DEFAULT_MODEL_REF as a, QWEN_MODEL_CATALOG as b, MODELSTUDIO_STANDARD_CN_BASE_URL as c, QWEN_36_PLUS_MODEL_ID as d, QWEN_37_MAX_MODEL_ID as f, QWEN_DEFAULT_COST as g, QWEN_CN_BASE_URL as h, MODELSTUDIO_DEFAULT_MODEL_ID as i, applyQwenNativeStreamingUsageCompat as j, QWEN_TOKEN_PLAN_PROVIDER_ID as k, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL as l, QWEN_BASE_URL as m, MODELSTUDIO_CN_BASE_URL as n, MODELSTUDIO_GLOBAL_BASE_URL as o, QWEN_37_PLUS_MODEL_ID as p, resolveQwenTokenPlanBaseUrl as q, MODELSTUDIO_DEFAULT_COST as r, MODELSTUDIO_MODEL_CATALOG as s, MODELSTUDIO_BASE_URL as t, QWEN_36_FLASH_MODEL_ID as u, QWEN_DEFAULT_MODEL_REF as v, QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID as w, QWEN_STANDARD_CN_BASE_URL as x, QWEN_GLOBAL_BASE_URL as y, isQwen36PlusSupportedBaseUrl as z };
|