@modelstudio/modelstudio-memory-for-openclaw 1.0.0 → 1.0.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 +5 -13
- package/index.ts +2 -10
- package/openclaw.plugin.json +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ openclaw modelstudio-memory stats
|
|
|
57
57
|
enabled: true,
|
|
58
58
|
config: {
|
|
59
59
|
// 必需配置
|
|
60
|
-
"apiKey": "
|
|
60
|
+
"apiKey": "your-dashscope-api-key",
|
|
61
61
|
"userId": "user_001",
|
|
62
62
|
|
|
63
63
|
// 可选配置(以下为默认值)
|
|
@@ -80,7 +80,7 @@ openclaw modelstudio-memory stats
|
|
|
80
80
|
|
|
81
81
|
| 配置项 | 类型 | 必需 | 默认值 | 说明 |
|
|
82
82
|
|--------|------|------|--------|------|
|
|
83
|
-
| `apiKey` | `string` | ✅ | - | DashScope API Key
|
|
83
|
+
| `apiKey` | `string` | ✅ | - | DashScope API Key(在 openclaw.json 中配置) |
|
|
84
84
|
| `userId` | `string` | ✅ | - | 用户 ID,用于隔离不同用户的记忆 |
|
|
85
85
|
| `baseUrl` | `string` | ❌ | `https://dashscope.aliyuncs.com/api/v2/apps/memory` | API endpoint(私有部署时填写完整 URL) |
|
|
86
86
|
| `autoCapture` | `boolean` | ❌ | `true` | 是否自动捕获对话 |
|
|
@@ -91,17 +91,9 @@ openclaw modelstudio-memory stats
|
|
|
91
91
|
| `recallMinPromptLength` | `number` | ❌ | `10` | 触发自动召回的最小 prompt 长度 |
|
|
92
92
|
| `recallCacheTtlMs` | `number` | ❌ | `300000` | 召回缓存时间(毫秒),0 禁用缓存 |
|
|
93
93
|
|
|
94
|
-
##
|
|
94
|
+
## 获取 API Key
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
# 设置 DashScope API Key
|
|
98
|
-
export DASHSCOPE_API_KEY="your-api-key"
|
|
99
|
-
|
|
100
|
-
# 重启 Gateway
|
|
101
|
-
openclaw gateway restart
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
获取 API Key:https://help.aliyun.com/zh/model-studio/get-api-key
|
|
96
|
+
在 [阿里云百炼控制台](https://help.aliyun.com/zh/model-studio/get-api-key) 获取 DashScope API Key,并在 `openclaw.json` 的 `config.apiKey` 中配置。
|
|
105
97
|
|
|
106
98
|
## 使用方法
|
|
107
99
|
|
|
@@ -230,7 +222,7 @@ tail -f ~/.openclaw/logs/gateway.log | grep modelstudio-memory
|
|
|
230
222
|
|
|
231
223
|
| 错误 | 原因 | 解决方案 |
|
|
232
224
|
|------|------|----------|
|
|
233
|
-
| `apiKey is required` | 未配置 API Key |
|
|
225
|
+
| `apiKey is required` | 未配置 API Key | 在 openclaw.json 的 config 中配置 apiKey |
|
|
234
226
|
| `InvalidApiKey` | API Key 无效 | 检查 API Key 是否正确 |
|
|
235
227
|
| `TooManyRequests` | 请求频率过高 | 降低调用频率 |
|
|
236
228
|
|
package/index.ts
CHANGED
|
@@ -80,14 +80,6 @@ const ALLOWED_KEYS = [
|
|
|
80
80
|
"recallCacheTtlMs",
|
|
81
81
|
];
|
|
82
82
|
|
|
83
|
-
function resolveEnvVars(value: string): string {
|
|
84
|
-
if (!value) return value;
|
|
85
|
-
return value.replace(/\$\{([^}]+)\}/g, (_, key) => {
|
|
86
|
-
const envValue = process.env[key];
|
|
87
|
-
return envValue || "";
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
83
|
function assertAllowedKeys(
|
|
92
84
|
value: Record<string, unknown>,
|
|
93
85
|
allowed: string[],
|
|
@@ -106,8 +98,8 @@ const modelstudioMemoryConfigSchema = {
|
|
|
106
98
|
const cfg = value as Record<string, unknown>;
|
|
107
99
|
assertAllowedKeys(cfg, ALLOWED_KEYS, "modelstudio-memory-for-openclaw config");
|
|
108
100
|
|
|
109
|
-
// apiKey is required
|
|
110
|
-
const apiKey = typeof cfg.apiKey === "string" ?
|
|
101
|
+
// apiKey is required (plain text in openclaw.json)
|
|
102
|
+
const apiKey = typeof cfg.apiKey === "string" ? cfg.apiKey : "";
|
|
111
103
|
if (!apiKey) {
|
|
112
104
|
throw new Error("apiKey is required for modelstudio-memory-for-openclaw");
|
|
113
105
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"name": "modelstudio-memory-for-openclaw",
|
|
4
4
|
"description": "阿里云百炼长期记忆服务,提供自动记忆捕获和召回能力",
|
|
5
5
|
"kind": "memory",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.1",
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"additionalProperties": false,
|
|
10
10
|
"properties": {
|
|
11
11
|
"apiKey": {
|
|
12
12
|
"type": "string",
|
|
13
|
-
"description": "DashScope API Key
|
|
13
|
+
"description": "DashScope API Key"
|
|
14
14
|
},
|
|
15
15
|
"userId": {
|
|
16
16
|
"type": "string",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"apiKey": {
|
|
63
63
|
"label": "API Key",
|
|
64
64
|
"sensitive": true,
|
|
65
|
-
"placeholder": "
|
|
65
|
+
"placeholder": "sk-..."
|
|
66
66
|
},
|
|
67
67
|
"userId": {
|
|
68
68
|
"label": "用户 ID",
|