@@ -18,7 +18,7 @@ class Github_DocumentLoaders implements INode {
18
18
constructor ( ) {
19
19
this . label = 'Github'
20
20
this . name = 'github'
21
- this . version = 1 .0
21
+ this . version = 2 .0
22
22
this . type = 'Document'
23
23
this . icon = 'github.png'
24
24
this . category = 'Document Loaders'
@@ -51,6 +51,34 @@ class Github_DocumentLoaders implements INode {
51
51
type : 'boolean' ,
52
52
optional : true
53
53
} ,
54
+ {
55
+ label : 'Max Concurrency' ,
56
+ name : 'maxConcurrency' ,
57
+ type : 'number' ,
58
+ step : 1 ,
59
+ optional : true ,
60
+ additionalParams : true
61
+ } ,
62
+ {
63
+ label : 'Ignore Paths' ,
64
+ name : 'ignorePath' ,
65
+ description : 'An array of paths to be ignored' ,
66
+ placeholder : `["*.md"]` ,
67
+ type : 'string' ,
68
+ rows : 4 ,
69
+ optional : true ,
70
+ additionalParams : true
71
+ } ,
72
+ {
73
+ label : 'Max Retries' ,
74
+ name : 'maxRetries' ,
75
+ description :
76
+ 'The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 2.' ,
77
+ type : 'number' ,
78
+ step : 1 ,
79
+ optional : true ,
80
+ additionalParams : true
81
+ } ,
54
82
{
55
83
label : 'Text Splitter' ,
56
84
name : 'textSplitter' ,
@@ -73,6 +101,9 @@ class Github_DocumentLoaders implements INode {
73
101
const recursive = nodeData . inputs ?. recursive as boolean
74
102
const textSplitter = nodeData . inputs ?. textSplitter as TextSplitter
75
103
const metadata = nodeData . inputs ?. metadata
104
+ const maxConcurrency = nodeData . inputs ?. maxConcurrency as string
105
+ const maxRetries = nodeData . inputs ?. maxRetries as string
106
+ const ignorePath = nodeData . inputs ?. ignorePath as string
76
107
77
108
const credentialData = await getCredentialData ( nodeData . credential ?? '' , options )
78
109
const accessToken = getCredentialParam ( 'accessToken' , credentialData , nodeData )
@@ -84,6 +115,9 @@ class Github_DocumentLoaders implements INode {
84
115
}
85
116
86
117
if ( accessToken ) githubOptions . accessToken = accessToken
118
+ if ( maxConcurrency ) githubOptions . maxConcurrency = parseInt ( maxConcurrency , 10 )
119
+ if ( maxRetries ) githubOptions . maxRetries = parseInt ( maxRetries , 10 )
120
+ if ( ignorePath ) githubOptions . ignorePaths = JSON . parse ( ignorePath )
87
121
88
122
const loader = new GithubRepoLoader ( repoLink , githubOptions )
89
123
const docs = textSplitter ? await loader . loadAndSplit ( textSplitter ) : await loader . load ( )
0 commit comments