'use client' import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import RetrievalParamConfig from '../retrieval-param-config' import type { RetrievalConfig } from '@/types/app' import { RETRIEVE_METHOD } from '@/types/app' import RadioCard from '@/app/components/base/radio-card' import { PatternRecognition, Semantic } from '@/app/components/base/icons/src/vender/solid/development' import { FileSearch02 } from '@/app/components/base/icons/src/vender/solid/files' import { useProviderContext } from '@/context/provider-context' type Props = { value: RetrievalConfig onChange: (value: RetrievalConfig) => void } const RetrievalMethodConfig: FC = ({ value, onChange, }) => { const { t } = useTranslation() const { supportRetrievalMethods } = useProviderContext() return (
{supportRetrievalMethods.includes(RETRIEVE_METHOD.semantic) && ( } title={t('dataset.retrieval.semantic_search.title')} description={t('dataset.retrieval.semantic_search.description')} isChosen={value.search_method === RETRIEVE_METHOD.semantic} onChosen={() => onChange({ ...value, search_method: RETRIEVE_METHOD.semantic, })} chosenConfig={ } /> )} {supportRetrievalMethods.includes(RETRIEVE_METHOD.semantic) && ( } title={t('dataset.retrieval.full_text_search.title')} description={t('dataset.retrieval.full_text_search.description')} isChosen={value.search_method === RETRIEVE_METHOD.fullText} onChosen={() => onChange({ ...value, search_method: RETRIEVE_METHOD.fullText, })} chosenConfig={ } /> )} {supportRetrievalMethods.includes(RETRIEVE_METHOD.semantic) && ( } title={
{t('dataset.retrieval.hybrid_search.title')}
{t('dataset.retrieval.hybrid_search.recommend')}
} description={t('dataset.retrieval.hybrid_search.description')} isChosen={value.search_method === RETRIEVE_METHOD.hybrid} onChosen={() => onChange({ ...value, search_method: RETRIEVE_METHOD.hybrid, })} chosenConfig={ } /> )}
) } export default React.memo(RetrievalMethodConfig)