diff --git a/frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx b/frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
index c107dbcd5eb..7d3cec79203 100644
--- a/frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
+++ b/frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
@@ -8,6 +8,7 @@ import {
EMBEDDING_ENGINE_PRIVACY,
LLM_SELECTION_PRIVACY,
VECTOR_DB_PRIVACY,
+ FALLBACKS,
} from "@/pages/OnboardingFlow/Steps/DataHandling";
import { useTranslation } from "react-i18next";
@@ -67,6 +68,13 @@ function ThirdParty({ settings }) {
const vectorDb = settings?.VectorDB || "lancedb";
const { t } = useTranslation();
+ const LLMSelection =
+ LLM_SELECTION_PRIVACY?.[llmChoice] || FALLBACKS.LLM(llmChoice);
+ const EmbeddingEngine =
+ EMBEDDING_ENGINE_PRIVACY?.[embeddingEngine] ||
+ FALLBACKS.EMBEDDING(embeddingEngine);
+ const VectorDb = VECTOR_DB_PRIVACY?.[vectorDb] || FALLBACKS.VECTOR(vectorDb);
+
return (
@@ -76,16 +84,16 @@ function ThirdParty({ settings }) {
- {LLM_SELECTION_PRIVACY[llmChoice].name}
+ {LLMSelection.name}
- {LLM_SELECTION_PRIVACY[llmChoice].description.map((desc) => (
+ {LLMSelection.description.map((desc) => (
- {desc}
))}
@@ -96,20 +104,18 @@ function ThirdParty({ settings }) {
- {EMBEDDING_ENGINE_PRIVACY[embeddingEngine].name}
+ {EmbeddingEngine.name}
- {EMBEDDING_ENGINE_PRIVACY[embeddingEngine].description.map(
- (desc) => (
- - {desc}
- )
- )}
+ {EmbeddingEngine.description.map((desc) => (
+ - {desc}
+ ))}
@@ -119,16 +125,16 @@ function ThirdParty({ settings }) {
- {VECTOR_DB_PRIVACY[vectorDb].name}
+ {VectorDb.name}
- {VECTOR_DB_PRIVACY[vectorDb].description.map((desc) => (
+ {VectorDb.description.map((desc) => (
- {desc}
))}
diff --git a/frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx b/frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
index 713891300dd..1394ff19cd6 100644
--- a/frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
+++ b/frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
@@ -388,6 +388,30 @@ export const EMBEDDING_ENGINE_PRIVACY = {
},
};
+export const FALLBACKS = {
+ LLM: (provider) => ({
+ name: "Unknown",
+ description: [
+ `"${provider}" has no known data handling policy defined in AnythingLLM`,
+ ],
+ logo: AnythingLLMIcon,
+ }),
+ EMBEDDING: (provider) => ({
+ name: "Unknown",
+ description: [
+ `"${provider}" has no known data handling policy defined in AnythingLLM`,
+ ],
+ logo: AnythingLLMIcon,
+ }),
+ VECTOR: (provider) => ({
+ name: "Unknown",
+ description: [
+ `"${provider}" has no known data handling policy defined in AnythingLLM`,
+ ],
+ logo: AnythingLLMIcon,
+ }),
+};
+
export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
const [llmChoice, setLLMChoice] = useState("openai");
const [loading, setLoading] = useState(true);
@@ -425,6 +449,13 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
);
+ const LLMSelection =
+ LLM_SELECTION_PRIVACY?.[llmChoice] || FALLBACKS.LLM(llmChoice);
+ const EmbeddingEngine =
+ EMBEDDING_ENGINE_PRIVACY?.[embeddingEngine] ||
+ FALLBACKS.EMBEDDING(embeddingEngine);
+ const VectorDb = VECTOR_DB_PRIVACY?.[vectorDb] || FALLBACKS.VECTOR(vectorDb);
+
return (
@@ -434,16 +465,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
- {LLM_SELECTION_PRIVACY[llmChoice].name}
+ {LLMSelection.name}
- {LLM_SELECTION_PRIVACY[llmChoice].description.map((desc) => (
+ {LLMSelection.description.map((desc) => (
- {desc}
))}
@@ -454,20 +485,18 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
- {EMBEDDING_ENGINE_PRIVACY[embeddingEngine].name}
+ {EmbeddingEngine.name}
- {EMBEDDING_ENGINE_PRIVACY[embeddingEngine].description.map(
- (desc) => (
- - {desc}
- )
- )}
+ {EmbeddingEngine.description.map((desc) => (
+ - {desc}
+ ))}
@@ -477,16 +506,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
- {VECTOR_DB_PRIVACY[vectorDb].name}
+ {VectorDb.name}
- {VECTOR_DB_PRIVACY[vectorDb].description.map((desc) => (
+ {VectorDb.description.map((desc) => (
- {desc}
))}