Skip to content
Snippets Groups Projects
Commit a87978d1 authored by timothycarambat's avatar timothycarambat
Browse files

Make LanceDB the vector database default provider in backend to prevent issues...

Make LanceDB the vector database default provider in backend to prevent issues where somehow this key is not set by the user resulting in a Pinecone error even though they never said they wanted Pinecone to be their vector db
parent 790fd58b
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,7 @@ export default function PrivacyAndDataHandling() { ...@@ -64,7 +64,7 @@ export default function PrivacyAndDataHandling() {
function ThirdParty({ settings }) { function ThirdParty({ settings }) {
const llmChoice = settings?.LLMProvider || "openai"; const llmChoice = settings?.LLMProvider || "openai";
const embeddingEngine = settings?.EmbeddingEngine || "openai"; const embeddingEngine = settings?.EmbeddingEngine || "openai";
const vectorDb = settings?.VectorDB || "pinecone"; const vectorDb = settings?.VectorDB || "lancedb";
return ( return (
<div className="py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-white/10"> <div className="py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-white/10">
......
...@@ -299,7 +299,7 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) { ...@@ -299,7 +299,7 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
async function fetchKeys() { async function fetchKeys() {
const _settings = await System.keys(); const _settings = await System.keys();
setLLMChoice(_settings?.LLMProvider || "openai"); setLLMChoice(_settings?.LLMProvider || "openai");
setVectorDb(_settings?.VectorDB || "pinecone"); setVectorDb(_settings?.VectorDB || "lancedb");
setEmbeddingEngine(_settings?.EmbeddingEngine || "openai"); setEmbeddingEngine(_settings?.EmbeddingEngine || "openai");
setLoading(false); setLoading(false);
......
...@@ -72,7 +72,7 @@ function apiWorkspaceEndpoints(app) { ...@@ -72,7 +72,7 @@ function apiWorkspaceEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent("api_workspace_created", { await EventLogs.logEvent("api_workspace_created", {
workspaceName: workspace?.name || "Unknown Workspace", workspaceName: workspace?.name || "Unknown Workspace",
...@@ -525,7 +525,7 @@ function apiWorkspaceEndpoints(app) { ...@@ -525,7 +525,7 @@ function apiWorkspaceEndpoints(app) {
await Telemetry.sendTelemetry("sent_chat", { await Telemetry.sendTelemetry("sent_chat", {
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent("api_sent_chat", { await EventLogs.logEvent("api_sent_chat", {
workspaceName: workspace?.name, workspaceName: workspace?.name,
...@@ -647,7 +647,7 @@ function apiWorkspaceEndpoints(app) { ...@@ -647,7 +647,7 @@ function apiWorkspaceEndpoints(app) {
await Telemetry.sendTelemetry("sent_chat", { await Telemetry.sendTelemetry("sent_chat", {
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent("api_sent_chat", { await EventLogs.logEvent("api_sent_chat", {
workspaceName: workspace?.name, workspaceName: workspace?.name,
......
...@@ -92,7 +92,7 @@ function chatEndpoints(app) { ...@@ -92,7 +92,7 @@ function chatEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent( await EventLogs.logEvent(
...@@ -200,7 +200,7 @@ function chatEndpoints(app) { ...@@ -200,7 +200,7 @@ function chatEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent( await EventLogs.logEvent(
......
...@@ -46,7 +46,7 @@ function embeddedEndpoints(app) { ...@@ -46,7 +46,7 @@ function embeddedEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
response.end(); response.end();
} catch (e) { } catch (e) {
......
...@@ -34,7 +34,7 @@ function workspaceThreadEndpoints(app) { ...@@ -34,7 +34,7 @@ function workspaceThreadEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}, },
user?.id user?.id
); );
......
...@@ -45,7 +45,7 @@ function workspaceEndpoints(app) { ...@@ -45,7 +45,7 @@ function workspaceEndpoints(app) {
multiUserMode: multiUserMode(response), multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}, },
user?.id user?.id
); );
......
...@@ -114,7 +114,7 @@ const Document = { ...@@ -114,7 +114,7 @@ const Document = {
await Telemetry.sendTelemetry("documents_embedded_in_workspace", { await Telemetry.sendTelemetry("documents_embedded_in_workspace", {
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent( await EventLogs.logEvent(
"workspace_documents_added", "workspace_documents_added",
...@@ -157,7 +157,7 @@ const Document = { ...@@ -157,7 +157,7 @@ const Document = {
await Telemetry.sendTelemetry("documents_removed_in_workspace", { await Telemetry.sendTelemetry("documents_removed_in_workspace", {
LLMSelection: process.env.LLM_PROVIDER || "openai", LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit", Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone", VectorDbSelection: process.env.VECTOR_DB || "lancedb",
}); });
await EventLogs.logEvent( await EventLogs.logEvent(
"workspace_documents_removed", "workspace_documents_removed",
......
function getVectorDbClass() { function getVectorDbClass() {
const vectorSelection = process.env.VECTOR_DB || "pinecone"; const vectorSelection = process.env.VECTOR_DB || "lancedb";
switch (vectorSelection) { switch (vectorSelection) {
case "pinecone": case "pinecone":
const { Pinecone } = require("../vectorDbProviders/pinecone"); const { Pinecone } = require("../vectorDbProviders/pinecone");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment