Improve ModelTypeEnum type (#3051)

This commit is contained in:
Nanguan Lin
2024-04-04 15:54:59 +08:00
committed by GitHub
parent e4f686deb7
commit 718ac3f83b
15 changed files with 47 additions and 44 deletions

View File

@@ -10,6 +10,7 @@ import { PatternRecognition, Semantic } from '@/app/components/base/icons/src/ve
import { FileSearch02 } from '@/app/components/base/icons/src/vender/solid/files'
import { useProviderContext } from '@/context/provider-context'
import { useDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
type Props = {
value: RetrievalConfig
@@ -22,7 +23,7 @@ const RetrievalMethodConfig: FC<Props> = ({
}) => {
const { t } = useTranslation()
const { supportRetrievalMethods } = useProviderContext()
const { data: rerankDefaultModel } = useDefaultModel(3)
const { data: rerankDefaultModel } = useDefaultModel(ModelTypeEnum.rerank)
const value = (() => {
if (!passValue.reranking_model.reranking_model_name) {
return {

View File

@@ -12,6 +12,7 @@ import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
import type { RetrievalConfig } from '@/types/app'
import ModelSelector from '@/app/components/header/account-setting/model-provider-page/model-selector'
import { useModelListAndDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
type Props = {
type: RETRIEVE_METHOD
@@ -30,7 +31,7 @@ const RetrievalParamConfig: FC<Props> = ({
const {
defaultModel: rerankDefaultModel,
modelList: rerankModelList,
} = useModelListAndDefaultModel(3)
} = useModelListAndDefaultModel(ModelTypeEnum.rerank)
const rerankModel = (() => {
if (value.reranking_model) {