Skip to content
Snippets Groups Projects
Unverified Commit a46eb241 authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

add Gitlab to watchable documents (#2817)

parent a89d8fcf
No related branches found
No related tags found
No related merge requests found
...@@ -919,12 +919,10 @@ function apiWorkspaceEndpoints(app) { ...@@ -919,12 +919,10 @@ function apiWorkspaceEndpoints(app) {
const embeddingsCount = await VectorDb.namespaceCount(workspace.slug); const embeddingsCount = await VectorDb.namespaceCount(workspace.slug);
if (!hasVectorizedSpace || embeddingsCount === 0) if (!hasVectorizedSpace || embeddingsCount === 0)
return response return response.status(200).json({
.status(200) results: [],
.json({ message: "No embeddings found for this workspace.",
results: [], });
message: "No embeddings found for this workspace.",
});
const parseSimilarityThreshold = () => { const parseSimilarityThreshold = () => {
let input = parseFloat(scoreThreshold); let input = parseFloat(scoreThreshold);
......
...@@ -46,7 +46,7 @@ const { DocumentSyncRun } = require('../models/documentSyncRun.js'); ...@@ -46,7 +46,7 @@ const { DocumentSyncRun } = require('../models/documentSyncRun.js');
newContent = response?.content; newContent = response?.content;
} }
if (type === 'confluence' || type === 'github') { if (type === 'confluence' || type === 'github' || type === 'gitlab') {
const response = await collector.forwardExtensionRequest({ const response = await collector.forwardExtensionRequest({
endpoint: "/ext/resync-source-document", endpoint: "/ext/resync-source-document",
method: "POST", method: "POST",
......
...@@ -4,13 +4,13 @@ const { SystemSettings } = require("./systemSettings"); ...@@ -4,13 +4,13 @@ const { SystemSettings } = require("./systemSettings");
const { Telemetry } = require("./telemetry"); const { Telemetry } = require("./telemetry");
/** /**
* @typedef {('link'|'youtube'|'confluence'|'github')} validFileType * @typedef {('link'|'youtube'|'confluence'|'github'|'gitlab')} validFileType
*/ */
const DocumentSyncQueue = { const DocumentSyncQueue = {
featureKey: "experimental_live_file_sync", featureKey: "experimental_live_file_sync",
// update the validFileTypes and .canWatch properties when adding elements here. // update the validFileTypes and .canWatch properties when adding elements here.
validFileTypes: ["link", "youtube", "confluence", "github"], validFileTypes: ["link", "youtube", "confluence", "github", "gitlab"],
defaultStaleAfter: 604800000, defaultStaleAfter: 604800000,
maxRepeatFailures: 5, // How many times a run can fail in a row before pruning. maxRepeatFailures: 5, // How many times a run can fail in a row before pruning.
writable: [], writable: [],
...@@ -51,6 +51,7 @@ const DocumentSyncQueue = { ...@@ -51,6 +51,7 @@ const DocumentSyncQueue = {
if (chunkSource.startsWith("youtube://")) return true; // If is a youtube link 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("confluence://")) return true; // If is a confluence document link
if (chunkSource.startsWith("github://")) return true; // If is a Github file reference 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; return false;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment