@openclaw/qwen-provider 2026.10.10-beta.5 → 2026.11.5-beta.1
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/.setup/{models-BRg9bCBV.mjs → models-BHyvoc6Y.mjs} +2 -4
- package/dist/.source-module-urls/1fb20072dbb35697afbceabb168bd62709e8953b9a19d97525528b9c0aedf35b.json +1 -0
- package/dist/api.js +1 -1
- package/dist/failover.js +1 -2
- package/dist/index.js +59 -8
- package/dist/models.js +1 -1
- package/dist/provider-catalog.js +2 -3
- package/dist/stream.js +75 -79
- package/dist/video-generation-provider.js +2 -3
- package/package.json +4 -4
- package/dist/.source-module-urls/428a35a4cd0c121bd04d29d3c8fe5458ed7a88f101db64bb3ad78d8d20834a73.json +0 -1
- package/dist/media-understanding-provider.js +0 -31
- package/dist/onboard.js +0 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildManifestModelProviderConfig, supportsNativeStreamingUsageCompat } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
-
|
|
2
|
+
// extensions/qwen/openclaw.plugin.json
|
|
3
3
|
var modelCatalog = {
|
|
4
4
|
"modelsDev": {
|
|
5
5
|
"qwen": "alibaba-coding-plan",
|
|
@@ -344,8 +344,7 @@ var modelCatalog = {
|
|
|
344
344
|
"qwen-token-plan": "refreshable"
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
|
-
|
|
348
|
-
//#region extensions/qwen/models.ts
|
|
347
|
+
// extensions/qwen/models.ts
|
|
349
348
|
const QWEN_BASE_URL = modelCatalog.providers.qwen.baseUrl;
|
|
350
349
|
const QWEN_GLOBAL_BASE_URL = QWEN_BASE_URL;
|
|
351
350
|
const QWEN_CN_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1";
|
|
@@ -466,5 +465,4 @@ const MODELSTUDIO_MODEL_CATALOG = QWEN_MODEL_CATALOG;
|
|
|
466
465
|
const isNativeModelStudioBaseUrl = isNativeQwenBaseUrl;
|
|
467
466
|
const buildModelStudioModelDefinition = buildQwenModelDefinition;
|
|
468
467
|
const buildModelStudioDefaultModelDefinition = buildQwenDefaultModelDefinition;
|
|
469
|
-
//#endregion
|
|
470
468
|
export { buildModelStudioDefaultModelDefinition as A, isQwenStandardOnlyModelId 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, isNativeModelStudioBaseUrl as F, resolveQwenTokenPlanBaseUrl as G, isQwenTokenPlanGlmModelId as H, isNativeQwenBaseUrl as I, supportsQwenTokenPlanGlmMaxThinking as K, isQwen36PlusSupportedBaseUrl as L, buildQwenDefaultModelDefinition as M, buildQwenModelCatalogForBaseUrl as N, QWEN_TOKEN_PLAN_MODEL_CATALOG as O, buildQwenModelDefinition as P, isQwen38ModelId as R, QWEN_STANDARD_GLOBAL_BASE_URL as S, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF as T, isQwenTokenPlanKimiModelId as U, isQwenTokenPlanDeepSeekV4ModelId as V, isQwenTokenPlanThinkingOnlyModelId 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, buildModelStudioModelDefinition 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, 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, isQwenCodingPlanBaseUrl as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/qwen/api.ts"},{"output":"failover.js","source":"extensions/qwen/failover.ts"},{"output":"index.js","source":"extensions/qwen/index.ts"},{"output":"models.js","source":"extensions/qwen/models.ts"},{"output":"provider-catalog.js","source":"extensions/qwen/provider-catalog.ts"},{"output":"stream.js","source":"extensions/qwen/stream.ts"},{"output":"video-generation-provider.js","source":"extensions/qwen/video-generation-provider.ts"}],"chunks":[{"output":".setup/models-BHyvoc6Y.mjs","sha256":"57a2483c0c066601ef9d2f5285c311cee40b20b14fc516c70d65461fc2c5cd58","facadeSource":null,"sources":["extensions/qwen/models.ts","extensions/qwen/openclaw.plugin.json"]},{"output":"api.js","sha256":"5139a6af6eadfd3207c7e8bdf8f2d8556042454154b3f9312dafa938d86aad3d","facadeSource":"extensions/qwen/api.ts","sources":[]},{"output":"failover.js","sha256":"7124cb636da55379349a47fa7d9df6f963faf09953e9b00772b52d435719053e","facadeSource":"extensions/qwen/failover.ts","sources":["extensions/qwen/failover.ts"]},{"output":"index.js","sha256":"b3068a0eacd114475518407fb1be4e75d7cf2ab1ce837c2978150abd8156800e","facadeSource":"extensions/qwen/index.ts","sources":["extensions/qwen/index.ts"]},{"output":"models.js","sha256":"913b8b215a159d16c8f0079d12d0f2ddf4fffee884207285edbabc7bf663551a","facadeSource":"extensions/qwen/models.ts","sources":[]},{"output":"provider-catalog.js","sha256":"580c87b069627873a86702aa39429bd10a14890f6967a748f051d310a1822985","facadeSource":"extensions/qwen/provider-catalog.ts","sources":["extensions/qwen/provider-catalog.ts"]},{"output":"stream.js","sha256":"86f2508baedf698603636efe249602c698b9af1b2279da7bed49d42a4094aaa8","facadeSource":"extensions/qwen/stream.ts","sources":["extensions/qwen/stream.ts"]},{"output":"video-generation-provider.js","sha256":"671843d3ee585d8c4d48bfc1260b1163f12f56a0c36729c5ecfc755cefdd08a0","facadeSource":"extensions/qwen/video-generation-provider.ts","sources":["extensions/qwen/video-generation-provider.ts"]}],"unrenderedSources":["extensions/qwen/api.ts"]}
|
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as buildModelStudioDefaultModelDefinition, B as isQwenStandardOnlyModelId, 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 isNativeModelStudioBaseUrl, G as resolveQwenTokenPlanBaseUrl, I as isNativeQwenBaseUrl, L as isQwen36PlusSupportedBaseUrl, M as buildQwenDefaultModelDefinition, N as buildQwenModelCatalogForBaseUrl, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, P as buildQwenModelDefinition, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, _ 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 buildModelStudioModelDefinition, 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, 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 isQwenCodingPlanBaseUrl } from "./.setup/models-
|
|
1
|
+
import { A as buildModelStudioDefaultModelDefinition, B as isQwenStandardOnlyModelId, 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 isNativeModelStudioBaseUrl, G as resolveQwenTokenPlanBaseUrl, I as isNativeQwenBaseUrl, L as isQwen36PlusSupportedBaseUrl, M as buildQwenDefaultModelDefinition, N as buildQwenModelCatalogForBaseUrl, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, P as buildQwenModelDefinition, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, _ 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 buildModelStudioModelDefinition, 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, 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 isQwenCodingPlanBaseUrl } from "./.setup/models-BHyvoc6Y.mjs";
|
|
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, buildModelStudioDefaultModelDefinition, buildModelStudioModelDefinition, buildModelStudioProvider, buildQwenDefaultModelDefinition, buildQwenModelCatalogForBaseUrl, buildQwenModelDefinition, buildQwenProvider, buildQwenTokenPlanProvider, createQwenThinkingWrapper, isNativeModelStudioBaseUrl, isNativeQwenBaseUrl, isQwen36PlusSupportedBaseUrl, isQwenCodingPlanBaseUrl, isQwenStandardOnlyModelId, resolveQwenTokenPlanBaseUrl, wrapQwenProviderStream };
|
package/dist/failover.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/qwen/failover.ts
|
|
2
2
|
/** DashScope uses the same quota code for temporary limits and exhausted free credits. */
|
|
3
3
|
const classifyQwenFailoverReason = (context) => {
|
|
4
4
|
if (context.status !== 429) return;
|
|
@@ -8,5 +8,4 @@ const classifyQwenFailoverReason = (context) => {
|
|
|
8
8
|
if (/\bfree allocated quota exceeded\b/i.test(context.errorMessage)) return "billing";
|
|
9
9
|
if (/\ballocated quota exceeded, please increase your quota limit\b/i.test(context.errorMessage) || /\byou exceeded your current quota, please check your plan and billing details\b/i.test(context.errorMessage)) return "rate_limit";
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { classifyQwenFailoverReason };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { classifyQwenFailoverReason } from "./failover.js";
|
|
2
|
-
import { B as isQwenStandardOnlyModelId, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, H as isQwenTokenPlanGlmModelId, K as supportsQwenTokenPlanGlmMaxThinking, R as isQwen38ModelId, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, V as isQwenTokenPlanDeepSeekV4ModelId, W as isQwenTokenPlanThinkingOnlyModelId, k as QWEN_TOKEN_PLAN_PROVIDER_ID, v as QWEN_DEFAULT_MODEL_REF, z as isQwenCodingPlanBaseUrl } from "./.setup/models-
|
|
3
|
-
import { buildQwenMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
2
|
+
import { B as isQwenStandardOnlyModelId, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, G as resolveQwenTokenPlanBaseUrl, H as isQwenTokenPlanGlmModelId, K as supportsQwenTokenPlanGlmMaxThinking, R as isQwen38ModelId, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, V as isQwenTokenPlanDeepSeekV4ModelId, W as isQwenTokenPlanThinkingOnlyModelId, h as QWEN_CN_BASE_URL, k as QWEN_TOKEN_PLAN_PROVIDER_ID, v as QWEN_DEFAULT_MODEL_REF, x as QWEN_STANDARD_CN_BASE_URL, y as QWEN_GLOBAL_BASE_URL, z as isQwenCodingPlanBaseUrl } from "./.setup/models-BHyvoc6Y.mjs";
|
|
4
3
|
import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
|
|
5
|
-
import { applyQwenConfig, applyQwenConfigCn, applyQwenStandardConfig, applyQwenStandardConfigCn, applyQwenTokenPlanConfig } from "./onboard.js";
|
|
6
4
|
import { wrapQwenProviderStream } from "./stream.js";
|
|
7
5
|
import { qwenVideoGenerationProvider } from "./video-generation-provider.js";
|
|
6
|
+
import { describeOpenAiCompatibleVideo } from "openclaw/plugin-sdk/media-understanding";
|
|
8
7
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
|
9
8
|
import { buildOpenAICompatibleLiveProviderCatalog } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
10
9
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
10
|
+
import { createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
11
11
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
|
-
|
|
12
|
+
// extensions/qwen/index.ts
|
|
13
13
|
const PROVIDER_ID = "qwen";
|
|
14
14
|
const LEGACY_PROVIDER_ID = "modelstudio";
|
|
15
|
+
const DEFAULT_QWEN_MEDIA_MODEL = "qwen3.6-plus";
|
|
16
|
+
const DEFAULT_QWEN_VIDEO_PROMPT = "Describe the video in detail.";
|
|
15
17
|
const QWEN_TOKEN_PLAN_THINKING_LEVEL_IDS = [
|
|
16
18
|
"off",
|
|
17
19
|
"minimal",
|
|
@@ -22,6 +24,38 @@ const QWEN_TOKEN_PLAN_THINKING_LEVEL_IDS = [
|
|
|
22
24
|
"max"
|
|
23
25
|
];
|
|
24
26
|
const QWEN_TOKEN_PLAN_GLM_NO_MAX_THINKING_LEVEL_IDS = QWEN_TOKEN_PLAN_THINKING_LEVEL_IDS.filter((id) => id !== "max");
|
|
27
|
+
const qwenPresetAppliers = createProviderConnectionPresetAppliers({
|
|
28
|
+
primaryModelRef: QWEN_DEFAULT_MODEL_REF,
|
|
29
|
+
resolveParams: (_cfg, baseUrl) => {
|
|
30
|
+
const provider = buildQwenProvider({ baseUrl });
|
|
31
|
+
return {
|
|
32
|
+
providerId: "qwen",
|
|
33
|
+
api: provider.api ?? "openai-completions",
|
|
34
|
+
baseUrl,
|
|
35
|
+
catalogModels: provider.models,
|
|
36
|
+
aliases: [...provider.models.flatMap((model) => [`qwen/${model.id}`, `modelstudio/${model.id}`]), {
|
|
37
|
+
modelRef: QWEN_DEFAULT_MODEL_REF,
|
|
38
|
+
alias: "Qwen"
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const qwenTokenPlanPresetAppliers = createProviderConnectionPresetAppliers({
|
|
44
|
+
primaryModelRef: QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF,
|
|
45
|
+
resolveParams: (_cfg, baseUrl) => {
|
|
46
|
+
const provider = buildQwenTokenPlanProvider({ baseUrl });
|
|
47
|
+
return {
|
|
48
|
+
providerId: QWEN_TOKEN_PLAN_PROVIDER_ID,
|
|
49
|
+
api: provider.api ?? "openai-completions",
|
|
50
|
+
baseUrl,
|
|
51
|
+
catalogModels: provider.models,
|
|
52
|
+
aliases: [...provider.models.map((model) => `${QWEN_TOKEN_PLAN_PROVIDER_ID}/${model.id}`), {
|
|
53
|
+
modelRef: QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF,
|
|
54
|
+
alias: "Qwen Token Plan"
|
|
55
|
+
}]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
25
59
|
function resolveConfiguredQwenBaseUrl(config, providerIds) {
|
|
26
60
|
for (const [providerId, provider] of Object.entries(config?.models?.providers ?? {})) {
|
|
27
61
|
if (!providerIds.includes(normalizeLowercaseStringOrEmpty(providerId))) continue;
|
|
@@ -59,7 +93,7 @@ function createQwenAuthMethod(plan, region) {
|
|
|
59
93
|
envVar: "QWEN_API_KEY",
|
|
60
94
|
promptMessage: isStandard ? `Enter Qwen Cloud API key (${regionLabel} standard endpoint)` : `Enter Qwen Cloud Coding Plan API key (${regionLabel})`,
|
|
61
95
|
defaultModel: QWEN_DEFAULT_MODEL_REF,
|
|
62
|
-
applyConfig: isStandard ? isCn ?
|
|
96
|
+
applyConfig: (cfg) => qwenPresetAppliers.applyConfig(cfg, isStandard ? isCn ? QWEN_STANDARD_CN_BASE_URL : QWEN_STANDARD_GLOBAL_BASE_URL : isCn ? QWEN_CN_BASE_URL : QWEN_GLOBAL_BASE_URL),
|
|
63
97
|
noteMessage: [
|
|
64
98
|
"Manage API keys: https://home.qwencloud.com/api-keys",
|
|
65
99
|
"Docs: https://docs.qwencloud.com/",
|
|
@@ -88,7 +122,7 @@ function createQwenTokenPlanAuthMethod(region) {
|
|
|
88
122
|
envVar: "QWEN_TOKEN_PLAN_API_KEY",
|
|
89
123
|
promptMessage: `Enter Alibaba Qwen Token Plan API key (${regionLabel}, sk-sp-...)`,
|
|
90
124
|
defaultModel: QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF,
|
|
91
|
-
applyConfig: (cfg) =>
|
|
125
|
+
applyConfig: (cfg) => qwenTokenPlanPresetAppliers.applyConfig(cfg, resolveQwenTokenPlanBaseUrl(region)),
|
|
92
126
|
wizard: {
|
|
93
127
|
choiceId: isCn ? "qwen-token-plan-cn" : "qwen-token-plan",
|
|
94
128
|
choiceLabel: `Qwen Token Plan (${regionLabel})`,
|
|
@@ -191,9 +225,26 @@ var qwen_default = defineSingleProviderPluginEntry({
|
|
|
191
225
|
wrapSimpleCompletionStreamFn: wrapQwenProviderStream,
|
|
192
226
|
classifyFailoverReason: classifyQwenFailoverReason
|
|
193
227
|
});
|
|
194
|
-
api.registerMediaUnderstandingProvider(
|
|
228
|
+
api.registerMediaUnderstandingProvider({
|
|
229
|
+
id: "qwen",
|
|
230
|
+
capabilities: ["image", "video"],
|
|
231
|
+
defaultModels: {
|
|
232
|
+
image: DEFAULT_QWEN_MEDIA_MODEL,
|
|
233
|
+
video: DEFAULT_QWEN_MEDIA_MODEL
|
|
234
|
+
},
|
|
235
|
+
autoPriority: { video: 15 },
|
|
236
|
+
describeImage: void 0,
|
|
237
|
+
describeImages: void 0,
|
|
238
|
+
describeVideo: (params) => describeOpenAiCompatibleVideo({
|
|
239
|
+
...params,
|
|
240
|
+
defaultBaseUrl: QWEN_STANDARD_GLOBAL_BASE_URL,
|
|
241
|
+
defaultModel: DEFAULT_QWEN_MEDIA_MODEL,
|
|
242
|
+
defaultPrompt: DEFAULT_QWEN_VIDEO_PROMPT,
|
|
243
|
+
provider: "qwen",
|
|
244
|
+
providerLabel: "Qwen"
|
|
245
|
+
})
|
|
246
|
+
});
|
|
195
247
|
api.registerVideoGenerationProvider(qwenVideoGenerationProvider);
|
|
196
248
|
}
|
|
197
249
|
});
|
|
198
|
-
//#endregion
|
|
199
250
|
export { qwen_default as default };
|
package/dist/models.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as MODELSTUDIO_BASE_URL, n as MODELSTUDIO_CN_BASE_URL, r as MODELSTUDIO_DEFAULT_COST, i as MODELSTUDIO_DEFAULT_MODEL_ID, a as MODELSTUDIO_DEFAULT_MODEL_REF, o as MODELSTUDIO_GLOBAL_BASE_URL, s as MODELSTUDIO_MODEL_CATALOG, c as MODELSTUDIO_STANDARD_CN_BASE_URL, l as MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, u as QWEN_36_FLASH_MODEL_ID, d as QWEN_36_PLUS_MODEL_ID, f as QWEN_37_MAX_MODEL_ID, p as QWEN_37_PLUS_MODEL_ID, m as QWEN_BASE_URL, h as QWEN_CN_BASE_URL, g as QWEN_DEFAULT_COST, _ as QWEN_DEFAULT_MODEL_ID, v as QWEN_DEFAULT_MODEL_REF, y as QWEN_GLOBAL_BASE_URL, b as QWEN_MODEL_CATALOG, x as QWEN_STANDARD_CN_BASE_URL, S as QWEN_STANDARD_GLOBAL_BASE_URL, C as QWEN_TOKEN_PLAN_CN_BASE_URL, w as QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, E as QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, k as QWEN_TOKEN_PLAN_PROVIDER_ID, A as buildModelStudioDefaultModelDefinition, j as buildModelStudioModelDefinition, M as buildQwenDefaultModelDefinition, N as buildQwenModelCatalogForBaseUrl, P as buildQwenModelDefinition, F as isNativeModelStudioBaseUrl, I as isNativeQwenBaseUrl, L as isQwen36PlusSupportedBaseUrl, R as isQwen38ModelId, z as isQwenCodingPlanBaseUrl, B as isQwenStandardOnlyModelId, V as isQwenTokenPlanDeepSeekV4ModelId, H as isQwenTokenPlanGlmModelId, U as isQwenTokenPlanKimiModelId, W as isQwenTokenPlanThinkingOnlyModelId, G as resolveQwenTokenPlanBaseUrl, K as supportsQwenTokenPlanGlmMaxThinking } from "./.setup/models-
|
|
1
|
+
export { t as MODELSTUDIO_BASE_URL, n as MODELSTUDIO_CN_BASE_URL, r as MODELSTUDIO_DEFAULT_COST, i as MODELSTUDIO_DEFAULT_MODEL_ID, a as MODELSTUDIO_DEFAULT_MODEL_REF, o as MODELSTUDIO_GLOBAL_BASE_URL, s as MODELSTUDIO_MODEL_CATALOG, c as MODELSTUDIO_STANDARD_CN_BASE_URL, l as MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, u as QWEN_36_FLASH_MODEL_ID, d as QWEN_36_PLUS_MODEL_ID, f as QWEN_37_MAX_MODEL_ID, p as QWEN_37_PLUS_MODEL_ID, m as QWEN_BASE_URL, h as QWEN_CN_BASE_URL, g as QWEN_DEFAULT_COST, _ as QWEN_DEFAULT_MODEL_ID, v as QWEN_DEFAULT_MODEL_REF, y as QWEN_GLOBAL_BASE_URL, b as QWEN_MODEL_CATALOG, x as QWEN_STANDARD_CN_BASE_URL, S as QWEN_STANDARD_GLOBAL_BASE_URL, C as QWEN_TOKEN_PLAN_CN_BASE_URL, w as QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, E as QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, k as QWEN_TOKEN_PLAN_PROVIDER_ID, A as buildModelStudioDefaultModelDefinition, j as buildModelStudioModelDefinition, M as buildQwenDefaultModelDefinition, N as buildQwenModelCatalogForBaseUrl, P as buildQwenModelDefinition, F as isNativeModelStudioBaseUrl, I as isNativeQwenBaseUrl, L as isQwen36PlusSupportedBaseUrl, R as isQwen38ModelId, z as isQwenCodingPlanBaseUrl, B as isQwenStandardOnlyModelId, V as isQwenTokenPlanDeepSeekV4ModelId, H as isQwenTokenPlanGlmModelId, U as isQwenTokenPlanKimiModelId, W as isQwenTokenPlanThinkingOnlyModelId, G as resolveQwenTokenPlanBaseUrl, K as supportsQwenTokenPlanGlmMaxThinking } from "./.setup/models-BHyvoc6Y.mjs";
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as buildQwenModelCatalogForBaseUrl, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, m as QWEN_BASE_URL } from "./.setup/models-
|
|
2
|
-
|
|
1
|
+
import { N as buildQwenModelCatalogForBaseUrl, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, m as QWEN_BASE_URL } from "./.setup/models-BHyvoc6Y.mjs";
|
|
2
|
+
// extensions/qwen/provider-catalog.ts
|
|
3
3
|
function buildQwenProvider(params) {
|
|
4
4
|
const baseUrl = params?.baseUrl ?? QWEN_BASE_URL;
|
|
5
5
|
return {
|
|
@@ -16,5 +16,4 @@ function buildQwenTokenPlanProvider(params) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
const buildModelStudioProvider = buildQwenProvider;
|
|
19
|
-
//#endregion
|
|
20
19
|
export { buildModelStudioProvider, buildQwenProvider, buildQwenTokenPlanProvider };
|
package/dist/stream.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { H as isQwenTokenPlanGlmModelId, K as supportsQwenTokenPlanGlmMaxThinking, R as isQwen38ModelId, U as isQwenTokenPlanKimiModelId, V as isQwenTokenPlanDeepSeekV4ModelId, W as isQwenTokenPlanThinkingOnlyModelId } from "./.setup/models-
|
|
1
|
+
import { H as isQwenTokenPlanGlmModelId, K as supportsQwenTokenPlanGlmMaxThinking, R as isQwen38ModelId, U as isQwenTokenPlanKimiModelId, V as isQwenTokenPlanDeepSeekV4ModelId, W as isQwenTokenPlanThinkingOnlyModelId, k as QWEN_TOKEN_PLAN_PROVIDER_ID } from "./.setup/models-BHyvoc6Y.mjs";
|
|
2
2
|
import { asOptionalObjectRecord, asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { streamSimple } from "openclaw/plugin-sdk/llm";
|
|
4
|
-
import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
|
|
5
|
-
import { createPayloadPatchStreamWrapper, isOpenAICompatibleThinkingEnabled, normalizeOpenAICompatibleReasoningReplay, setQwenChatTemplateThinking } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
6
|
-
|
|
4
|
+
import { normalizeProviderId, resolveProviderEndpoint } from "openclaw/plugin-sdk/provider-model-shared";
|
|
5
|
+
import { createPayloadPatchStreamWrapper, isOpenAICompatibleThinkingEnabled, normalizeOpenAICompatibleReasoningReplay, setQwenChatTemplateThinking, wrapProviderPayloadHook } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
6
|
+
// extensions/qwen/stream.ts
|
|
7
7
|
function resolveQwenThinkingLevel(thinkingLevel, options) {
|
|
8
8
|
const runtimeOptions = options ?? {};
|
|
9
9
|
return normalizeQwenThinkingLevel(runtimeOptions.reasoningEffort ?? runtimeOptions.reasoning ?? thinkingLevel, thinkingLevel);
|
|
@@ -31,6 +31,12 @@ function isQwenTokenPlanProviderId(providerId) {
|
|
|
31
31
|
const normalized = normalizeProviderId(providerId);
|
|
32
32
|
return normalized === "qwen-token-plan" || normalized === "bailian-token-plan";
|
|
33
33
|
}
|
|
34
|
+
function resolveQwenStreamProviderId(ctx) {
|
|
35
|
+
if (isQwenProviderId(ctx.provider)) return ctx.provider;
|
|
36
|
+
const endpoint = resolveProviderEndpoint(ctx.model?.baseUrl);
|
|
37
|
+
if (endpoint.endpointClass !== "modelstudio-native") return;
|
|
38
|
+
return endpoint.hostname === new URL("https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1").hostname || endpoint.hostname === new URL("https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1").hostname ? QWEN_TOKEN_PLAN_PROVIDER_ID : "qwen";
|
|
39
|
+
}
|
|
34
40
|
function resolveQwenThinkingContract(providerId, modelId) {
|
|
35
41
|
if (isQwen38ModelId(modelId)) return { family: "qwen-3.8" };
|
|
36
42
|
if (!isQwenTokenPlanProviderId(providerId)) return;
|
|
@@ -63,76 +69,6 @@ function patchTokenPlanKimiPayload(payload, enableThinking) {
|
|
|
63
69
|
shouldBackfillAssistantMessage: (message) => Array.isArray(message.tool_calls) && message.tool_calls.length > 0
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
|
-
function normalizeTokenPlanThinkingToolChoice(payload, enableThinking, forceThinking) {
|
|
67
|
-
if (!enableThinking) return false;
|
|
68
|
-
const toolChoice = payload.tool_choice;
|
|
69
|
-
const toolChoiceType = asOptionalRecord(toolChoice)?.type;
|
|
70
|
-
if (toolChoiceType === "auto" || toolChoiceType === "none") {
|
|
71
|
-
payload.tool_choice = toolChoiceType;
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (toolChoice == null || toolChoice === "auto" || toolChoice === "none") return true;
|
|
75
|
-
if (!forceThinking && (toolChoiceType === "tool" || toolChoiceType === "function")) {
|
|
76
|
-
payload.enable_thinking = false;
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
payload.tool_choice = "auto";
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
function enforceQwenPayloadAfterCaller(payload, tokenPlanContract, forceThinking, requestedEnableThinking, requestedThinkingLevel) {
|
|
83
|
-
const hasPayloadThinking = typeof payload.enable_thinking === "boolean";
|
|
84
|
-
let enableThinking = forceThinking || (hasPayloadThinking ? payload.enable_thinking !== false : requestedEnableThinking);
|
|
85
|
-
const rawThinkingLevel = typeof payload.reasoning_effort === "string" ? payload.reasoning_effort : hasPayloadThinking ? void 0 : requestedThinkingLevel;
|
|
86
|
-
if (!forceThinking && (rawThinkingLevel === "off" || tokenPlanContract?.family === "qwen-3.8" && rawThinkingLevel === "none")) enableThinking = false;
|
|
87
|
-
payload.enable_thinking = enableThinking;
|
|
88
|
-
enableThinking = normalizeTokenPlanThinkingToolChoice(payload, enableThinking, forceThinking);
|
|
89
|
-
if (tokenPlanContract?.family === "qwen-3.8") patchQwen38Payload(payload, normalizeQwenThinkingLevel(rawThinkingLevel), enableThinking);
|
|
90
|
-
else if (tokenPlanContract?.family === "deepseek-v4") patchTokenPlanDeepSeekV4Payload(payload, rawThinkingLevel === "xhigh" || rawThinkingLevel === "max" ? "max" : "high", enableThinking);
|
|
91
|
-
else if (tokenPlanContract?.family === "kimi") patchTokenPlanKimiPayload(payload, enableThinking);
|
|
92
|
-
else if (tokenPlanContract?.family === "glm") {
|
|
93
|
-
if (Array.isArray(payload.tools) && payload.tools.length > 0) payload.tool_stream = true;
|
|
94
|
-
if (rawThinkingLevel === "none" && enableThinking) delete payload.thinking;
|
|
95
|
-
else patchTokenPlanGlmPayload(payload, normalizeQwenThinkingLevel(rawThinkingLevel), enableThinking, tokenPlanContract.supportsMax);
|
|
96
|
-
} else {
|
|
97
|
-
delete payload.thinking;
|
|
98
|
-
delete payload.reasoning_effort;
|
|
99
|
-
}
|
|
100
|
-
delete payload.reasoningEffort;
|
|
101
|
-
delete payload.reasoning;
|
|
102
|
-
}
|
|
103
|
-
function createQwenConstraintWrapper(baseStreamFn, tokenPlanContract, forceThinking, thinkingLevel, sourceApi) {
|
|
104
|
-
const underlying = baseStreamFn ?? streamSimple;
|
|
105
|
-
const patchPayload = createQwenThinkingPayloadPatch(thinkingLevel, void 0, forceThinking, tokenPlanContract, sourceApi);
|
|
106
|
-
return (model, context, options) => {
|
|
107
|
-
if ((sourceApi ?? model.api) !== "openai-completions" || !model.reasoning && !forceThinking) return underlying(model, context, options);
|
|
108
|
-
const requestedThinkingLevel = resolveQwenThinkingLevel(thinkingLevel, options);
|
|
109
|
-
const requestedEnableThinking = forceThinking || isOpenAICompatibleThinkingEnabled({
|
|
110
|
-
thinkingLevel,
|
|
111
|
-
options
|
|
112
|
-
});
|
|
113
|
-
const originalOnPayload = options?.onPayload;
|
|
114
|
-
return underlying(model, context, {
|
|
115
|
-
...options,
|
|
116
|
-
onPayload(payload, payloadModel) {
|
|
117
|
-
const payloadObj = asOptionalRecord(payload);
|
|
118
|
-
if (payloadObj) patchPayload({
|
|
119
|
-
payload: payloadObj,
|
|
120
|
-
model,
|
|
121
|
-
context,
|
|
122
|
-
options
|
|
123
|
-
});
|
|
124
|
-
const finalizePayload = (value) => {
|
|
125
|
-
const finalPayload = asOptionalRecord(value) ?? payloadObj;
|
|
126
|
-
if (finalPayload) enforceQwenPayloadAfterCaller(finalPayload, tokenPlanContract, forceThinking, requestedEnableThinking, requestedThinkingLevel);
|
|
127
|
-
return value;
|
|
128
|
-
};
|
|
129
|
-
const result = originalOnPayload?.(payload, payloadModel);
|
|
130
|
-
if (result && typeof result.then === "function") return Promise.resolve(result).then(finalizePayload);
|
|
131
|
-
return finalizePayload(result);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
72
|
function patchTokenPlanGlmPayload(payload, thinkingLevel, enableThinking, supportsMax) {
|
|
137
73
|
delete payload.thinking;
|
|
138
74
|
if (!enableThinking) {
|
|
@@ -184,15 +120,75 @@ function createQwenThinkingWrapper(baseStreamFn, thinkingLevel, thinkingFormat,
|
|
|
184
120
|
}
|
|
185
121
|
function wrapQwenProviderStream(ctx) {
|
|
186
122
|
const sourceApi = ctx.sourceApi ?? ctx.model?.api;
|
|
187
|
-
if (
|
|
123
|
+
if (sourceApi && sourceApi !== "openai-completions") return;
|
|
124
|
+
const streamProviderId = resolveQwenStreamProviderId(ctx);
|
|
125
|
+
if (!streamProviderId) return;
|
|
188
126
|
const thinkingFormat = ctx.model ? readQwenThinkingFormatFromModel(ctx.model, sourceApi) : void 0;
|
|
189
127
|
const explicitLegacyThinkingFormat = normalizeProviderId(ctx.provider) === "bailian-token-plan" && thinkingFormat !== void 0;
|
|
190
128
|
if (explicitLegacyThinkingFormat && thinkingFormat !== "qwen-chat-template") return ctx.streamFn;
|
|
191
|
-
const tokenPlanContract = explicitLegacyThinkingFormat ? void 0 : resolveQwenThinkingContract(
|
|
192
|
-
const useWireConstraints = (isQwenTokenPlanProviderId(
|
|
129
|
+
const tokenPlanContract = explicitLegacyThinkingFormat ? void 0 : resolveQwenThinkingContract(streamProviderId, ctx.modelId);
|
|
130
|
+
const useWireConstraints = (isQwenTokenPlanProviderId(streamProviderId) || tokenPlanContract?.family === "qwen-3.8") && !explicitLegacyThinkingFormat && thinkingFormat === void 0;
|
|
193
131
|
const forceThinking = useWireConstraints && isQwenTokenPlanThinkingOnlyModelId(ctx.modelId);
|
|
194
|
-
if (useWireConstraints)
|
|
132
|
+
if (useWireConstraints) {
|
|
133
|
+
const underlying = ctx.streamFn ?? streamSimple;
|
|
134
|
+
const thinkingLevel = ctx.thinkingLevel;
|
|
135
|
+
const wireSourceApi = ctx.sourceApi;
|
|
136
|
+
const patchPayload = createQwenThinkingPayloadPatch(thinkingLevel, void 0, forceThinking, tokenPlanContract, wireSourceApi);
|
|
137
|
+
return (model, context, options) => {
|
|
138
|
+
if ((wireSourceApi ?? model.api) !== "openai-completions" || !model.reasoning && !forceThinking) return underlying(model, context, options);
|
|
139
|
+
const requestedThinkingLevel = resolveQwenThinkingLevel(thinkingLevel, options);
|
|
140
|
+
const requestedEnableThinking = forceThinking || isOpenAICompatibleThinkingEnabled({
|
|
141
|
+
thinkingLevel,
|
|
142
|
+
options
|
|
143
|
+
});
|
|
144
|
+
return underlying(model, context, {
|
|
145
|
+
...options,
|
|
146
|
+
onPayload: wrapProviderPayloadHook(options?.onPayload, (originalPayload, value) => {
|
|
147
|
+
const payload = asOptionalRecord(value) ?? asOptionalRecord(originalPayload);
|
|
148
|
+
if (payload) {
|
|
149
|
+
const hasPayloadThinking = typeof payload.enable_thinking === "boolean";
|
|
150
|
+
let enableThinking = forceThinking || (hasPayloadThinking ? payload.enable_thinking !== false : requestedEnableThinking);
|
|
151
|
+
const rawThinkingLevel = typeof payload.reasoning_effort === "string" ? payload.reasoning_effort : hasPayloadThinking ? void 0 : requestedThinkingLevel;
|
|
152
|
+
if (!forceThinking && (rawThinkingLevel === "off" || tokenPlanContract?.family === "qwen-3.8" && rawThinkingLevel === "none")) enableThinking = false;
|
|
153
|
+
payload.enable_thinking = enableThinking;
|
|
154
|
+
if (enableThinking) {
|
|
155
|
+
const toolChoice = payload.tool_choice;
|
|
156
|
+
const toolChoiceType = asOptionalRecord(toolChoice)?.type;
|
|
157
|
+
if (toolChoiceType === "auto" || toolChoiceType === "none") payload.tool_choice = toolChoiceType;
|
|
158
|
+
else if (!(toolChoice == null || toolChoice === "auto" || toolChoice === "none")) {
|
|
159
|
+
if (!forceThinking && (toolChoiceType === "tool" || toolChoiceType === "function")) {
|
|
160
|
+
payload.enable_thinking = false;
|
|
161
|
+
enableThinking = false;
|
|
162
|
+
} else payload.tool_choice = "auto";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (tokenPlanContract?.family === "qwen-3.8") patchQwen38Payload(payload, normalizeQwenThinkingLevel(rawThinkingLevel), enableThinking);
|
|
166
|
+
else if (tokenPlanContract?.family === "deepseek-v4") patchTokenPlanDeepSeekV4Payload(payload, rawThinkingLevel === "xhigh" || rawThinkingLevel === "max" ? "max" : "high", enableThinking);
|
|
167
|
+
else if (tokenPlanContract?.family === "kimi") patchTokenPlanKimiPayload(payload, enableThinking);
|
|
168
|
+
else if (tokenPlanContract?.family === "glm") {
|
|
169
|
+
if (Array.isArray(payload.tools) && payload.tools.length > 0) payload.tool_stream = true;
|
|
170
|
+
if (rawThinkingLevel === "none" && enableThinking) delete payload.thinking;
|
|
171
|
+
else patchTokenPlanGlmPayload(payload, normalizeQwenThinkingLevel(rawThinkingLevel), enableThinking, tokenPlanContract.supportsMax);
|
|
172
|
+
} else {
|
|
173
|
+
delete payload.thinking;
|
|
174
|
+
delete payload.reasoning_effort;
|
|
175
|
+
}
|
|
176
|
+
delete payload.reasoningEffort;
|
|
177
|
+
delete payload.reasoning;
|
|
178
|
+
}
|
|
179
|
+
return value;
|
|
180
|
+
}, (payload) => {
|
|
181
|
+
const payloadObj = asOptionalRecord(payload);
|
|
182
|
+
if (payloadObj) patchPayload({
|
|
183
|
+
payload: payloadObj,
|
|
184
|
+
model,
|
|
185
|
+
context,
|
|
186
|
+
options
|
|
187
|
+
});
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
}
|
|
195
192
|
return createQwenThinkingWrapper(ctx.streamFn, ctx.thinkingLevel, thinkingFormat, forceThinking, tokenPlanContract, ctx.sourceApi);
|
|
196
193
|
}
|
|
197
|
-
//#endregion
|
|
198
194
|
export { createQwenThinkingWrapper, wrapQwenProviderStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { z as isQwenCodingPlanBaseUrl } from "./.setup/models-
|
|
1
|
+
import { z as isQwenCodingPlanBaseUrl } from "./.setup/models-BHyvoc6Y.mjs";
|
|
2
2
|
import { buildDashscopeVideoGenerationProvider } from "openclaw/plugin-sdk/video-generation";
|
|
3
|
-
|
|
3
|
+
// extensions/qwen/video-generation-provider.ts
|
|
4
4
|
const DEFAULT_QWEN_VIDEO_BASE_URL = "https://dashscope-intl.aliyuncs.com";
|
|
5
5
|
function isQwenVideoEndpointSupported(baseUrl) {
|
|
6
6
|
if (isQwenCodingPlanBaseUrl(baseUrl)) return false;
|
|
@@ -32,5 +32,4 @@ const qwenVideoGenerationProvider = buildDashscopeVideoGenerationProvider({
|
|
|
32
32
|
unsupportedMessage: "Qwen Wan video generation requires a Standard DashScope endpoint and a same-region Standard API key; Coding Plan and Token Plan credentials are not supported."
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { qwenVideoGenerationProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/qwen-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.5-beta.1",
|
|
4
4
|
"description": "OpenClaw Qwen Cloud provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.
|
|
21
|
+
"pluginApi": ">=2026.11.5-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.
|
|
24
|
+
"openclawVersion": "2026.11.5-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.
|
|
43
|
+
"openclaw": ">=2026.11.5-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/qwen/api.ts"},{"output":"failover.js","source":"extensions/qwen/failover.ts"},{"output":"index.js","source":"extensions/qwen/index.ts"},{"output":"media-understanding-provider.js","source":"extensions/qwen/media-understanding-provider.ts"},{"output":"models.js","source":"extensions/qwen/models.ts"},{"output":"onboard.js","source":"extensions/qwen/onboard.ts"},{"output":"provider-catalog.js","source":"extensions/qwen/provider-catalog.ts"},{"output":"stream.js","source":"extensions/qwen/stream.ts"},{"output":"video-generation-provider.js","source":"extensions/qwen/video-generation-provider.ts"}],"chunks":[{"output":".setup/models-BRg9bCBV.mjs","sha256":"8a4345569160aeafa646d51b1795300cf3a50cc171b0a9e3308af1dacc4b364e","facadeSource":null,"sources":["extensions/qwen/models.ts","extensions/qwen/openclaw.plugin.json"]},{"output":"api.js","sha256":"5da7b7bfa06a873ad53855583d14172ed65fb1cd9fdc8e61426b75abad63554d","facadeSource":"extensions/qwen/api.ts","sources":[]},{"output":"failover.js","sha256":"516289b48c72942b6cc9115d1a4dce1f228de1a681f64b48d1ab41326abdc98f","facadeSource":"extensions/qwen/failover.ts","sources":["extensions/qwen/failover.ts"]},{"output":"index.js","sha256":"17a7c56f51994e609d856e25c846989334c7dad688b4e18d06c1eef9661facb1","facadeSource":"extensions/qwen/index.ts","sources":["extensions/qwen/index.ts"]},{"output":"media-understanding-provider.js","sha256":"7c349c3faf66f0389100a3e9fb48777174531e6d5b04df2db50b2d5bef8ae45e","facadeSource":"extensions/qwen/media-understanding-provider.ts","sources":["extensions/qwen/media-understanding-provider.ts"]},{"output":"models.js","sha256":"6a054e9eedf461ea20d2cb9c45df3051ce13271b142af706082bb348531af59f","facadeSource":"extensions/qwen/models.ts","sources":[]},{"output":"onboard.js","sha256":"3afdbe0819ec79aa1d64b2f4d57b67f5940685cf8dfa9e8c5509b79393a90b0d","facadeSource":"extensions/qwen/onboard.ts","sources":["extensions/qwen/onboard.ts"]},{"output":"provider-catalog.js","sha256":"af46e68cb95be619046948522644f3502550fe5ebcefe16485ff498751353616","facadeSource":"extensions/qwen/provider-catalog.ts","sources":["extensions/qwen/provider-catalog.ts"]},{"output":"stream.js","sha256":"9038f98acd837cc3183e6fc116bee041839e2ac30b51fcacbda2a309171f2f5a","facadeSource":"extensions/qwen/stream.ts","sources":["extensions/qwen/stream.ts"]},{"output":"video-generation-provider.js","sha256":"005bb73cdd6ba5d7592123579ad489f9e88e00b2fa1d5c771d6f2339fd4b41a6","facadeSource":"extensions/qwen/video-generation-provider.ts","sources":["extensions/qwen/video-generation-provider.ts"]}],"unrenderedSources":["extensions/qwen/api.ts"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { S as QWEN_STANDARD_GLOBAL_BASE_URL } from "./.setup/models-BRg9bCBV.mjs";
|
|
2
|
-
import { describeOpenAiCompatibleVideo } from "openclaw/plugin-sdk/media-understanding";
|
|
3
|
-
//#region extensions/qwen/media-understanding-provider.ts
|
|
4
|
-
const DEFAULT_QWEN_MEDIA_MODEL = "qwen3.6-plus";
|
|
5
|
-
const DEFAULT_QWEN_VIDEO_PROMPT = "Describe the video in detail.";
|
|
6
|
-
function describeQwenVideo(params) {
|
|
7
|
-
return describeOpenAiCompatibleVideo({
|
|
8
|
-
...params,
|
|
9
|
-
defaultBaseUrl: QWEN_STANDARD_GLOBAL_BASE_URL,
|
|
10
|
-
defaultModel: DEFAULT_QWEN_MEDIA_MODEL,
|
|
11
|
-
defaultPrompt: DEFAULT_QWEN_VIDEO_PROMPT,
|
|
12
|
-
provider: "qwen",
|
|
13
|
-
providerLabel: "Qwen"
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function buildQwenMediaUnderstandingProvider() {
|
|
17
|
-
return {
|
|
18
|
-
id: "qwen",
|
|
19
|
-
capabilities: ["image", "video"],
|
|
20
|
-
defaultModels: {
|
|
21
|
-
image: DEFAULT_QWEN_MEDIA_MODEL,
|
|
22
|
-
video: DEFAULT_QWEN_MEDIA_MODEL
|
|
23
|
-
},
|
|
24
|
-
autoPriority: { video: 15 },
|
|
25
|
-
describeImage: void 0,
|
|
26
|
-
describeImages: void 0,
|
|
27
|
-
describeVideo: describeQwenVideo
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
export { buildQwenMediaUnderstandingProvider };
|
package/dist/onboard.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { G as resolveQwenTokenPlanBaseUrl, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, h as QWEN_CN_BASE_URL, k as QWEN_TOKEN_PLAN_PROVIDER_ID, v as QWEN_DEFAULT_MODEL_REF, x as QWEN_STANDARD_CN_BASE_URL, y as QWEN_GLOBAL_BASE_URL } from "./.setup/models-BRg9bCBV.mjs";
|
|
2
|
-
import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
|
|
3
|
-
import { createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
|
-
//#region extensions/qwen/onboard.ts
|
|
5
|
-
const qwenPresetAppliers = createProviderConnectionPresetAppliers({
|
|
6
|
-
primaryModelRef: QWEN_DEFAULT_MODEL_REF,
|
|
7
|
-
resolveParams: (_cfg, baseUrl) => {
|
|
8
|
-
const provider = buildQwenProvider({ baseUrl });
|
|
9
|
-
return {
|
|
10
|
-
providerId: "qwen",
|
|
11
|
-
api: provider.api ?? "openai-completions",
|
|
12
|
-
baseUrl,
|
|
13
|
-
catalogModels: provider.models,
|
|
14
|
-
aliases: [...provider.models.flatMap((model) => [`qwen/${model.id}`, `modelstudio/${model.id}`]), {
|
|
15
|
-
modelRef: QWEN_DEFAULT_MODEL_REF,
|
|
16
|
-
alias: "Qwen"
|
|
17
|
-
}]
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const qwenTokenPlanPresetAppliers = createProviderConnectionPresetAppliers({
|
|
22
|
-
primaryModelRef: QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF,
|
|
23
|
-
resolveParams: (_cfg, baseUrl) => {
|
|
24
|
-
const provider = buildQwenTokenPlanProvider({ baseUrl });
|
|
25
|
-
return {
|
|
26
|
-
providerId: QWEN_TOKEN_PLAN_PROVIDER_ID,
|
|
27
|
-
api: provider.api ?? "openai-completions",
|
|
28
|
-
baseUrl,
|
|
29
|
-
catalogModels: provider.models,
|
|
30
|
-
aliases: [...provider.models.map((model) => `${QWEN_TOKEN_PLAN_PROVIDER_ID}/${model.id}`), {
|
|
31
|
-
modelRef: QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF,
|
|
32
|
-
alias: "Qwen Token Plan"
|
|
33
|
-
}]
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
function applyQwenConfig(cfg) {
|
|
38
|
-
return qwenPresetAppliers.applyConfig(cfg, QWEN_GLOBAL_BASE_URL);
|
|
39
|
-
}
|
|
40
|
-
function applyQwenConfigCn(cfg) {
|
|
41
|
-
return qwenPresetAppliers.applyConfig(cfg, QWEN_CN_BASE_URL);
|
|
42
|
-
}
|
|
43
|
-
function applyQwenStandardConfig(cfg) {
|
|
44
|
-
return qwenPresetAppliers.applyConfig(cfg, QWEN_STANDARD_GLOBAL_BASE_URL);
|
|
45
|
-
}
|
|
46
|
-
function applyQwenStandardConfigCn(cfg) {
|
|
47
|
-
return qwenPresetAppliers.applyConfig(cfg, QWEN_STANDARD_CN_BASE_URL);
|
|
48
|
-
}
|
|
49
|
-
function applyQwenTokenPlanConfig(cfg, region) {
|
|
50
|
-
return qwenTokenPlanPresetAppliers.applyConfig(cfg, resolveQwenTokenPlanBaseUrl(region));
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { applyQwenConfig, applyQwenConfigCn, applyQwenStandardConfig, applyQwenStandardConfigCn, applyQwenTokenPlanConfig };
|