agentscope.app.storageKnowledgeBaseData
class KnowledgeBaseData(BaseModel)
agentscope/app/storage/_model/_knowledge_base.py:33–84可变负载的知识库基类类。位于 agentscope.app.storage 包。
Groups every non-relational field of :class:KnowledgeBaseRecord
into a single nested model so the outer record only carries
relational keys (user_id) alongside the _RecordBase
envelope. This matches the convention used by the other records
(AgentRecord.data, SessionRecord.config / .state,
TeamRecord.data etc.) and lets the SQL backend serialise the
whole payload into a single JSON column without special-casing.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
name | str | 知识库基类的展示名称。 | Field(description='Display name of the knowledge base.') |
description | str | `description` 字段。 | Field(default='', description='Free-form description of the knowledge base purpose.') |
embedding_model_config | EmbeddingModelConfig | 向量化模型配置字段。 | Field(description='Embedding model configuration pinned at creation time. Cannot change for the lifetime of the record because the underlying collection is sized to its dimension.') |
chunker_config | ChunkerConfig | None | 切分器配置字段。 | Field(default=None, description='Chunker configuration pinned at creation time. ``None`` only for legacy records created before per-KB chunker support was introduced; the index worker falls back to ``ApproxTokenChunker()`` in that case. New records always have an explicit value.') |
collection_name | str | 集合名称字段。 | Field(description='The vector store collection that physically backs this knowledge base. Generated server-side; opaque to clients.') |
属性详情Attribute Detail
name
str = Field(description='Display name of the knowledge base.')知识库基类的展示名称。
Display name of the knowledge base.
agentscope/app/storage/_model/_knowledge_base.py:45description
str = Field(default='', description='Free-form description of the knowledge base purpose.')description 字段。声明为 str。
Free-form description of the knowledge base purpose.
agentscope/app/storage/_model/_knowledge_base.py:48embedding_model_config
EmbeddingModelConfig = Field(description='Embedding model configuration pinned at creation time. Cannot change for the lifetime of the record because the underlying collection is sized to its dimension.')向量化模型配置字段。声明为 EmbeddingModelConfig。
Embedding model configuration pinned at creation time.
agentscope/app/storage/_model/_knowledge_base.py:54chunker_config
ChunkerConfig | None = Field(default=None, description='Chunker configuration pinned at creation time. ``None`` only for legacy records created before per-KB chunker support was introduced; the index worker falls back to ``ApproxTokenChunker()`` in that case. New records always have an explicit value.')切分器配置字段。声明为 ChunkerConfig | None。
Chunker configuration pinned at creation time.
agentscope/app/storage/_model/_knowledge_base.py:63collection_name
str = Field(description='The vector store collection that physically backs this knowledge base. Generated server-side; opaque to clients.')集合名称字段。声明为 str。
The vector store collection that physically backs this knowledge base.
agentscope/app/storage/_model/_knowledge_base.py:78