类class
agentscope.app.storageKnowledgeDocumentRecord
class KnowledgeDocumentRecord(_RecordBase)
源码Source
agentscope/app/storage/_model/_knowledge_document.py:102–202知识库文档记录,在多次调用之间保存和恢复会话与记忆数据。位于 agentscope.app.storage 包,继承自 _RecordBase。
Top-level fields are relational keys AND the lifecycle keys the
storage backend must index on directly (per-user listing, per-KB
listing, per-node lease sweeps, status-based sweeps); the
remaining mutable payload lives in :attr:data.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
user_id | str | 所有者用户标识。 | Field(description='The owner user id.') |
knowledge_base_id | str | 知识库标识字段。 | Field(description='The id of the knowledge base this document belongs to.') |
processing_node | str | None | `processing_node` 字段。 | Field(default=None, description='Identifier of the worker process that currently holds the lease on this document. ``None`` if no worker is processing it.') |
status | KnowledgeDocumentStatus | 状态字段。 | Field(default='pending', description='Current lifecycle state.') |
lease_expires_at | datetime | None | `lease_expires_at` 字段。 | Field(default=None, description='Wall-clock deadline for the worker that currently holds this document. ``None`` if no worker is processing it.') |
data | KnowledgeDocumentData | 数据字段。 | — |
属性详情Attribute Detail
user_id
str = Field(description='The owner user id.')所有者用户标识。
The owner user id.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:111knowledge_base_id
str = Field(description='The id of the knowledge base this document belongs to.')知识库标识字段。声明为 str。
The id of the knowledge base this document belongs to.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:114processing_node
str | None = Field(default=None, description='Identifier of the worker process that currently holds the lease on this document. ``None`` if no worker is processing it.')processing_node 字段。声明为 str | None。
Identifier of the worker process that currently holds the lease on this document.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:119status
KnowledgeDocumentStatus = Field(default='pending', description='Current lifecycle state.')状态字段。声明为 KnowledgeDocumentStatus。
Current lifecycle state.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:131lease_expires_at
datetime | None = Field(default=None, description='Wall-clock deadline for the worker that currently holds this document. ``None`` if no worker is processing it.')lease_expires_at 字段。声明为 datetime | None。
Wall-clock deadline for the worker that currently holds this document.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:140data
KnowledgeDocumentData数据字段。声明为 KnowledgeDocumentData。
The data field.
源码Source
agentscope/app/storage/_model/_knowledge_document.py:152