itron2000 commited on
Commit
7e53787
·
verified ·
1 Parent(s): 4ff186b

Create main.py

Browse files
Files changed (1) hide show
  1. main.py +15 -0
main.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_community.document_loaders import GitLoader
2
+
3
+ def file_filter(file?path: str) -> bool:
4
+ return file_path.endswith(".mdx")
5
+
6
+ loader = GitLoader(
7
+ clone_url="https://github.com/langchain-ai/langchain",
8
+ repo_path="./langchain",
9
+ branch="master",
10
+ file_filter=file_filter,
11
+ )
12
+
13
+ documents = loader.load()
14
+ print(len(documents))
15
+