AS AgentScopeAPI 手册 / API Reference
类class agentscope.app.storage

KnowledgeDocumentData

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
filenamestr
`filename` 字段。
Field(description='Original filename supplied by the uploader.')
sizeint
大小字段。
Field(ge=0, description='Document size in bytes as observed at upload time.')
content_typestr | None
内容类型字段。
Field(default=None, description='IANA media type used to route the upload to a parser.')
blob_uristr
二进制对象 URI字段。
Field(description='URI returned by the blob store after the upload was streamed in (e.g. ``local://kb/.../uuid``).')
errorstr | 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_countint
分块数量字段。
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:51

size

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:57

content_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:65

blob_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:72

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.")

错误字段。声明为 str | None。

Human-readable failure reason when status == 'error'.

源码Source agentscope/app/storage/_model/_knowledge_document.py:82

chunk_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
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.