Skip to content

Commit 47704d4

Browse files
committed
refactor: update memory library parameter naming and documentation
- Changed the parameter name from `--memory-library-id` to `--library-id` across all relevant commands and documentation. - Updated examples and test cases to reflect the new parameter name. - Ensured consistency in the CLI interface and improved clarity in the user guide and command references.
1 parent 6658652 commit 47704d4

29 files changed

Lines changed: 343 additions & 328 deletions

‎docs/memory/cli-matrix.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040

4141
## 范围参数矩阵
4242

43-
| 命令 | `--user-id` | `--memory-library-id` | `--project-id` |
44-
| ---------------------------------------- | ------------------------------ | --------------------- | ------------------------------------------- |
45-
| `add` | 必填 | 可选 | 内容直存最多 1 个;消息抽取最多 5 个 |
46-
| `search` | 必填 | 可选 | 可重复;CLI 未实现与 add 相同的数量上限校验 |
47-
| `list` | 必填 | 可选 | 单个;省略仅查询默认规则 |
48-
| `update` / `delete` | 兼容参数,已弃用且不发给服务端 | 可选 | 不支持,按节点 ID 定位 |
49-
| `node show` / `skill export` | 不支持 | 不支持 | 不支持,按节点 ID 定位 |
50-
| `profile create/list/show/update/delete` | 不支持 | 可选 | 不支持 |
51-
| `profile get` | 必填 | 可选 | 不支持,按模板 ID 定位 |
43+
| 命令 | `--user-id` | `--library-id` | `--project-id` |
44+
| ---------------------------------------- | ------------------------------ | -------------- | ------------------------------------------- |
45+
| `add` | 必填 | 可选 | 内容直存最多 1 个;消息抽取最多 5 个 |
46+
| `search` | 必填 | 可选 | 可重复;CLI 未实现与 add 相同的数量上限校验 |
47+
| `list` | 必填 | 可选 | 单个;省略仅查询默认规则 |
48+
| `update` / `delete` | 兼容参数,已弃用且不发给服务端 | 可选 | 不支持,按节点 ID 定位 |
49+
| `node show` / `skill export` | 不支持 | 不支持 | 不支持,按节点 ID 定位 |
50+
| `profile create/list/show/update/delete` | 不支持 | 可选 | 不支持 |
51+
| `profile get` | 必填 | 可选 | 不支持,按模板 ID 定位 |
5252

5353
`--workspace-id` 对全部命令有效;也可从 `BAILIAN_WORKSPACE_ID` 或配置 `workspace_id` 获取。记忆库参数省略时使用账号默认记忆库。不要给未声明范围参数的命令追加这些参数。
5454

‎docs/memory/memory-cli-matrix.md‎

Lines changed: 160 additions & 160 deletions
Large diffs are not rendered by default.

‎docs/memory/user-guide.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| 对象 | 用途 | 标识 |
1010
| ------------------ | ----------------------------------------- | ------------------------------------------------------------------- |
1111
| Workspace | 选择 Memory API 所在工作空间 | `--workspace-id` |
12-
| 记忆库 | 指定记忆数据所在库;省略用账号默认库 | `--memory-library-id` |
12+
| 记忆库 | 指定记忆数据所在库;省略用账号默认库 | `--library-id` |
1313
| 记忆实体 | 业务中的用户或其他记忆归属对象 | `--user-id` |
1414
| 片段规则 / project | 决定抽取规则及 observation / skill 等类型 | `--project-id` |
1515
| 记忆节点 | 一条事实或技能记忆 | 返回的 `memory_node_id`,用于 `--node-id` |
@@ -47,7 +47,7 @@ bl config set workspace_id '<your-workspace-id>'
4747

4848
当前实现按 Workspace 构造北京区绝对地址 `https://<workspace-id>.cn-beijing.maas.aliyuncs.com`。通用 `--base-url` 不能用来切换这组命令的 Workspace 网关。
4949

50-
以下示例使用默认记忆库;若使用指定库,在支持的命令中始终传同一个 `--memory-library-id`。`node show` 和 `skill export` 仅通过节点 ID 定位,不接受记忆库参数。
50+
以下示例使用默认记忆库;若使用指定库,在支持的命令中始终传同一个 `--library-id`。`node show` 和 `skill export` 仅通过节点 ID 定位,不接受记忆库参数。
5151

5252
## 3. 写入并读取第一条记忆
5353

@@ -268,7 +268,7 @@ bl memory skill export --node-id '<skill-node-id>' --output json > meeting-summa
268268

269269
| 参数 | 约束 |
270270
| ----------------------------------- | ------------------------------------------- |
271-
| user-id / memory-library-id | 最长 64 / 32 |
271+
| user-id / library-id | 最长 64 / 32 |
272272
| add/update 的 content | 最长 512 |
273273
| add 的 messages | 最多 50 条 |
274274
| add 的 project-id | 内容直存最多 1 个,消息抽取最多 5 个 |

