fix(Github Document Loader Node): Pass through apiUrl from credentials & fix log output (#11049)

This commit is contained in:
oleg 2024-10-02 11:29:01 +02:00 committed by GitHub
parent 50b723836e
commit a7af98183c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,17 +109,22 @@ export class DocumentGithubLoader implements INodeType {
0, 0,
)) as CharacterTextSplitter | undefined; )) as CharacterTextSplitter | undefined;
const { index } = this.addInputData(NodeConnectionType.AiDocument, [
[{ json: { repository, branch, ignorePaths, recursive } }],
]);
const docs = new GithubRepoLoader(repository, { const docs = new GithubRepoLoader(repository, {
branch, branch,
ignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()), ignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()),
recursive, recursive,
accessToken: (credentials.accessToken as string) || '', accessToken: (credentials.accessToken as string) || '',
apiUrl: credentials.server as string,
}); });
const loadedDocs = textSplitter const loadedDocs = textSplitter
? await textSplitter.splitDocuments(await docs.load()) ? await textSplitter.splitDocuments(await docs.load())
: await docs.load(); : await docs.load();
this.addOutputData(NodeConnectionType.AiDocument, index, [[{ json: { loadedDocs } }]]);
return { return {
response: logWrapper(loadedDocs, this), response: logWrapper(loadedDocs, this),
}; };