RAG
RAG パッケージでは、チャンク分割パラメーターの名前が変更され、型が限定されました。
変更変更への直接リンク
keepSeparator から separatorPosition へkeepseparator-to-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 | パラメーターを削除 |
| パラメーターを省略 | 変更不要 |
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
});