Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
philnash committed Nov 12, 2024
1 parent fa799b0 commit 5bfd07d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
4 changes: 1 addition & 3 deletions libs/langchain-community/src/document_loaders/web/cheerio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
7 changes: 5 additions & 2 deletions libs/langchain-community/src/document_loaders/web/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -75,4 +78,4 @@ export class HTMLWebBaseLoader extends BaseDocumentLoader implements WebBaseLoad

return [new Document({ pageContent: html })];
}
}
}

0 comments on commit 5bfd07d

Please sign in to comment.