类class
agentscope.app.storageKnowledgeDocumentData
class KnowledgeDocumentData(BaseModel)
源码Source
agentscope/app/storage/_model/_knowledge_document.py:42–99可变负载的知识库文档类。位于 agentscope.app.storage 包。
Groups the non-relational, non-indexed fields of the document.
The lifecycle keys (status / lease_expires_at) live at
the :class:KnowledgeDocumentRecord top level so the sweeper can
query them via indexed columns without touching this payload.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
filename | str | `filename` 字段。 | Field(description='Original filename supplied by the uploader.') |
size | int | 大小字段。 | Field(ge=0, description='Document size in bytes as observed at upload time.') |
content_type | str | None | 内容类型字段。 | Field(default=None, description='IANA media type used to route the upload to a parser.') |
blob_uri | str | 二进制对象 URI字段。 | Field(description='URI returned by the blob store after the upload was streamed in (e.g. ``local://kb/.../uuid``).') |
error | str | None | 错误字段。 | Field(default=None, description="Human-readable failure reason when ``status == 'error'``. MUST NOT include stack traces or filesystem paths — it is rendered verbatim in the UI.") |
chunk_count | int | 分块数量字段。 | Field(default=0, ge=0, description='Number of chunks successfully indexed.') |
属性详情Attribute Detail
filename
str = Field(description='Original filename supplied by the uploader.')filename 字段。声明为 str。
Original filename supplied by the uploader.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:51size
int = Field(ge=0, description='Document size in bytes as observed at upload time.')大小字段。声明为 int。
Document size in bytes as observed at upload time.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:57content_type
str | None = Field(default=None, description='IANA media type used to route the upload to a parser.')内容类型字段。声明为 str | None。
IANA media type used to route the upload to a parser.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:65blob_uri
str = Field(description='URI returned by the blob store after the upload was streamed in (e.g. ``local://kb/.../uuid``).')二进制对象 URI字段。声明为 str。
URI returned by the blob store after the upload was streamed in (e.g.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:72error
str | None = Field(default=None, description="Human-readable failure reason when ``status == 'error'``. MUST NOT include stack traces or filesystem paths — it is rendered verbatim in the UI.")错误字段。声明为 str | None。
Human-readable failure reason when status == 'error'.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:82chunk_count
int = Field(default=0, ge=0, description='Number of chunks successfully indexed.')分块数量字段。声明为 int。
Number of chunks successfully indexed.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:93