fix(HealthCheck): exclude rerank models from being checked (#3969)
* fix(HealthCheck): exclude rerank models from being checked * fix: info in en
This commit is contained in:
parent
487d7a502e
commit
c162242433
@ -1119,7 +1119,7 @@
|
||||
"docs_more_details": "for more details",
|
||||
"get_api_key": "Get API Key",
|
||||
"is_not_support_array_content": "Enable compatible mode",
|
||||
"no_models": "Please add models first before checking the API connection",
|
||||
"no_models_for_check": "No models available for checking (e.g. chat models)",
|
||||
"not_checked": "Not Checked",
|
||||
"remove_duplicate_keys": "Remove Duplicate Keys",
|
||||
"remove_invalid_keys": "Remove Invalid Keys",
|
||||
|
||||
@ -1118,7 +1118,7 @@
|
||||
"docs_more_details": "詳細を確認",
|
||||
"get_api_key": "APIキーを取得",
|
||||
"is_not_support_array_content": "互換モードを有効にする",
|
||||
"no_models": "API接続をチェックする前に、モデルを追加してください",
|
||||
"no_models_for_check": "チェックするモデルがありません(例:会話モデル)",
|
||||
"not_checked": "未チェック",
|
||||
"remove_duplicate_keys": "重複キーを削除",
|
||||
"remove_invalid_keys": "無効なキーを削除",
|
||||
|
||||
@ -1118,7 +1118,7 @@
|
||||
"docs_more_details": "для получения дополнительной информации",
|
||||
"get_api_key": "Получить ключ API",
|
||||
"is_not_support_array_content": "Включить совместимый режим",
|
||||
"no_models": "Пожалуйста, добавьте модели перед проверкой соединения с API",
|
||||
"no_models_for_check": "Нет моделей для проверки (например, диалоговые модели)",
|
||||
"not_checked": "Не проверено",
|
||||
"remove_duplicate_keys": "Удалить дубликаты ключей",
|
||||
"remove_invalid_keys": "Удалить недействительные ключи",
|
||||
|
||||
@ -1119,7 +1119,7 @@
|
||||
"docs_more_details": "获取更多详情",
|
||||
"get_api_key": "点击这里获取密钥",
|
||||
"is_not_support_array_content": "开启兼容模式",
|
||||
"no_models": "请先添加模型再检查 API 连接",
|
||||
"no_models_for_check": "没有可以被检查的模型(例如对话模型)",
|
||||
"not_checked": "未检查",
|
||||
"remove_duplicate_keys": "移除重复密钥",
|
||||
"remove_invalid_keys": "删除无效密钥",
|
||||
|
||||
@ -1118,7 +1118,7 @@
|
||||
"docs_more_details": "檢視更多細節",
|
||||
"get_api_key": "點選這裡取得金鑰",
|
||||
"is_not_support_array_content": "開啟相容模式",
|
||||
"no_models": "請先新增模型再檢查 API 連接",
|
||||
"no_models_for_check": "沒有可以被檢查的模型(例如對話模型)",
|
||||
"not_checked": "未檢查",
|
||||
"remove_duplicate_keys": "移除重複金鑰",
|
||||
"remove_invalid_keys": "刪除無效金鑰",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { CheckOutlined, ExportOutlined, HeartOutlined, LoadingOutlined, SettingOutlined } from '@ant-design/icons'
|
||||
import { HStack } from '@renderer/components/Layout'
|
||||
import OAuthButton from '@renderer/components/OAuth/OAuthButton'
|
||||
import { isEmbeddingModel, isRerankModel } from '@renderer/config/models'
|
||||
import { PROVIDER_CONFIG } from '@renderer/config/providers'
|
||||
import { useTheme } from '@renderer/context/ThemeProvider'
|
||||
import { useProvider } from '@renderer/hooks/useProvider'
|
||||
@ -91,12 +92,14 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
||||
const onUpdateApiVersion = () => updateProvider({ ...provider, apiVersion })
|
||||
|
||||
const onHealthCheck = async () => {
|
||||
if (isEmpty(models)) {
|
||||
const modelsToCheck = models.filter((model) => !isRerankModel(model))
|
||||
|
||||
if (isEmpty(modelsToCheck)) {
|
||||
window.message.error({
|
||||
key: 'no-models',
|
||||
style: { marginTop: '3vh' },
|
||||
duration: 5,
|
||||
content: t('settings.provider.no_models')
|
||||
content: t('settings.provider.no_models_for_check')
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -124,7 +127,7 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
||||
}
|
||||
|
||||
// Prepare the list of models to be checked
|
||||
const initialStatuses = models.map((model) => ({
|
||||
const initialStatuses = modelsToCheck.map((model) => ({
|
||||
model,
|
||||
checking: true,
|
||||
status: undefined
|
||||
@ -135,7 +138,7 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
||||
const checkResults = await checkModelsHealth(
|
||||
{
|
||||
provider: { ...provider, apiHost },
|
||||
models,
|
||||
models: modelsToCheck,
|
||||
apiKeys: result.apiKeys,
|
||||
isConcurrent: result.isConcurrent
|
||||
},
|
||||
@ -180,12 +183,14 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
||||
}
|
||||
|
||||
const onCheckApi = async () => {
|
||||
if (isEmpty(models)) {
|
||||
const modelsToCheck = models.filter((model) => !isEmbeddingModel(model) && !isRerankModel(model))
|
||||
|
||||
if (isEmpty(modelsToCheck)) {
|
||||
window.message.error({
|
||||
key: 'no-models',
|
||||
style: { marginTop: '3vh' },
|
||||
duration: 5,
|
||||
content: t('settings.provider.no_models')
|
||||
content: t('settings.provider.no_models_for_check')
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { TopView } from '@renderer/components/TopView'
|
||||
import { isEmbeddingModel } from '@renderer/config/models'
|
||||
import { isEmbeddingModel, isRerankModel } from '@renderer/config/models'
|
||||
import i18n from '@renderer/i18n'
|
||||
import { Provider } from '@renderer/types'
|
||||
import { Modal, Select } from 'antd'
|
||||
@ -16,7 +16,7 @@ interface Props extends ShowParams {
|
||||
}
|
||||
|
||||
const PopupContainer: React.FC<Props> = ({ provider, resolve, reject }) => {
|
||||
const models = orderBy(provider.models, 'group').filter((i) => !isEmbeddingModel(i))
|
||||
const models = orderBy(provider.models, 'group').filter((i) => !isEmbeddingModel(i) && !isRerankModel(i))
|
||||
const [open, setOpen] = useState(true)
|
||||
const [model, setModel] = useState(first(models))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user