Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAGchat-API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
zbhAI
RAGchat-API
Commits
45659347
Commit
45659347
authored
10 months ago
by
Embruch, Gerd
Browse files
Options
Downloads
Patches
Plain Diff
finished embeddings/remove & embeddings/update ; dropped unnecessary embeddings/create
parent
5ff80cbf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
__tests__/manualREST/rag.rest
+0
-7
0 additions, 7 deletions
__tests__/manualREST/rag.rest
controllers/Embeddings.js
+3
-3
3 additions, 3 deletions
controllers/Embeddings.js
routes/embeddings.js
+29
-10
29 additions, 10 deletions
routes/embeddings.js
with
32 additions
and
20 deletions
__tests__/manualREST/rag.rest
+
0
−
7
View file @
45659347
...
...
@@ -51,10 +51,3 @@ GET {{host}}/embeddings
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
### createEmbeddings
# @name createEmbeddings
PUT {{host}}/embeddings
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
This diff is collapsed.
Click to expand it.
controllers/Embeddings.js
+
3
−
3
View file @
45659347
...
...
@@ -60,7 +60,7 @@ export const retriever = vectorStoreConnection.asRetriever();
/** *******************************************************
* REMOVE VECTOR DB
*/
export
const
removeVectorDb
=
async
(
req
,
res
)
=>
{
export
const
removeVectorDb
=
async
(
req
,
res
,
next
)
=>
{
// check if vDB is running
const
vectorDBrunning
=
await
isVectorDbAvailable
();
// exit if not running
...
...
@@ -83,7 +83,7 @@ export const removeVectorDb = async (req, res) => {
/** *******************************************************
* CHECK STATUS OF VECTOR DB
*/
export
const
getStatus
=
async
(
req
,
res
)
=>
{
export
const
getStatus
=
async
(
req
,
res
,
next
)
=>
{
// check if vDB is running
const
vectorDBrunning
=
await
isVectorDbAvailable
();
// exit if not running
...
...
@@ -133,7 +133,7 @@ export const createEmbeddings = async (req, res) => {
/** *******************************************************
* UPDATE EMBEDDINGS
*/
export
const
updateEmbeddings
=
async
(
req
,
res
)
=>
{
export
const
updateEmbeddings
=
async
(
req
,
res
,
next
)
=>
{
// check if collection is available
const
collection
=
await
isCollectionAvailable
();
if
(
!
collection
)
{
...
...
This diff is collapsed.
Click to expand it.
routes/embeddings.js
+
29
−
10
View file @
45659347
...
...
@@ -6,19 +6,38 @@ import { gateKeeper } from "../controllers/Auth.js";
const
router
=
Router
();
// remove Vector DB
// router.delete('/', verifyAccessToken, gateKeeper, removeVectorDb);
// Vector DB status
/**
* REMOVE VECTOR DB
* deletes the whole vector DB collection
*
* @header {authorization} Bearer [required] access token
*
* @return {object} related message
*/
router
.
delete
(
'
/
'
,
verifyAccessToken
,
gateKeeper
,
removeVectorDb
);
/**
* VECTOR DB STATUS
* creates vector DB collection if not exists
* returns the status of the vector DB
*
* @header {authorization} Bearer [required] access token
*
* @return {object} information about the vector DB collection
*/
router
.
get
(
'
/
'
,
verifyAccessToken
,
gateKeeper
,
getStatus
);
// createEmbeddings
// router.put('/', pbVerifyAccessToken, gateKeeper, createEmbeddings);
// update embeddings
// TODO test update & delete https://python.langchain.com/v0.1/docs/integrations/vectorstores/chroma/#update-and-delete
// https://js.langchain.com/v0.1/docs/integrations/vectorstores/chroma/#usage-delete-docs
// router.patch('/', pbVerifyAccessToken, gateKeeper, updateEmbeddings);
/**
* UPDATE EMBEDDINGS
* removes orphaned and outdates embeddings
* inserts updated and brand new embeddings
*
* @header {authorization} Bearer [required] access token
*
* @return {object} information about the update
*/
router
.
patch
(
'
/
'
,
verifyAccessToken
,
gateKeeper
,
updateEmbeddings
);
...
...
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