Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
a46eb241
Unverified
Commit
a46eb241
authored
3 months ago
by
Timothy Carambat
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
add Gitlab to watchable documents (#2817)
parent
a89d8fcf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/endpoints/api/workspace/index.js
+4
-6
4 additions, 6 deletions
server/endpoints/api/workspace/index.js
server/jobs/sync-watched-documents.js
+1
-1
1 addition, 1 deletion
server/jobs/sync-watched-documents.js
server/models/documentSyncQueue.js
+3
-2
3 additions, 2 deletions
server/models/documentSyncQueue.js
with
8 additions
and
9 deletions
server/endpoints/api/workspace/index.js
+
4
−
6
View file @
a46eb241
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
server/jobs/sync-watched-documents.js
+
1
−
1
View file @
a46eb241
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
server/models/documentSyncQueue.js
+
3
−
2
View file @
a46eb241
...
@@ -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
;
},
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment