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

Section

class Section(BaseModel)
源码Source agentscope/rag/_document.py:31–68

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

A Section represents one logical region of the source file. The :class:ChunkerBase guarantees that no resulting :class:Chunk ever spans content from two different sections.

The granularity of a Section is format-specific:

  • PDF: one section per page (plus separate sections for embedded images).
  • PPTX: one section per slide.
  • Markdown: one section per top-level heading, or the entire file if unstructured.
  • TXT / image / video: one section for the whole file.

属性摘要Attribute Summary

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

属性详情Attribute Detail

content

TextBlock | DataBlock

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

The content field.

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

source

str

来源字段。声明为 str。

The source field.

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

metadata

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

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

The metadata field.

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