Skip to content

Commit 30f7525

Browse files
committed
docs(commands): 更新知识库分块命令中 --doc-id 的描述和注意事项
- 说明 --doc-id 在实际使用中为必需,避免服务器返回 HTTP 500 错误 - 明确指出应使用 doc list 命令中的文档级别 ID,拒绝使用 chunk list 中的每行 doc_id - 新增说明向图片类型文档添加文本块会触发服务器错误,建议使用文本类型文档 - 对帮助文档中相关描述和备注进行了同步更新,增强使用指导性和准确性
1 parent aa38d5c commit 30f7525

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 2 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; required for table/image knowledge bases (the server rejects field-channel chunks without it), optional for document-type",
26+
"Owning document ID from the doc list command; required in practice — the server returns HTTP 500 (dataId不能为空) without it even for unstructured KBs",
2727
},
2828
content: {
2929
type: "string",
@@ -74,7 +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-
"Table/image knowledge bases require --doc-id — verified live: the server returns 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).",
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.",
7879
"The API is idempotent but rate-limited to 10 calls per second — throttle batch scripts.",
7980
"The response carries no chunk id; list chunks afterwards to find the new one.",
8081
"For table/image knowledge bases use --field with Excel column headers as keys; values are passed through as strings.",

skills/bailian-cli/reference/knowledge.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ bl knowledge chat --message "Describe these images" --image https://example.com/
206206
| Flag | Type | Required | Description |
207207
| ----------------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
208208
| `--index-id <id>` | string | yes | Knowledge base ID |
209-
| `--doc-id <id>` | string | no | Owning document ID; required for table/image knowledge bases (the server rejects field-channel chunks without it), optional for document-type |
209+
| `--doc-id <id>` | string | no | Owning document ID from the doc list command; required in practice — the server returns HTTP 500 (dataId不能为空) without it even for unstructured KBs |
210210
| `--content <text>` | string | no | Chunk body text, up to 6000 chars (document-type); alternative to --content-file |
211211
| `--content-file <path>` | string | no | Read chunk body from a UTF-8 plain text file (.md/.txt etc.) |
212212
| `--title <text>` | string | no | Chunk title, up to 50 chars (document-type) |
@@ -219,7 +219,8 @@ bl knowledge chat --message "Describe these images" --image https://example.com/
219219
#### Notes
220220

221221
- Document / table / image knowledge bases are supported; audio-video ones are not.
222-
- Table/image knowledge bases require --doc-id — verified live: the server returns 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).
222+
- --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).
223+
- 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.
223224
- The API is idempotent but rate-limited to 10 calls per second — throttle batch scripts.
224225
- The response carries no chunk id; list chunks afterwards to find the new one.
225226
- For table/image knowledge bases use --field with Excel column headers as keys; values are passed through as strings.

0 commit comments

Comments
 (0)