feat: add google api safety setting

This commit is contained in:
YeungYeah
2024-06-15 12:09:58 +08:00
parent 24bf7950d8
commit 74986803db
6 changed files with 60 additions and 8 deletions

View File

@@ -54,6 +54,7 @@ import {
Anthropic,
Azure,
Google,
GoogleSafetySettingsThreshold,
OPENAI_BASE_URL,
Path,
RELEASE_URL,
@@ -1122,6 +1123,35 @@ export function Settings() {
}
></input>
</ListItem>
<ListItem
title={
Locale.Settings.Access.Google.GoogleSafetySettings
.Title
}
subTitle={
Locale.Settings.Access.Google.GoogleSafetySettings
.SubTitle
}
>
<Select
value={accessStore.googleSafetySettings}
onChange={(e) => {
accessStore.update(
(access) =>
(access.googleSafetySettings = e.target
.value as GoogleSafetySettingsThreshold),
);
}}
>
{Object.entries(GoogleSafetySettingsThreshold).map(
([k, v]) => (
<option value={v} key={k}>
{k}
</option>
),
)}
</Select>
</ListItem>
</>
)}
{accessStore.provider === ServiceProvider.Anthropic && (