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

KnowledgeDocumentRecord

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_idstr
所有者用户标识。
Field(description='The owner user id.')
knowledge_base_idstr
知识库标识字段。
Field(description='The id of the knowledge base this document belongs to.')
processing_nodestr | 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.')
statusKnowledgeDocumentStatus
状态字段。
Field(default='pending', description='Current lifecycle state.')
lease_expires_atdatetime | 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.')
dataKnowledgeDocumentData
数据字段。
—

属性详情Attribute Detail

user_id

str = Field(description='The owner user id.')

所有者用户标识。

The owner user id.

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

knowledge_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:114

processing_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:119

status

KnowledgeDocumentStatus = Field(default='pending', description='Current lifecycle state.')

状态字段。声明为 KnowledgeDocumentStatus。

Current lifecycle state.

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

lease_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:140

data

KnowledgeDocumentData

数据字段。声明为 KnowledgeDocumentData。

The data field.

源码Source agentscope/app/storage/_model/_knowledge_document.py:152
基于官方固定版本源码静态生成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.