From 5bfd07daecbea674f70709adf393e931f3f51874 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Nov 2024 12:12:13 +1100 Subject: [PATCH] Formatting --- .../src/document_loaders/tests/html.int.test.ts | 4 +++- .../src/document_loaders/web/cheerio.ts | 4 +--- libs/langchain-community/src/document_loaders/web/html.ts | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/langchain-community/src/document_loaders/tests/html.int.test.ts b/libs/langchain-community/src/document_loaders/tests/html.int.test.ts index f9de34862b49..afd308a19b4f 100644 --- a/libs/langchain-community/src/document_loaders/tests/html.int.test.ts +++ b/libs/langchain-community/src/document_loaders/tests/html.int.test.ts @@ -6,7 +6,9 @@ test("Test HTML web scraper loader", async () => { "https://news.ycombinator.com/item?id=34817881" ); const docs = await loader.load(); - expect(docs[0].pageContent).toEqual(expect.stringContaining("What Lights the Universe’s Standard Candles?")) + expect(docs[0].pageContent).toEqual( + expect.stringContaining("What Lights the Universe’s Standard Candles?") + ); }); test("Test HTML web scraper loader with textDecoder", async () => { diff --git a/libs/langchain-community/src/document_loaders/web/cheerio.ts b/libs/langchain-community/src/document_loaders/web/cheerio.ts index aae58b022889..62c101e9b3f9 100644 --- a/libs/langchain-community/src/document_loaders/web/cheerio.ts +++ b/libs/langchain-community/src/document_loaders/web/cheerio.ts @@ -5,9 +5,7 @@ import type { SelectorType, } from "cheerio"; import { Document } from "@langchain/core/documents"; -import { - AsyncCaller, -} from "@langchain/core/utils/async_caller"; +import { AsyncCaller } from "@langchain/core/utils/async_caller"; import { BaseDocumentLoader } from "@langchain/core/document_loaders/base"; import { WebBaseLoaderParams, WebBaseLoader } from "./html.js"; diff --git a/libs/langchain-community/src/document_loaders/web/html.ts b/libs/langchain-community/src/document_loaders/web/html.ts index d5b525feb1be..c24491a87e3d 100644 --- a/libs/langchain-community/src/document_loaders/web/html.ts +++ b/libs/langchain-community/src/document_loaders/web/html.ts @@ -45,7 +45,10 @@ export interface WebBaseLoader extends DocumentLoader { headers?: HeadersInit; } -export class HTMLWebBaseLoader extends BaseDocumentLoader implements WebBaseLoader { +export class HTMLWebBaseLoader + extends BaseDocumentLoader + implements WebBaseLoader +{ timeout: number; caller: AsyncCaller; @@ -75,4 +78,4 @@ export class HTMLWebBaseLoader extends BaseDocumentLoader implements WebBaseLoad return [new Document({ pageContent: html })]; } -} \ No newline at end of file +}