(docs: Document[], output: string)
| 1347 | } |
| 1348 | |
| 1349 | export const handleDocumentLoaderOutput = (docs: Document[], output: string) => { |
| 1350 | if (output === 'document') { |
| 1351 | return docs |
| 1352 | } else { |
| 1353 | let finaltext = '' |
| 1354 | for (const doc of docs) { |
| 1355 | finaltext += `${doc.pageContent}\n` |
| 1356 | } |
| 1357 | return handleEscapeCharacters(finaltext, false) |
| 1358 | } |
| 1359 | } |
| 1360 | |
| 1361 | export const parseDocumentLoaderMetadata = (metadata: object | string): object => { |
| 1362 | if (!metadata) return {} |
no test coverage detected