Skip to content

Commit

Permalink
community[patch]: cheerio loader fetch headers type error (#5905)
Browse files Browse the repository at this point in the history
* fix: cheerio loader fetch headers type error

* fix ci

---------

Co-authored-by: xujingzhu <[email protected]>
Co-authored-by: Brace Sproul <[email protected]>
  • Loading branch information
3 people authored Jun 28, 2024
1 parent ea1c763 commit f3585eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/langchain-community/src/document_loaders/web/cheerio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface WebBaseLoaderParams extends AsyncCallerParams {
/**
* The headers to use in the fetch request.
*/
headers?: Headers;
headers?: HeadersInit;
}

/**
Expand All @@ -62,7 +62,7 @@ export class CheerioWebBaseLoader

textDecoder?: TextDecoder;

headers?: Headers;
headers?: HeadersInit;

constructor(public webPath: string, fields?: WebBaseLoaderParams) {
super();
Expand All @@ -86,7 +86,7 @@ export class CheerioWebBaseLoader
timeout: number | undefined,
textDecoder?: TextDecoder,
options?: CheerioOptions & {
headers?: Headers;
headers?: HeadersInit;
}
): Promise<CheerioAPI[]> {
return Promise.all(
Expand All @@ -102,7 +102,7 @@ export class CheerioWebBaseLoader
timeout: number | undefined,
textDecoder?: TextDecoder,
options?: CheerioOptions & {
headers?: Headers;
headers?: HeadersInit;
}
): Promise<CheerioAPI> {
const { headers, ...cheerioOptions } = options ?? {};
Expand Down

0 comments on commit f3585eb

Please sign in to comment.