> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # RAG RAG 包重命名了分块参数,并缩小了其类型范围。 ## 已变更 ### `keepSeparator` 改为 `separatorPosition` `keepSeparator` 参数已重命名为 `separatorPosition`,类型也得到简化。旧参数使用容易混淆的 `boolean | 'start' | 'end'` 类型,其中 `true` 实际上是 `'start'` 的别名。新参数使用明确的 `'start' | 'end'` 值;省略该参数时会丢弃分隔符。 迁移时,请按照以下映射将 `keepSeparator` 替换为 `separatorPosition`: | 旧值 | 新值 | | ------------------------ | ---------------------------- | | `keepSeparator: true` | `separatorPosition: 'start'` | | `keepSeparator: 'start'` | `separatorPosition: 'start'` | | `keepSeparator: 'end'` | `separatorPosition: 'end'` | | `keepSeparator: false` | 移除该参数 | | 省略参数 | 无需更改 | ```diff await doc.chunk({ strategy: 'character', separator: '.', - keepSeparator: true, + separatorPosition: 'start', }); await doc.chunk({ strategy: 'character', separator: '.', - keepSeparator: 'end', + separatorPosition: 'end', }); await doc.chunk({ strategy: 'character', separator: '.', - keepSeparator: false, + // Parameter removed - separator is discarded by default }); ```