Function
handleDocumentLoaderDocuments
(loader: DocumentLoader, textSplitter?: TextSplitter)
Source from the content-addressed store, hash-verified
| 1398 | } |
| 1399 | |
| 1400 | export const handleDocumentLoaderDocuments = async (loader: DocumentLoader, textSplitter?: TextSplitter) => { |
| 1401 | let docs: Document[] = [] |
| 1402 | |
| 1403 | if (textSplitter) { |
| 1404 | let splittedDocs = await loader.load() |
| 1405 | splittedDocs = await textSplitter.splitDocuments(splittedDocs) |
| 1406 | docs = splittedDocs |
| 1407 | } else { |
| 1408 | docs = await loader.load() |
| 1409 | } |
| 1410 | |
| 1411 | return docs |
| 1412 | } |
| 1413 | |
| 1414 | /** |
| 1415 | * Normalize special characters in key to be used in vector store |
Tested by
no test coverage detected