Skip to content
Snippets Groups Projects
Commit 45659347 authored by Embruch, Gerd's avatar Embruch, Gerd
Browse files

finished embeddings/remove & embeddings/update ; dropped unnecessary embeddings/create

parent 5ff80cbf
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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) {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment