mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Added toc enhance field to chat and retrieval operator configuration #10436 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -254,6 +254,7 @@ export const initialRetrievalValues = {
|
||||
...initialSimilarityThresholdValue,
|
||||
...initialKeywordsSimilarityWeightValue,
|
||||
use_kg: false,
|
||||
toc_enhance: false,
|
||||
cross_languages: [],
|
||||
outputs: {
|
||||
formalized_content: {
|
||||
|
||||
@ -5,6 +5,7 @@ import { KnowledgeBaseFormField } from '@/components/knowledge-base-item';
|
||||
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,
|
||||
@ -39,6 +40,7 @@ export const RetrievalPartialSchema = {
|
||||
empty_response: z.string(),
|
||||
cross_languages: z.array(z.string()),
|
||||
use_kg: z.boolean(),
|
||||
toc_enhance: z.boolean(),
|
||||
};
|
||||
|
||||
export const FormSchema = z.object({
|
||||
@ -119,6 +121,7 @@ function RetrievalForm({ node }: INextOperatorForm) {
|
||||
<EmptyResponseField></EmptyResponseField>
|
||||
<CrossLanguageFormField name="cross_languages"></CrossLanguageFormField>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
<TOCEnhanceFormField name="toc_enhance"></TOCEnhanceFormField>
|
||||
</FormContainer>
|
||||
</Collapse>
|
||||
<Output list={outputList}></Output>
|
||||
|
||||
@ -4,6 +4,7 @@ import { FormContainer } from '@/components/form-container';
|
||||
import { KnowledgeBaseFormField } from '@/components/knowledge-base-item';
|
||||
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';
|
||||
@ -53,6 +54,7 @@ const RetrievalForm = () => {
|
||||
<EmptyResponseField></EmptyResponseField>
|
||||
<CrossLanguageFormField name="cross_languages"></CrossLanguageFormField>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
<TOCEnhanceFormField name="toc_enhance"></TOCEnhanceFormField>
|
||||
</FormContainer>
|
||||
</Collapse>
|
||||
</FormWrapper>
|
||||
|
||||
@ -7,8 +7,6 @@ import {
|
||||
|
||||
export function VideoFormFields({ prefix }: OutputFormatFormFieldProps) {
|
||||
const modelOptions = useComposeLlmOptionsByModelTypes([
|
||||
LlmModelType.Chat,
|
||||
LlmModelType.Image2text,
|
||||
LlmModelType.Speech2text,
|
||||
]);
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import { KnowledgeBaseFormField } from '@/components/knowledge-base-item';
|
||||
import { MetadataFilter } from '@/components/metadata-filter';
|
||||
import { SwitchFormField } from '@/components/switch-fom-field';
|
||||
import { TavilyFormField } from '@/components/tavily-form-field';
|
||||
import { TOCEnhanceFormField } from '@/components/toc-enhance-form-field';
|
||||
import {
|
||||
FormControl,
|
||||
FormField,
|
||||
@ -109,6 +110,7 @@ export default function ChatBasicSetting() {
|
||||
label={t('tts')}
|
||||
tooltip={t('ttsTip')}
|
||||
></SwitchFormField>
|
||||
<TOCEnhanceFormField name="prompt_config.toc_enhance"></TOCEnhanceFormField>
|
||||
<TavilyFormField></TavilyFormField>
|
||||
<KnowledgeBaseFormField></KnowledgeBaseFormField>
|
||||
<MetadataFilter></MetadataFilter>
|
||||
|
||||
@ -49,6 +49,7 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||
parameters: [],
|
||||
reasoning: false,
|
||||
cross_languages: [],
|
||||
toc_enhance: false,
|
||||
},
|
||||
top_n: 8,
|
||||
similarity_threshold: 0.2,
|
||||
|
||||
@ -33,6 +33,7 @@ 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(),
|
||||
});
|
||||
|
||||
const formSchema = z.object({
|
||||
|
||||
@ -34,6 +34,7 @@ export const useRenameChat = () => {
|
||||
use_kg: false,
|
||||
reasoning: false,
|
||||
parameters: [{ key: 'knowledge', optional: false }],
|
||||
toc_enhance: false,
|
||||
},
|
||||
llm_id: tenantInfo.data.llm_id,
|
||||
llm_setting: {},
|
||||
|
||||
Reference in New Issue
Block a user