-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(community): update YoutubeLoader implementation (#7477)
Co-authored-by: jacoblee93 <[email protected]>
- Loading branch information
1 parent
a471516
commit d92af44
Showing
6 changed files
with
63 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ | |
"readline": "https://deno.land/x/[email protected]/mod.ts", | ||
"uuid": "npm:/uuid", | ||
"youtubei.js": "npm:/youtubei.js", | ||
"youtube-transcript": "npm:/youtube-transcript", | ||
"neo4j-driver": "npm:/neo4j-driver", | ||
"axios": "npm:/axios", | ||
"@mendable/firecrawl-js": "npm:/@mendable/firecrawl-js", | ||
|
@@ -40,4 +39,4 @@ | |
"@smithy/util-utf8": "npm:/@smithy/util-utf8", | ||
"@aws-sdk/types": "npm:/@aws-sdk/types" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libs/langchain-community/src/document_loaders/tests/youtube.int.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { test, expect } from "@jest/globals"; | ||
import { YoutubeLoader } from "../web/youtube.js"; | ||
|
||
test("Test Youtube loader", async () => { | ||
const videoUrl = "https://www.youtube.com/watch?v=FZhbJZEgKQ4"; | ||
const loader = YoutubeLoader.createFromUrl(videoUrl, { | ||
language: "en", | ||
addVideoInfo: true, | ||
}); | ||
const docs = await loader.load(); | ||
|
||
expect(docs.length).toBe(1); | ||
expect(docs[0].pageContent).toContain( | ||
"One year ago, at the dawn of a new age," | ||
); | ||
expect(docs[0].metadata).toMatchObject({ | ||
author: "Microsoft", | ||
source: "FZhbJZEgKQ4", | ||
title: "Full Keynote: Satya Nadella at Microsoft Ignite 2023", | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters