mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-04 10:59:27 +00:00
### What problem does this PR solve? Fix: Issue of ineffective weight adjustment for retrieval_test API-related functions #9854 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c4f43a395d
commit
e8dcdfb9f0
@ -1,7 +1,7 @@
|
||||
export interface ITestRetrievalRequestBody {
|
||||
question: string;
|
||||
similarity_threshold: number;
|
||||
keywords_similarity_weight: number;
|
||||
vector_similarity_weight: number;
|
||||
rerank_id?: string;
|
||||
top_k?: number;
|
||||
use_kg?: boolean;
|
||||
|
||||
@ -12,11 +12,11 @@ import {
|
||||
topKSchema,
|
||||
} from '@/components/rerank';
|
||||
import {
|
||||
initialKeywordsSimilarityWeightValue,
|
||||
initialSimilarityThresholdValue,
|
||||
keywordsSimilarityWeightSchema,
|
||||
initialVectorSimilarityWeightValue,
|
||||
SimilaritySliderFormField,
|
||||
similarityThresholdSchema,
|
||||
vectorSimilarityWeightSchema,
|
||||
} from '@/components/similarity-slider';
|
||||
import { ButtonLoading } from '@/components/ui/button';
|
||||
import {
|
||||
@ -52,16 +52,18 @@ export default function TestingForm({
|
||||
message: t('knowledgeDetails.testTextPlaceholder'),
|
||||
}),
|
||||
...similarityThresholdSchema,
|
||||
...keywordsSimilarityWeightSchema,
|
||||
...vectorSimilarityWeightSchema,
|
||||
...topKSchema,
|
||||
use_kg: z.boolean().optional(),
|
||||
});
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
...initialSimilarityThresholdValue,
|
||||
...initialKeywordsSimilarityWeightValue,
|
||||
...initialVectorSimilarityWeightValue,
|
||||
...initialTopKValue,
|
||||
use_kg: false,
|
||||
},
|
||||
});
|
||||
|
||||
@ -82,7 +84,6 @@ export default function TestingForm({
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormContainer className="p-10">
|
||||
<SimilaritySliderFormField
|
||||
vectorSimilarityWeightName="keywords_similarity_weight"
|
||||
isTooltipShown={true}
|
||||
></SimilaritySliderFormField>
|
||||
<RerankFormFields></RerankFormFields>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user