-
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.
Allow to stream files with
GithubRepoLoader
(#3339)
* add loadAsStream method in GithubRepoLoader * apply review changes
- Loading branch information
Showing
4 changed files
with
235 additions
and
1 deletion.
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
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,20 @@ | ||
import { GithubRepoLoader } from "langchain/document_loaders/web/github"; | ||
|
||
export const run = async () => { | ||
const loader = new GithubRepoLoader( | ||
"https://github.com/langchain-ai/langchainjs", | ||
{ | ||
branch: "main", | ||
recursive: false, | ||
unknown: "warn", | ||
maxConcurrency: 3, // Defaults to 2 | ||
} | ||
); | ||
|
||
const docs = []; | ||
for await (const doc of loader.loadAsStream()) { | ||
docs.push(doc); | ||
} | ||
|
||
console.log({ docs }); | ||
}; |
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
517ec3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
langchainjs-api-refs β ./docs/api_refs
517ec3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
langchainjs-docs β ./docs/core_docs/