@openclaw/qianfan-provider 0.0.0 → 2026.6.9-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/README.md +11 -2
- package/dist/api.js +3 -0
- package/dist/index.js +26 -0
- package/dist/onboard.js +39 -0
- package/dist/provider-catalog-CFKdseZa.js +48 -0
- package/dist/provider-catalog.js +2 -0
- package/npm-shrinkwrap.json +12 -0
- package/openclaw.plugin.json +78 -0
- package/package.json +44 -8
package/README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenClaw Qianfan Provider
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official OpenClaw provider plugin for Qianfan.
|
|
4
|
+
|
|
5
|
+
Install from OpenClaw:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
openclaw plugins install @openclaw/qianfan-provider
|
|
9
|
+
openclaw gateway restart
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
See <https://docs.openclaw.ai/providers/qianfan> for setup and configuration.
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as QIANFAN_DEFAULT_MODEL_ID, r as buildQianfanProvider, t as QIANFAN_BASE_URL } from "./provider-catalog-CFKdseZa.js";
|
|
2
|
+
import { QIANFAN_DEFAULT_MODEL_REF } from "./onboard.js";
|
|
3
|
+
export { QIANFAN_BASE_URL, QIANFAN_DEFAULT_MODEL_ID, QIANFAN_DEFAULT_MODEL_REF, buildQianfanProvider };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as buildQianfanProvider } from "./provider-catalog-CFKdseZa.js";
|
|
2
|
+
import { QIANFAN_DEFAULT_MODEL_REF, applyQianfanConfig } from "./onboard.js";
|
|
3
|
+
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
4
|
+
var qianfan_default = defineSingleProviderPluginEntry({
|
|
5
|
+
id: "qianfan",
|
|
6
|
+
name: "Qianfan Provider",
|
|
7
|
+
description: "Bundled Qianfan provider plugin",
|
|
8
|
+
provider: {
|
|
9
|
+
label: "Qianfan",
|
|
10
|
+
docsPath: "/providers/qianfan",
|
|
11
|
+
auth: [{
|
|
12
|
+
methodId: "api-key",
|
|
13
|
+
label: "Qianfan API key",
|
|
14
|
+
hint: "API key",
|
|
15
|
+
optionKey: "qianfanApiKey",
|
|
16
|
+
flagName: "--qianfan-api-key",
|
|
17
|
+
envVar: "QIANFAN_API_KEY",
|
|
18
|
+
promptMessage: "Enter Qianfan API key",
|
|
19
|
+
defaultModel: QIANFAN_DEFAULT_MODEL_REF,
|
|
20
|
+
applyConfig: (cfg) => applyQianfanConfig(cfg)
|
|
21
|
+
}],
|
|
22
|
+
catalog: { buildProvider: buildQianfanProvider }
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { qianfan_default as default };
|
package/dist/onboard.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { n as QIANFAN_DEFAULT_MODEL_ID, r as buildQianfanProvider } from "./provider-catalog-CFKdseZa.js";
|
|
2
|
+
import { createDefaultModelsPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
|
+
//#region extensions/qianfan/onboard.ts
|
|
4
|
+
const QIANFAN_DEFAULT_MODEL_REF = `qianfan/${QIANFAN_DEFAULT_MODEL_ID}`;
|
|
5
|
+
function resolveQianfanPreset(cfg) {
|
|
6
|
+
const defaultProvider = buildQianfanProvider();
|
|
7
|
+
const existingProvider = cfg.models?.providers?.qianfan;
|
|
8
|
+
const existingBaseUrl = typeof existingProvider?.baseUrl === "string" ? existingProvider.baseUrl.trim() : "";
|
|
9
|
+
return {
|
|
10
|
+
api: typeof existingProvider?.api === "string" ? existingProvider.api : "openai-completions",
|
|
11
|
+
baseUrl: existingBaseUrl || "https://qianfan.baidubce.com/v2",
|
|
12
|
+
defaultModels: defaultProvider.models ?? []
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const qianfanPresetAppliers = createDefaultModelsPresetAppliers({
|
|
16
|
+
primaryModelRef: QIANFAN_DEFAULT_MODEL_REF,
|
|
17
|
+
resolveParams: (cfg) => {
|
|
18
|
+
const preset = resolveQianfanPreset(cfg);
|
|
19
|
+
return {
|
|
20
|
+
providerId: "qianfan",
|
|
21
|
+
api: preset.api,
|
|
22
|
+
baseUrl: preset.baseUrl,
|
|
23
|
+
defaultModels: preset.defaultModels,
|
|
24
|
+
defaultModelId: QIANFAN_DEFAULT_MODEL_ID,
|
|
25
|
+
aliases: [{
|
|
26
|
+
modelRef: QIANFAN_DEFAULT_MODEL_REF,
|
|
27
|
+
alias: "QIANFAN"
|
|
28
|
+
}]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function applyQianfanProviderConfig(cfg) {
|
|
33
|
+
return qianfanPresetAppliers.applyProviderConfig(cfg);
|
|
34
|
+
}
|
|
35
|
+
function applyQianfanConfig(cfg) {
|
|
36
|
+
return qianfanPresetAppliers.applyConfig(cfg);
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { QIANFAN_DEFAULT_MODEL_REF, applyQianfanConfig, applyQianfanProviderConfig };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
//#region extensions/qianfan/openclaw.plugin.json
|
|
3
|
+
var modelCatalog = {
|
|
4
|
+
"providers": { "qianfan": {
|
|
5
|
+
"baseUrl": "https://qianfan.baidubce.com/v2",
|
|
6
|
+
"api": "openai-completions",
|
|
7
|
+
"models": [{
|
|
8
|
+
"id": "deepseek-v3.2",
|
|
9
|
+
"name": "DEEPSEEK V3.2",
|
|
10
|
+
"input": ["text"],
|
|
11
|
+
"reasoning": true,
|
|
12
|
+
"contextWindow": 98304,
|
|
13
|
+
"maxTokens": 32768,
|
|
14
|
+
"cost": {
|
|
15
|
+
"input": 0,
|
|
16
|
+
"output": 0,
|
|
17
|
+
"cacheRead": 0,
|
|
18
|
+
"cacheWrite": 0
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
"id": "ernie-5.0-thinking-preview",
|
|
22
|
+
"name": "ERNIE-5.0-Thinking-Preview",
|
|
23
|
+
"input": ["text", "image"],
|
|
24
|
+
"reasoning": true,
|
|
25
|
+
"contextWindow": 119e3,
|
|
26
|
+
"maxTokens": 64e3,
|
|
27
|
+
"cost": {
|
|
28
|
+
"input": 0,
|
|
29
|
+
"output": 0,
|
|
30
|
+
"cacheRead": 0,
|
|
31
|
+
"cacheWrite": 0
|
|
32
|
+
}
|
|
33
|
+
}]
|
|
34
|
+
} },
|
|
35
|
+
"discovery": { "qianfan": "static" }
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region extensions/qianfan/provider-catalog.ts
|
|
39
|
+
const QIANFAN_BASE_URL = "https://qianfan.baidubce.com/v2";
|
|
40
|
+
const QIANFAN_DEFAULT_MODEL_ID = "deepseek-v3.2";
|
|
41
|
+
function buildQianfanProvider() {
|
|
42
|
+
return buildManifestModelProviderConfig({
|
|
43
|
+
providerId: "qianfan",
|
|
44
|
+
catalog: modelCatalog.providers.qianfan
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { QIANFAN_DEFAULT_MODEL_ID as n, buildQianfanProvider as r, QIANFAN_BASE_URL as t };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "qianfan",
|
|
3
|
+
"activation": {
|
|
4
|
+
"onStartup": false
|
|
5
|
+
},
|
|
6
|
+
"enabledByDefault": true,
|
|
7
|
+
"providers": ["qianfan"],
|
|
8
|
+
"setup": {
|
|
9
|
+
"providers": [
|
|
10
|
+
{
|
|
11
|
+
"id": "qianfan",
|
|
12
|
+
"authMethods": ["api-key"],
|
|
13
|
+
"envVars": ["QIANFAN_API_KEY"]
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"modelCatalog": {
|
|
18
|
+
"providers": {
|
|
19
|
+
"qianfan": {
|
|
20
|
+
"baseUrl": "https://qianfan.baidubce.com/v2",
|
|
21
|
+
"api": "openai-completions",
|
|
22
|
+
"models": [
|
|
23
|
+
{
|
|
24
|
+
"id": "deepseek-v3.2",
|
|
25
|
+
"name": "DEEPSEEK V3.2",
|
|
26
|
+
"input": ["text"],
|
|
27
|
+
"reasoning": true,
|
|
28
|
+
"contextWindow": 98304,
|
|
29
|
+
"maxTokens": 32768,
|
|
30
|
+
"cost": {
|
|
31
|
+
"input": 0,
|
|
32
|
+
"output": 0,
|
|
33
|
+
"cacheRead": 0,
|
|
34
|
+
"cacheWrite": 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "ernie-5.0-thinking-preview",
|
|
39
|
+
"name": "ERNIE-5.0-Thinking-Preview",
|
|
40
|
+
"input": ["text", "image"],
|
|
41
|
+
"reasoning": true,
|
|
42
|
+
"contextWindow": 119000,
|
|
43
|
+
"maxTokens": 64000,
|
|
44
|
+
"cost": {
|
|
45
|
+
"input": 0,
|
|
46
|
+
"output": 0,
|
|
47
|
+
"cacheRead": 0,
|
|
48
|
+
"cacheWrite": 0
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"discovery": {
|
|
55
|
+
"qianfan": "static"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"providerAuthChoices": [
|
|
59
|
+
{
|
|
60
|
+
"provider": "qianfan",
|
|
61
|
+
"method": "api-key",
|
|
62
|
+
"choiceId": "qianfan-api-key",
|
|
63
|
+
"choiceLabel": "Qianfan API key",
|
|
64
|
+
"groupId": "qianfan",
|
|
65
|
+
"groupLabel": "Qianfan",
|
|
66
|
+
"groupHint": "API key",
|
|
67
|
+
"optionKey": "qianfanApiKey",
|
|
68
|
+
"cliFlag": "--qianfan-api-key",
|
|
69
|
+
"cliOption": "--qianfan-api-key <key>",
|
|
70
|
+
"cliDescription": "QIANFAN API key"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"configSchema": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"properties": {}
|
|
77
|
+
}
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/qianfan-provider",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "MIT",
|
|
3
|
+
"version": "2026.6.9-beta.1",
|
|
4
|
+
"description": "OpenClaw Qianfan provider plugin.",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
|
-
"url": "
|
|
7
|
+
"url": "https://github.com/openclaw/openclaw"
|
|
9
8
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
9
|
+
"type": "module",
|
|
10
|
+
"openclaw": {
|
|
11
|
+
"extensions": [
|
|
12
|
+
"./index.ts"
|
|
13
|
+
],
|
|
14
|
+
"install": {
|
|
15
|
+
"clawhubSpec": "clawhub:@openclaw/qianfan-provider",
|
|
16
|
+
"npmSpec": "@openclaw/qianfan-provider",
|
|
17
|
+
"defaultChoice": "npm",
|
|
18
|
+
"minHostVersion": ">=2026.6.8"
|
|
19
|
+
},
|
|
20
|
+
"compat": {
|
|
21
|
+
"pluginApi": ">=2026.6.9-beta.1"
|
|
22
|
+
},
|
|
23
|
+
"build": {
|
|
24
|
+
"openclawVersion": "2026.6.9-beta.1",
|
|
25
|
+
"bundledDist": false
|
|
26
|
+
},
|
|
27
|
+
"release": {
|
|
28
|
+
"publishToClawHub": true,
|
|
29
|
+
"publishToNpm": true
|
|
30
|
+
},
|
|
31
|
+
"runtimeExtensions": [
|
|
32
|
+
"./dist/index.js"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/**",
|
|
37
|
+
"openclaw.plugin.json",
|
|
38
|
+
"npm-shrinkwrap.json",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"openclaw": ">=2026.6.9-beta.1"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"openclaw": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"bundledDependencies": []
|
|
14
50
|
}
|