θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

add Gitlab to watchable documents #2817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions server/endpoints/api/workspace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,12 +919,10 @@ function apiWorkspaceEndpoints(app) {
const embeddingsCount = await VectorDb.namespaceCount(workspace.slug);

if (!hasVectorizedSpace || embeddingsCount === 0)
return response
.status(200)
.json({
results: [],
message: "No embeddings found for this workspace.",
});
return response.status(200).json({
results: [],
message: "No embeddings found for this workspace.",
});

const parseSimilarityThreshold = () => {
let input = parseFloat(scoreThreshold);
Expand Down
2 changes: 1 addition & 1 deletion server/jobs/sync-watched-documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions server/models/documentSyncQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down Expand Up @@ -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;
},

Expand Down