Skip to content

Commit

Permalink
added default engine support in /webhook/kb/reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Troisi committed Dec 20, 2024
1 parent 16b1537 commit d2f5ba4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion routes/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobManager.connectAndStartPublisher((status, error) => {
}
})

let default_engine = {
name: "pinecone",
type: process.env.PINECONE_TYPE,
apikey: "",
vector_size: 1536,
index_name: process.env.PINECONE_INDEX
}

router.post('/kb/reindex', async (req, res) => {

Expand Down Expand Up @@ -99,7 +106,7 @@ router.post('/kb/reindex', async (req, res) => {
return res.status(500).send({ success: false, error: err })
}

json.engine = namespace.engine;
json.engine = namespace.engine || default_engine;

let resources = [];
resources.push(json);
Expand Down

0 comments on commit d2f5ba4

Please sign in to comment.