MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / splitDocuments

Method splitDocuments

packages/llm/src/langchain.ts:207–217  ·  view source on GitHub ↗
(
    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)}`;

Callers 1

crawlToStoreMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected