AS AgentScopeAPI 手册 / API Reference
类class agentscope.rag

Chunk

class Chunk(BaseModel)
源码Source agentscope/rag/_document.py:71–102

分块,把私有文档转化为可检索的知识。位于 agentscope.rag 包。

Each Chunk corresponds to one record in the vector store. The required structural fields (source, chunk_index, total_chunks) enable downstream features such as "expand context around a hit" during retrieval.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
contentTextBlock | DataBlock
内容字段。
—
sourcestr
来源字段。
—
chunk_indexint
分块索引字段。
—
total_chunksint
`total_chunks` 字段。
—
metadatadict[str, Any]
元数据字段。
Field(default_factory=dict)

属性详情Attribute Detail

content

TextBlock | DataBlock

内容字段。声明为 TextBlock | DataBlock。

The content field.

源码Source agentscope/rag/_document.py:80

source

str

来源字段。声明为 str。

The source field.

源码Source agentscope/rag/_document.py:84

chunk_index

int

分块索引字段。声明为 int。

The chunk index field.

源码Source agentscope/rag/_document.py:88

total_chunks

int

total_chunks 字段。声明为 int。

The total chunks field.

源码Source agentscope/rag/_document.py:94

metadata

dict[str, Any] = Field(default_factory=dict)

元数据字段。声明为 dict[str, Any]。

The metadata field.

源码Source agentscope/rag/_document.py:100
基于官方固定版本源码静态生成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.