Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
55ffc088
Unverified
Commit
55ffc088
authored
3 months ago
by
Timothy Carambat
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[Chore] Add better data-handling for unknown providers (#3026)
Add better data-handling for unknown providers
parent
c757c3fb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
+19
-13
19 additions, 13 deletions
frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
+42
-13
42 additions, 13 deletions
...end/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
with
61 additions
and
26 deletions
frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
+
19
−
13
View file @
55ffc088
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
EMBEDDING_ENGINE_PRIVACY
,
EMBEDDING_ENGINE_PRIVACY
,
LLM_SELECTION_PRIVACY
,
LLM_SELECTION_PRIVACY
,
VECTOR_DB_PRIVACY
,
VECTOR_DB_PRIVACY
,
FALLBACKS
,
}
from
"
@/pages/OnboardingFlow/Steps/DataHandling
"
;
}
from
"
@/pages/OnboardingFlow/Steps/DataHandling
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
...
@@ -67,6 +68,13 @@ function ThirdParty({ settings }) {
...
@@ -67,6 +68,13 @@ function ThirdParty({ settings }) {
const
vectorDb
=
settings
?.
VectorDB
||
"
lancedb
"
;
const
vectorDb
=
settings
?.
VectorDB
||
"
lancedb
"
;
const
{
t
}
=
useTranslation
();
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
(
return
(
<
div
className
=
"py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-theme-sidebar-border"
>
<
div
className
=
"py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-theme-sidebar-border"
>
<
div
className
=
"flex flex-col gap-8"
>
<
div
className
=
"flex flex-col gap-8"
>
...
@@ -76,16 +84,16 @@ function ThirdParty({ settings }) {
...
@@ -76,16 +84,16 @@ function ThirdParty({ settings }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
logo
}
src
=
{
LLM
Selection
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
name
}
{
LLM
Selection
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
description
.
map
((
desc
)
=>
(
{
LLM
Selection
.
description
.
map
((
desc
)
=>
(
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
))
}
))
}
</
ul
>
</
ul
>
...
@@ -96,20 +104,18 @@ function ThirdParty({ settings }) {
...
@@ -96,20 +104,18 @@ function ThirdParty({ settings }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
E
MBEDDING_ENGINE_PRIVACY
[
e
mbeddingEngine
]
.
logo
}
src
=
{
EmbeddingEngine
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
E
MBEDDING_ENGINE_PRIVACY
[
e
mbeddingEngine
]
.
name
}
{
EmbeddingEngine
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
EMBEDDING_ENGINE_PRIVACY
[
embeddingEngine
].
description
.
map
(
{
EmbeddingEngine
.
description
.
map
((
desc
)
=>
(
(
desc
)
=>
(
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
))
}
)
)
}
</
ul
>
</
ul
>
</
div
>
</
div
>
...
@@ -119,16 +125,16 @@ function ThirdParty({ settings }) {
...
@@ -119,16 +125,16 @@ function ThirdParty({ settings }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
logo
}
src
=
{
VectorDb
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
name
}
{
VectorDb
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
description
.
map
((
desc
)
=>
(
{
VectorDb
.
description
.
map
((
desc
)
=>
(
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-secondary text-sm"
>
{
desc
}
</
li
>
))
}
))
}
</
ul
>
</
ul
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
+
42
−
13
View file @
55ffc088
...
@@ -388,6 +388,30 @@ export const EMBEDDING_ENGINE_PRIVACY = {
...
@@ -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
})
{
export
default
function
DataHandling
({
setHeader
,
setForwardBtn
,
setBackBtn
})
{
const
[
llmChoice
,
setLLMChoice
]
=
useState
(
"
openai
"
);
const
[
llmChoice
,
setLLMChoice
]
=
useState
(
"
openai
"
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
...
@@ -425,6 +449,13 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
...
@@ -425,6 +449,13 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</
div
>
</
div
>
);
);
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
(
return
(
<
div
className
=
"w-full flex items-center justify-center flex-col gap-y-6"
>
<
div
className
=
"w-full flex items-center justify-center flex-col gap-y-6"
>
<
div
className
=
"p-8 flex flex-col gap-8"
>
<
div
className
=
"p-8 flex flex-col gap-8"
>
...
@@ -434,16 +465,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
...
@@ -434,16 +465,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
logo
}
src
=
{
LLM
Selection
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
name
}
{
LLM
Selection
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
LLM
_SELECTION_PRIVACY
[
llmChoice
]
.
description
.
map
((
desc
)
=>
(
{
LLM
Selection
.
description
.
map
((
desc
)
=>
(
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
))
}
))
}
</
ul
>
</
ul
>
...
@@ -454,20 +485,18 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
...
@@ -454,20 +485,18 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
E
MBEDDING_ENGINE_PRIVACY
[
e
mbeddingEngine
]
.
logo
}
src
=
{
EmbeddingEngine
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
E
MBEDDING_ENGINE_PRIVACY
[
e
mbeddingEngine
]
.
name
}
{
EmbeddingEngine
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
EMBEDDING_ENGINE_PRIVACY
[
embeddingEngine
].
description
.
map
(
{
EmbeddingEngine
.
description
.
map
((
desc
)
=>
(
(
desc
)
=>
(
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
))
}
)
)
}
</
ul
>
</
ul
>
</
div
>
</
div
>
...
@@ -477,16 +506,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
...
@@ -477,16 +506,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2.5"
>
<
div
className
=
"flex items-center gap-2.5"
>
<
img
<
img
src
=
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
logo
}
src
=
{
VectorDb
.
logo
}
alt
=
"LLM Logo"
alt
=
"LLM Logo"
className
=
"w-8 h-8 rounded"
className
=
"w-8 h-8 rounded"
/>
/>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
<
p
className
=
"text-theme-text-primary text-sm font-bold"
>
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
name
}
{
VectorDb
.
name
}
</
p
>
</
p
>
</
div
>
</
div
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
<
ul
className
=
"flex flex-col list-disc ml-4"
>
{
V
ECTOR_DB_PRIVACY
[
v
ectorDb
]
.
description
.
map
((
desc
)
=>
(
{
VectorDb
.
description
.
map
((
desc
)
=>
(
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
<
li
className
=
"text-theme-text-primary text-sm"
>
{
desc
}
</
li
>
))
}
))
}
</
ul
>
</
ul
>
...
...
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