fix: knowledge retrieval score threshold setting (#5658)

This commit is contained in:
zxhlyh 2024-06-27 14:26:14 +08:00 committed by GitHub
parent 3ccad33194
commit 2119d59da8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -99,7 +99,10 @@ const SettingsModal: FC<SettingsModalProps> = ({
description,
permission,
indexing_technique: indexMethod,
retrieval_model: postRetrievalConfig,
retrieval_model: {
...postRetrievalConfig,
score_threshold: postRetrievalConfig.score_threshold_enabled ? postRetrievalConfig.score_threshold : 0,
},
embedding_model: localeCurrentDataset.embedding_model,
embedding_model_provider: localeCurrentDataset.embedding_model_provider,
},

View File

@ -25,6 +25,7 @@ import {
useModelListAndDefaultModelAndCurrentProviderAndModel,
} from '@/app/components/header/account-setting/model-provider-page/hooks'
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { DefaultModel } from '@/app/components/header/account-setting/model-provider-page/declarations'
const rowClass = `
flex justify-between py-4 flex-wrap gap-y-2
@ -110,7 +111,10 @@ const Form = () => {
description,
permission,
indexing_technique: indexMethod,
retrieval_model: postRetrievalConfig,
retrieval_model: {
...postRetrievalConfig,
score_threshold: postRetrievalConfig.score_threshold_enabled ? postRetrievalConfig.score_threshold : 0,
},
embedding_model: embeddingModel.model,
embedding_model_provider: embeddingModel.provider,
},