Method
splitDocuments
(
documents: Document[],
chunkSize = env.CHUNK_SIZE
)
Source from the content-addressed store, hash-verified
| 205 | |
| 206 | @measure |
| 207 | private static async splitDocuments( |
| 208 | documents: Document[], |
| 209 | chunkSize = env.CHUNK_SIZE |
| 210 | ) { |
| 211 | const splitter = new TokenTextSplitter({ |
| 212 | encodingName: 'gpt2', |
| 213 | chunkSize, |
| 214 | chunkOverlap: 0, |
| 215 | }); |
| 216 | return await splitter.splitDocuments(documents); |
| 217 | } |
| 218 | |
| 219 | private static async getDocuments(url: string) { |
| 220 | const dir = `.db/crawl/${StringUtils.clean(url)}`; |
Tested by
no test coverage detected