UNPKG

@langchain/community

Version:
1 lines • 1.56 kB
{"version":3,"file":"mozilla_readability.d.cts","names":["Options","MappingDocumentTransformer","Document","MozillaReadabilityTransformer","Promise"],"sources":["../../src/document_transformers/mozilla_readability.d.ts"],"sourcesContent":["import type { Options } from \"mozilla-readability\";\nimport { MappingDocumentTransformer, Document } from \"@langchain/core/documents\";\n/**\n * A transformer that uses the Mozilla Readability library to extract the\n * main content from a web page.\n * @example\n * ```typescript\n * const loader = new HTMLWebBaseLoader(\"https://example.com/article\");\n * const docs = await loader.load();\n *\n * const splitter = new RecursiveCharacterTextSplitter({\n * maxCharacterCount: 5000,\n * });\n * const transformer = new MozillaReadabilityTransformer();\n *\n * // The sequence processes the loaded documents through the splitter and then the transformer.\n * const sequence = transformer.pipe(splitter);\n *\n * // Invoke the sequence to transform the documents into a more readable format.\n * const newDocuments = await sequence.invoke(docs);\n *\n * console.log(newDocuments);\n * ```\n */\nexport declare class MozillaReadabilityTransformer extends MappingDocumentTransformer {\n protected options: Options;\n static lc_name(): string;\n constructor(options?: Options);\n _transformDocument(document: Document): Promise<Document>;\n}\n//# sourceMappingURL=mozilla_readability.d.ts.map"],"mappings":";;;;;;;AAwBA;;;;;;;AAAqF;;;;;;;;;;;;;cAAhEG,6BAAAA,SAAsCF,0BAAAA;qBACpCD;;wBAEGA;+BACOE,WAAWE,QAAQF"}