mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
Feat: Remove "page index" and "use kg" from chat and retrieval form. (#17627)
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SwitchFormField } from './switch-fom-field';
|
||||
|
||||
type Props = { name: string };
|
||||
|
||||
export function TOCEnhanceFormField({ name }: Props) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<SwitchFormField
|
||||
name={name}
|
||||
label={t('chat.tocEnhance')}
|
||||
tooltip={t('chat.tocEnhanceTip')}
|
||||
></SwitchFormField>
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SwitchFormField } from './switch-fom-field';
|
||||
|
||||
interface UseKnowledgeGraphFormFieldProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function UseKnowledgeGraphFormField({
|
||||
name,
|
||||
}: UseKnowledgeGraphFormFieldProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<SwitchFormField
|
||||
name={name}
|
||||
label={t('chat.useKnowledgeGraph')}
|
||||
tooltip={t('chat.useKnowledgeGraphTip')}
|
||||
></SwitchFormField>
|
||||
);
|
||||
}
|
||||
@@ -93,8 +93,6 @@ export const initialRetrievalValues = {
|
||||
empty_response: '',
|
||||
...initialSimilarityThresholdValue,
|
||||
...initialKeywordsSimilarityWeightValue,
|
||||
use_kg: false,
|
||||
toc_enhance: false,
|
||||
cross_languages: [],
|
||||
retrieval_from: RetrievalFrom.Dataset,
|
||||
outputs: {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { RAGFlowFormItem } from '@/components/ragflow-form';
|
||||
import { RerankFormFields } from '@/components/rerank';
|
||||
import { SimilaritySliderFormField } from '@/components/similarity-slider';
|
||||
import { TOCEnhanceFormField } from '@/components/toc-enhance-form-field';
|
||||
|
||||
import { TopNFormField } from '@/components/top-n-item';
|
||||
import {
|
||||
Form,
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from '@/components/ui/form';
|
||||
import { Radio } from '@/components/ui/radio';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { UseKnowledgeGraphFormField } from '@/components/use-knowledge-graph-item';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { memo, useMemo } from 'react';
|
||||
import {
|
||||
@@ -51,8 +51,6 @@ export const RetrievalPartialSchema = {
|
||||
rerank_id: z.string(),
|
||||
empty_response: z.string(),
|
||||
cross_languages: z.array(z.string()),
|
||||
use_kg: z.boolean(),
|
||||
toc_enhance: z.boolean(),
|
||||
...MetadataFilterSchema,
|
||||
memory_ids: z.array(z.string()).optional(),
|
||||
retrieval_from: z.string(),
|
||||
@@ -188,8 +186,6 @@ function RetrievalForm({ node }: INextOperatorForm) {
|
||||
{hideKnowledgeGraphField || (
|
||||
<>
|
||||
<CrossLanguageFormField name="cross_languages"></CrossLanguageFormField>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
<TOCEnhanceFormField name="toc_enhance"></TOCEnhanceFormField>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
|
||||
@@ -4,10 +4,10 @@ import { FormContainer } from '@/components/form-container';
|
||||
import { MetadataFilter } from '@/components/metadata-filter';
|
||||
import { RerankFormFields } from '@/components/rerank';
|
||||
import { SimilaritySliderFormField } from '@/components/similarity-slider';
|
||||
import { TOCEnhanceFormField } from '@/components/toc-enhance-form-field';
|
||||
|
||||
import { TopNFormField } from '@/components/top-n-item';
|
||||
import { Form } from '@/components/ui/form';
|
||||
import { UseKnowledgeGraphFormField } from '@/components/use-knowledge-graph-item';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { t } from 'i18next';
|
||||
import { useForm } from 'react-hook-form';
|
||||
@@ -69,8 +69,6 @@ const RetrievalForm = () => {
|
||||
{hideKnowledgeGraphField || (
|
||||
<>
|
||||
<CrossLanguageFormField name="cross_languages"></CrossLanguageFormField>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
<TOCEnhanceFormField name="toc_enhance"></TOCEnhanceFormField>
|
||||
</>
|
||||
)}
|
||||
</FormContainer>
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { UseKnowledgeGraphFormField } from '@/components/use-knowledge-graph-item';
|
||||
|
||||
import { useTestRetrieval } from '@/hooks/use-knowledge-request';
|
||||
import { ITestRetrievalRequestBody } from '@/interfaces/request/knowledge';
|
||||
import { trim } from 'lodash';
|
||||
@@ -63,7 +63,6 @@ export default function TestingForm({
|
||||
...similarityThresholdSchema,
|
||||
...vectorSimilarityWeightSchema,
|
||||
...topKSchema,
|
||||
use_kg: z.boolean().optional(),
|
||||
dataset_ids: z.array(z.string()).optional(),
|
||||
...MetadataFilterSchema,
|
||||
size: z.number().optional(),
|
||||
@@ -75,7 +74,6 @@ export default function TestingForm({
|
||||
...initialSimilarityThresholdValue,
|
||||
...initialVectorSimilarityWeightValue,
|
||||
...initialTopKValue,
|
||||
use_kg: false,
|
||||
dataset_ids: [knowledgeBaseId],
|
||||
size: 10,
|
||||
},
|
||||
@@ -107,7 +105,6 @@ export default function TestingForm({
|
||||
<RerankFormFields
|
||||
ownerTenantId={useKnowledgeBaseContext().knowledgeBase?.tenant_id}
|
||||
></RerankFormFields>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
<CrossLanguageFormField
|
||||
name={'cross_languages'}
|
||||
></CrossLanguageFormField>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { RerankFormFields } from '@/components/rerank';
|
||||
import { SimilaritySliderFormField } from '@/components/similarity-slider';
|
||||
import { SwitchFormField } from '@/components/switch-fom-field';
|
||||
import { TavilyFormField } from '@/components/tavily-form-field';
|
||||
import { TOCEnhanceFormField } from '@/components/toc-enhance-form-field';
|
||||
|
||||
import { TopNFormField } from '@/components/top-n-item';
|
||||
import {
|
||||
FormControl,
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { MultiSelect } from '@/components/ui/multi-select';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { UseKnowledgeGraphFormField } from '@/components/use-knowledge-graph-item';
|
||||
|
||||
import { useFetchKnowledgeMetadataKeys } from '@/hooks/use-knowledge-request';
|
||||
import { prefixName } from '@/utils/form';
|
||||
import { getDirAttribute } from '@/utils/text-direction';
|
||||
@@ -127,9 +127,6 @@ export function ChatPromptEngine({ prefix = '' }: ChatPromptEngineProps) {
|
||||
label={t('chat.tts')}
|
||||
tooltip={t('chat.ttsTip')}
|
||||
></SwitchFormField>
|
||||
<TOCEnhanceFormField
|
||||
name={prefixName(prefix, 'prompt_config.toc_enhance')}
|
||||
></TOCEnhanceFormField>
|
||||
<TavilyFormField
|
||||
name={prefixName(prefix, 'prompt_config.tavily_api_key')}
|
||||
></TavilyFormField>
|
||||
@@ -221,9 +218,6 @@ export function ChatPromptEngine({ prefix = '' }: ChatPromptEngineProps) {
|
||||
label={t('chat.multiTurn')}
|
||||
tooltip={t('chat.multiTurnTip')}
|
||||
></SwitchFormField>
|
||||
<UseKnowledgeGraphFormField
|
||||
name={prefixName(prefix, 'prompt_config.use_kg')}
|
||||
></UseKnowledgeGraphFormField>
|
||||
<RerankFormFields prefix={prefix}></RerankFormFields>
|
||||
<CrossLanguageFormField
|
||||
name={prefixName(prefix, 'prompt_config.cross_languages')}
|
||||
|
||||
@@ -50,13 +50,11 @@ export function ChatSettings({ hasSingleChatBox }: ChatSettingsProps) {
|
||||
quote: true,
|
||||
keyword: false,
|
||||
tts: false,
|
||||
use_kg: false,
|
||||
refine_multiturn: true,
|
||||
system: '',
|
||||
parameters: [],
|
||||
reasoning: false,
|
||||
cross_languages: [],
|
||||
toc_enhance: false,
|
||||
reference_metadata: {
|
||||
include: false,
|
||||
fields: undefined,
|
||||
|
||||
@@ -23,7 +23,6 @@ export function useChatSettingSchema() {
|
||||
prologue: z.string().optional(),
|
||||
system: z.string().min(1, { message: t('systemMessage') }),
|
||||
refine_multiturn: z.boolean(),
|
||||
use_kg: z.boolean(),
|
||||
parameters: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -35,7 +34,6 @@ export function useChatSettingSchema() {
|
||||
tavily_api_key: z.string().optional(),
|
||||
reasoning: z.boolean().optional(),
|
||||
cross_languages: z.array(z.string()).optional(),
|
||||
toc_enhance: z.boolean().optional(),
|
||||
reference_metadata: z
|
||||
.object({
|
||||
include: z.boolean().optional(),
|
||||
|
||||
Reference in New Issue
Block a user