Skip to content

Commit d5c4bd3

Browse files
committed
docs(knowledge): 优化知识库文档内容及CLI说明
- 修改表格/图片知识库必须提供`--doc-id`的描述,更准确表达要求 - 调整CLI命令文档中过期或不准确信息,说明集合删除暂不支持 - 更新chunk添加命令中`--doc-id`的说明,强调对所有知识库类型均必需 - 精简chunk删除命令备注,明确批量操作自动分批处理 - 优化文档删除命令描述,强调删除异步传播及输出行为 - 修正文档状态命令中错误提示用词,更清晰表达 - 文件列表命令修改说明,明确默认分类ID不解析 - 知识库信息命令删除过时备注,突出索引设置不可变 - 服务删除命令简洁描述幂等性和权限要求 - 服务列表命令调整对场景参数的描述,明确必传要求
1 parent eb4f9af commit d5c4bd3

12 files changed

Lines changed: 27 additions & 36 deletions

File tree

docs/knowledge/chunk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bl knowledge chunk add --index-id <id> (--content <text> | --field <k=v>) [flags
2929
| `--field <key=value>` | array | 否¹ | 任意字段键值对(可重复),用于表格/图片知识库,键为 Excel 列名;与 content/title/image 互斥 |
3030

3131
> ¹ `--content`/`--content-file`/`--title`/`--image-url``--field` 互斥,必须提供其一。
32-
> ² 表格/图片知识库必须提供 `--doc-id`,服务端无此字段会返回 HTTP 500(`dataId不能为空`。文档型知识库可选。
32+
> ² 表格/图片知识库必须提供 `--doc-id`。文档型知识库可选。
3333
3434
**参数约束**
3535

docs/knowledge/kb.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ json 模式:返回知识库完整配置 JSON。
110110

111111
**注意事项**
112112

113-
- CLI 通过 `index/list``pipeline_id` 参数精确过滤目标知识库,单次请求即可获取详情。
114113
- 索引设置(向量模型、切片大小等)不可变,修改需重建知识库。
115114

116115
**示例**

docs/knowledge/knowledge-cli-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ bl config set workspace_id ws-xxx
776776

777777
**问题**:没有 `collection delete` 命令。
778778

779-
**原因**服务端无集合删除 API
779+
**原因**暂不支持通过 CLI 删除
780780

781781
**解决**:创建集合需谨慎。如需隔离,创建新集合并迁移文件。
782782

packages/commands/src/commands/knowledge/chunk-add.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const CHUNK_ADD_FLAGS = {
2323
type: "string",
2424
valueHint: "<id>",
2525
description:
26-
"Owning document ID from the doc list command; required in practice — the server returns HTTP 500 (dataId不能为空) without it even for unstructured KBs",
26+
"Owning document ID from the doc list command; required in practice for all knowledge base types",
2727
},
2828
content: {
2929
type: "string",
@@ -74,8 +74,8 @@ export default defineCommand({
7474
flags: CHUNK_ADD_FLAGS,
7575
notes: [
7676
"Document / table / image knowledge bases are supported; audio-video ones are not.",
77-
"--doc-id is required in practice — verified live: even unstructured (document-type) KBs return HTTP 500 (dataId不能为空) without it. Use the document-level id from the doc list command; the per-row doc_id in chunk list metadata is rejected (Index.InvalidParameter).",
78-
"Adding a text content chunk to an image-type document (jpg) triggers HTTP 500 (Index.SystemError) — the server does not support text chunks on image documents. Target a text-type document (docx/pdf/txt) instead.",
77+
"--doc-id is required in practice for all knowledge base types. Use the document-level id from the doc list command; the per-row doc_id in chunk list output is not accepted.",
78+
"Image-type documents do not support text chunks. Target a text-type document (docx/pdf/txt) instead.",
7979
"The API is idempotent but rate-limited to 10 calls per second — throttle batch scripts.",
8080
"The response carries no chunk id; list chunks afterwards to find the new one.",
8181
"For table/image knowledge bases use --field with Excel column headers as keys; values are passed through as strings.",

packages/commands/src/commands/knowledge/chunk-delete.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ export default defineCommand({
4141
auth: "apiKey",
4242
usageArgs: "--index-id <id> --chunk-id <id> [flags]",
4343
flags: CHUNK_DELETE_FLAGS,
44-
notes: [
45-
"The server accepts at most 10 ids per call; larger sets are split into sequential batches automatically.",
46-
"If a batch fails, the operation stops and already-deleted batches are listed in the error.",
47-
],
44+
notes: ["Accepts at most 10 chunk ids per call; larger sets are batched automatically."],
4845
exampleArgs: [
4946
"--index-id idx-xxx --chunk-id chunk-a --chunk-id chunk-b --workspace-id ws-xxx",
5047
"--index-id idx-xxx --chunk-id chunk-a --yes",

packages/commands/src/commands/knowledge/doc-delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export default defineCommand({
4343
notes: [
4444
"Removes documents from the knowledge base index only; the source files remain in the data center.",
4545
"Use the doc_id from `knowledge doc list --quiet`, not the fileId from `knowledge doc upload`. For documents created via `knowledge create --doc-id`, the doc_id equals the fileId; for documents imported via `knowledge doc upload --index-id`, the doc_id may include a workspace suffix.",
46-
"Deletion is asynchronous: the server returns Success immediately, but the document may still appear in `knowledge doc list` for up to ~30s until the change propagates.",
47-
"The output lists the ids actually deleted as reported by the server.",
46+
"Deletion may take up to ~30s to propagate — the document may still appear in the doc list briefly.",
47+
"The output lists the ids actually deleted.",
4848
],
4949
exampleArgs: [
5050
"--index-id idx-xxx --doc-id file-xxx --workspace-id ws-xxx",

packages/commands/src/commands/knowledge/doc-status.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ export default defineCommand({
5757
usageArgs: "--index-id <id> --job-id <id> [flags]",
5858
flags: DOC_STATUS_FLAGS,
5959
notes: [
60-
"Both --index-id and --job-id are required by the server (passing only one returns SystemError).",
61-
"If the server returns SystemError for an idle knowledge base, the job may not exist — check the ingestion id in the document list output.",
62-
"Overall job states are PENDING / RUNNING / COMPLETED; per-document failures (for example PARSE_FAILED) exit non-zero with the server message passed through.",
60+
"Both --index-id and --job-id are required (passing only one returns SystemError).",
61+
"If you see a SystemError, the job may not exist — check the ingestion id in the document list output.",
62+
"Overall job states are PENDING / RUNNING / COMPLETED; per-document failures (for example PARSE_FAILED) exit non-zero with the error message passed through.",
6363
],
6464
exampleArgs: [
6565
"--index-id idx-xxx --job-id job-xxx --workspace-id ws-xxx",

packages/commands/src/commands/knowledge/file-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default defineCommand({
4545
usageArgs: "--category-id <id> [flags]",
4646
flags: FILE_LIST_FLAGS,
4747
notes: [
48-
"The server requires a real category id here — unlike upload APIs, the literal default is NOT resolved (returns an empty list). Find the id via file details of any uploaded file, or the category list command.",
48+
"A real category id is required — the default value is not resolved here. Find the id via the category list command.",
4949
"Pagination is cursor-based: reuse the printed next token to continue.",
5050
],
5151
exampleArgs: [

packages/commands/src/commands/knowledge/kb-info.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ export default defineCommand({
6565
auth: "apiKey",
6666
usageArgs: "--index-id <id> [flags]",
6767
flags: KB_INFO_FLAGS,
68-
notes: [
69-
"Uses the index/list API with pipeline_id filtering to fetch a single knowledge base.",
70-
"Indexing settings are immutable; changing them requires recreating the knowledge base.",
71-
],
68+
notes: ["Indexing settings are immutable; changing them requires recreating the knowledge base."],
7269
exampleArgs: ["--index-id idx-xxx --workspace-id ws-xxx"],
7370
async run(ctx) {
7471
const { settings, flags } = ctx;

packages/commands/src/commands/knowledge/service-delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default defineCommand({
5858
flags: SERVICE_DELETE_FLAGS,
5959
notes: [
6060
"Deletion cannot be undone; the agent_id becomes unusable for search and chat calls.",
61-
"The API is idempotent — deleting an already-deleted service does not fail.",
61+
"Idempotent — deleting an already-deleted service does not fail.",
6262
"Requires the knowledge-base delete permission in the workspace.",
6363
],
6464
exampleArgs: ["--agent-id aid-xxx --workspace-id ws-xxx", "--agent-id aid-xxx --yes"],

0 commit comments

Comments
 (0)