Skip to content

Commit 1ae88f6

Browse files
authored
Merge pull request #854 from FlowiseAI/feature/GithubLoader
Feature/GithubLoader AdditionalParams
2 parents 776f818 + 6372cb9 commit 1ae88f6

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

packages/components/nodes/documentloaders/Github/Github.ts

+35-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Github_DocumentLoaders implements INode {
1818
constructor() {
1919
this.label = 'Github'
2020
this.name = 'github'
21-
this.version = 1.0
21+
this.version = 2.0
2222
this.type = 'Document'
2323
this.icon = 'github.png'
2424
this.category = 'Document Loaders'
@@ -51,6 +51,34 @@ class Github_DocumentLoaders implements INode {
5151
type: 'boolean',
5252
optional: true
5353
},
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+
},
5482
{
5583
label: 'Text Splitter',
5684
name: 'textSplitter',
@@ -73,6 +101,9 @@ class Github_DocumentLoaders implements INode {
73101
const recursive = nodeData.inputs?.recursive as boolean
74102
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
75103
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
76107

77108
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
78109
const accessToken = getCredentialParam('accessToken', credentialData, nodeData)
@@ -84,6 +115,9 @@ class Github_DocumentLoaders implements INode {
84115
}
85116

86117
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)
87121

88122
const loader = new GithubRepoLoader(repoLink, githubOptions)
89123
const docs = textSplitter ? await loader.loadAndSplit(textSplitter) : await loader.load()

packages/server/marketplaces/chatflows/Flowise Docs QnA.json

+30-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
"id": "github_0",
266266
"label": "Github",
267267
"name": "github",
268-
"version": 1,
268+
"version": 2,
269269
"type": "Document",
270270
"baseClasses": ["Document"],
271271
"category": "Document Loaders",
@@ -301,6 +301,35 @@
301301
"optional": true,
302302
"id": "github_0-input-recursive-boolean"
303303
},
304+
{
305+
"label": "Max Concurrency",
306+
"name": "maxConcurrency",
307+
"type": "number",
308+
"step": 1,
309+
"optional": true,
310+
"additionalParams": true,
311+
"id": "github_0-input-maxConcurrency-number"
312+
},
313+
{
314+
"label": "Ignore Paths",
315+
"name": "ignorePath",
316+
"type": "string",
317+
"description": "An array of paths to be ignored",
318+
"placeholder": "[\"*.md\"]",
319+
"rows": 4,
320+
"optional": true,
321+
"additionalParams": true,
322+
"id": "github_0-input-ignorePath-string"
323+
},
324+
{
325+
"label": "Max Retries",
326+
"name": "maxRetries",
327+
"description": "The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 2.",
328+
"type": "number",
329+
"optional": true,
330+
"additionalParams": true,
331+
"id": "github_0-input-maxRetries-number"
332+
},
304333
{
305334
"label": "Metadata",
306335
"name": "metadata",

0 commit comments

Comments
 (0)