add Gitlab to watchable documents ()

This commit is contained in:
Timothy Carambat 2024-12-12 10:44:11 -08:00 committed by GitHub
parent a89d8fcfe4
commit a46eb2418a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 9 deletions
server

View file

@ -919,9 +919,7 @@ function apiWorkspaceEndpoints(app) {
const embeddingsCount = await VectorDb.namespaceCount(workspace.slug);
if (!hasVectorizedSpace || embeddingsCount === 0)
return response
.status(200)
.json({
return response.status(200).json({
results: [],
message: "No embeddings found for this workspace.",
});

View file

@ -46,7 +46,7 @@ const { DocumentSyncRun } = require('../models/documentSyncRun.js');
newContent = response?.content;
}
if (type === 'confluence' || type === 'github') {
if (type === 'confluence' || type === 'github' || type === 'gitlab') {
const response = await collector.forwardExtensionRequest({
endpoint: "/ext/resync-source-document",
method: "POST",

View file

@ -4,13 +4,13 @@ const { SystemSettings } = require("./systemSettings");
const { Telemetry } = require("./telemetry");
/**
* @typedef {('link'|'youtube'|'confluence'|'github')} validFileType
* @typedef {('link'|'youtube'|'confluence'|'github'|'gitlab')} validFileType
*/
const DocumentSyncQueue = {
featureKey: "experimental_live_file_sync",
// update the validFileTypes and .canWatch properties when adding elements here.
validFileTypes: ["link", "youtube", "confluence", "github"],
validFileTypes: ["link", "youtube", "confluence", "github", "gitlab"],
defaultStaleAfter: 604800000,
maxRepeatFailures: 5, // How many times a run can fail in a row before pruning.
writable: [],
@ -51,6 +51,7 @@ const DocumentSyncQueue = {
if (chunkSource.startsWith("youtube://")) return true; // If is a youtube link
if (chunkSource.startsWith("confluence://")) return true; // If is a confluence document link
if (chunkSource.startsWith("github://")) return true; // If is a Github file reference
if (chunkSource.startsWith("gitlab://")) return true; // If is a Gitlab file reference
return false;
},