Explorer
project
index.css
index.html
index.js
scrimba-info.txt
Dependencies
langchain@0.0.151
Bootcamp
Study group
Collaborate with peers in your dedicated #study-group channel.
Code reviews
Submit projects for review using the /review
command in your #code-reviews channel
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter'
try {
const result = await fetch('scrimba-info.txt')
const text = await result.text()
const splitter = new RecursiveCharacterTextSplitter({
chunkSize: 500,
chunkOverlap: 50,
separators: ['\n\n', '\n', ' ', ''] // default setting
})
const output = await splitter.createDocuments([text])
} catch (err) {
console.log(err)
}