‎packages/commands/src/commands/memory/add.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default defineCommand({
141141
if (flags.metaData) body.meta_data = parseJsonObjectFlag("--meta-data", flags.metaData);
142142
if (flags.profileSchema) body.profile_schema = flags.profileSchema;
143143
if (flags.projectId) body.project_id = flags.projectId;
144-
if (flags.memoryLibraryId) body.memory_library_id = flags.memoryLibraryId;
144+
if (flags.libraryId) body.memory_library_id = flags.libraryId;
145145

146146
const format = detectOutputFormat(settings.output);
147147
const url = memoryEndpoint(resolveWorkspaceId(ctx), memoryAddPath());

‎packages/commands/src/commands/memory/delete.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default defineCommand({
6767
const format = detectOutputFormat(settings.output);
6868
const url =
6969
memoryEndpoint(resolveWorkspaceId(ctx), memoryNodePath(nodeId)) +
70-
buildQuery({ user_id: flags.userId, memory_library_id: flags.memoryLibraryId });
70+
buildQuery({ user_id: flags.userId, memory_library_id: flags.libraryId });
7171

7272
if (settings.dryRun) {
7373
emitResult({ endpoint: url, method: "DELETE" }, format);

‎packages/commands/src/commands/memory/list.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default defineCommand({
5151
exampleArgs: [
5252
"--user-id user1 --workspace-id ws_xxx",
5353
"--user-id user1 --page-size 20 --page 2",
54-
"--user-id user1 --memory-library-id lib_xxx --output json",
54+
"--user-id user1 --library-id lib_xxx --output json",
5555
],
5656
validate: (flags) => {
5757
const scopeError = checkMemoryScopeLengths(flags);
@@ -72,7 +72,7 @@ export default defineCommand({
7272
page_size: flags.pageSize,
7373
page_num: flags.page,
7474
project_id: flags.projectId,
75-
memory_library_id: flags.memoryLibraryId,
75+
memory_library_id: flags.libraryId,
7676
});
7777

7878
if (settings.dryRun) {

‎packages/commands/src/commands/memory/profile-create.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export default defineCommand({
7575
},
7676
{
7777
"en-US":
78-
'--name "user_basic" --attributes \'[{"name":"age"}]\' --plan-version lite --memory-library-id lib_xxx',
78+
'--name "user_basic" --attributes \'[{"name":"age"}]\' --plan-version lite --library-id lib_xxx',
7979
"zh-CN":
80-
'--name "user_basic" --attributes \'[{"name":"age"}]\' --plan-version lite --memory-library-id lib_xxx',
80+
'--name "user_basic" --attributes \'[{"name":"age"}]\' --plan-version lite --library-id lib_xxx',
8181
},
8282
],
8383
validate: (flags) =>
@@ -98,7 +98,7 @@ export default defineCommand({
9898
const body: ProfileSchemaCreateRequest = { name: flags.name, attributes };
9999
if (flags.description) body.description = flags.description;
100100
if (flags.planVersion) body.plan_version = flags.planVersion as MemoryPlanVersion;
101-
if (flags.memoryLibraryId) body.memory_library_id = flags.memoryLibraryId;
101+
if (flags.libraryId) body.memory_library_id = flags.libraryId;
102102

103103
const format = detectOutputFormat(settings.output);
104104
const url = memoryEndpoint(resolveWorkspaceId(ctx), profileSchemaPath());

‎packages/commands/src/commands/memory/profile-delete.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default defineCommand({
6262
const format = detectOutputFormat(settings.output);
6363
const url =
6464
memoryEndpoint(resolveWorkspaceId(ctx), profileSchemaItemPath(flags.schemaId)) +
65-
buildQuery({ memory_library_id: flags.memoryLibraryId });
65+
buildQuery({ memory_library_id: flags.libraryId });
6666

6767
if (settings.dryRun) {
6868
emitResult({ endpoint: url, method: "DELETE" }, format);

‎packages/commands/src/commands/memory/profile-get.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default defineCommand({
6464
const format = detectOutputFormat(settings.output);
6565
const url =
6666
memoryEndpoint(resolveWorkspaceId(ctx), userProfilePath(flags.schemaId)) +
67-
buildQuery({ user_id: flags.userId, memory_library_id: flags.memoryLibraryId });
67+
buildQuery({ user_id: flags.userId, memory_library_id: flags.libraryId });
6868

6969
if (settings.dryRun) {
7070
emitResult({ endpoint: url, method: "GET" }, format);

‎packages/commands/src/commands/memory/profile-list.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default defineCommand({
4040
exampleArgs: [
4141
"--workspace-id ws_xxx",
4242
"--page-size 20 --page 2",
43-
"--memory-library-id lib_xxx --output json",
43+
"--library-id lib_xxx --output json",
4444
],
4545
validate: (flags) => {
4646
const scopeError = checkMemoryScopeLengths(flags);
@@ -59,7 +59,7 @@ export default defineCommand({
5959
buildQuery({
6060
page_size: flags.pageSize,
6161
page_num: flags.page,
62-
memory_library_id: flags.memoryLibraryId,
62+
memory_library_id: flags.libraryId,
6363
});
6464

6565
if (settings.dryRun) {

0 commit comments

Comments
 (0)