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

KnowledgeBaseData

class KnowledgeBaseData(BaseModel)
源码Source 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
namestr
知识库基类的展示名称。
Field(description='Display name of the knowledge base.')
descriptionstr
`description` 字段。
Field(default='', description='Free-form description of the knowledge base purpose.')
embedding_model_configEmbeddingModelConfig
向量化模型配置字段。
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_configChunkerConfig | 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_namestr
集合名称字段。
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.

源码Source agentscope/app/storage/_model/_knowledge_base.py:45

description

str = Field(default='', description='Free-form description of the knowledge base purpose.')

description 字段。声明为 str。

Free-form description of the knowledge base purpose.

源码Source agentscope/app/storage/_model/_knowledge_base.py:48

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

向量化模型配置字段。声明为 EmbeddingModelConfig。

Embedding model configuration pinned at creation time.

源码Source agentscope/app/storage/_model/_knowledge_base.py:54

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

切分器配置字段。声明为 ChunkerConfig | None。

Chunker configuration pinned at creation time.

源码Source agentscope/app/storage/_model/_knowledge_base.py:63

collection_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.

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