@langchain/core
Version:
Core LangChain.js abstractions and schemas
1 lines • 2.7 kB
Source Map (JSON)
{"version":3,"file":"transformers.d.ts","names":["Runnable","BaseCallbackConfig","DocumentInterface","BaseDocumentTransformer","RunInput","RunOutput","Promise","MappingDocumentTransformer"],"sources":["../../src/documents/transformers.d.ts"],"sourcesContent":["import { Runnable } from \"../runnables/base.js\";\nimport type { BaseCallbackConfig } from \"../callbacks/manager.js\";\nimport type { DocumentInterface } from \"./document.js\";\n/**\n * Abstract base class for document transformation systems.\n *\n * A document transformation system takes an array of Documents and returns an\n * array of transformed Documents. These arrays do not necessarily have to have\n * the same length.\n *\n * One example of this is a text splitter that splits a large document into\n * many smaller documents.\n */\nexport declare abstract class BaseDocumentTransformer<RunInput extends DocumentInterface[] = DocumentInterface[], RunOutput extends DocumentInterface[] = DocumentInterface[]> extends Runnable<RunInput, RunOutput> {\n lc_namespace: string[];\n /**\n * Transform a list of documents.\n * @param documents A sequence of documents to be transformed.\n * @returns A list of transformed documents.\n */\n abstract transformDocuments(documents: RunInput): Promise<RunOutput>;\n /**\n * Method to invoke the document transformation. This method calls the\n * transformDocuments method with the provided input.\n * @param input The input documents to be transformed.\n * @param _options Optional configuration object to customize the behavior of callbacks.\n * @returns A Promise that resolves to the transformed documents.\n */\n invoke(input: RunInput, _options?: BaseCallbackConfig): Promise<RunOutput>;\n}\n/**\n * Class for document transformers that return exactly one transformed document\n * for each input document.\n */\nexport declare abstract class MappingDocumentTransformer extends BaseDocumentTransformer {\n transformDocuments(documents: DocumentInterface[]): Promise<DocumentInterface[]>;\n abstract _transformDocument(document: DocumentInterface): Promise<DocumentInterface>;\n}\n"],"mappings":";;;;;;;;AAaA;;;;;;;;AAO2CI,uBAPbD,uBAOaC,CAAAA,iBAP4BF,iBAO5BE,EAAAA,GAPkDF,iBAOlDE,EAAAA,EAAAA,kBAPyFF,iBAOzFE,EAAAA,GAP+GF,iBAO/GE,EAAAA,CAAAA,SAP4IJ,QAO5II,CAPqJA,QAOrJA,EAP+JC,SAO/JD,CAAAA,CAAAA;EAAQ,YAAWC,EAAAA,MAAAA,EAAAA;EAAS;;;;;EAQJ,SAfoHL,kBAAAA,CAAAA,SAAAA,EAO5II,QAP4IJ,CAAAA,EAOjIM,OAPiIN,CAOzHK,SAPyHL,CAAAA;EAAQ;AAqB/L;;;;;;EAE2D,MAAWE,CAAAA,KAAAA,EARpDE,QAQoDF,EAAAA,QAAAA,CAAAA,EAR/BD,kBAQ+BC,CAAAA,EARVI,OAQUJ,CARFG,SAQEH,CAAAA;;;AAFkB;;;uBAA1DK,0BAAAA,SAAmCJ,uBAAAA;gCAC/BD,sBAAsBI,QAAQJ;wCACtBA,oBAAoBI,QAAQJ"}