agsamantha/node_modules/langchain/dist/util/document.cjs

13 lines
489 B
JavaScript
Raw Normal View History

2024-10-02 20:15:21 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatDocumentsAsString = void 0;
/**
* Given a list of documents, this util formats their contents
* into a string, separated by newlines.
*
* @param documents
* @returns A string of the documents page content, separated by newlines.
*/
const formatDocumentsAsString = (documents) => documents.map((doc) => doc.pageContent).join("\n\n");
exports.formatDocumentsAsString = formatDocumentsAsString;