UNPKG

@langchain/community

Version:
1 lines • 1.99 kB
{"version":3,"file":"spider.d.ts","names":["DocumentInterface","BaseDocumentLoader","SpiderLoaderParameters","Record","SpiderLoader","Promise"],"sources":["../../../src/document_loaders/web/spider.d.ts"],"sourcesContent":["import { type DocumentInterface } from \"@langchain/core/documents\";\nimport { BaseDocumentLoader } from \"@langchain/core/document_loaders/base\";\n/**\n * Interface representing the parameters for the Spider loader. It\n * includes properties such as the URL to scrape or crawl and the API key.\n */\ninterface SpiderLoaderParameters {\n /**\n * URL to scrape or crawl\n */\n url: string;\n /**\n * API key for Spider. If not provided, the default value is the value of the SPIDER_API_KEY environment variable.\n */\n apiKey?: string;\n /**\n * Mode of operation. Can be either \"crawl\" or \"scrape\". If not provided, the default value is \"scrape\".\n */\n mode?: \"crawl\" | \"scrape\";\n params?: Record<string, unknown>;\n}\n/**\n * Class representing a document loader for loading data from\n * Spider (spider.cloud). It extends the BaseDocumentLoader class.\n * @example\n * ```typescript\n * const loader = new SpiderLoader({\n * url: \"{url}\",\n * apiKey: \"{apiKey}\",\n * mode: \"crawl\"\n * });\n * const docs = await loader.load();\n * ```\n */\nexport declare class SpiderLoader extends BaseDocumentLoader {\n private apiKey;\n private url;\n private mode;\n private params?;\n constructor(loaderParams: SpiderLoaderParameters);\n /**\n * Loads the data from the Spider.\n * @returns An array of Documents representing the retrieved data.\n * @throws An error if the data could not be loaded.\n */\n load(): Promise<DocumentInterface[]>;\n}\nexport {};\n//# sourceMappingURL=spider.d.ts.map"],"mappings":";;;;;;;AAC2E;AAiC3E;UA5BUE,sBAAAA,CAiCoBA;EAMVF;;;EAXwC,GAAA,EAAA,MAAA;;;;;;;;;WAf/CG;;;;;;;;;;;;;;;cAeQC,YAAAA,SAAqBH,kBAAAA;;;;;4BAKZC;;;;;;UAMlBG,QAAQL"}