> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/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 }); ```