Fix: Issue of ineffective weight adjustment for retrieval_test API-related functions #9854 (#9989)

### 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:
balibabu 2025-09-09 12:32:22 +08:00 committed by GitHub
parent c4f43a395d
commit e8dcdfb9f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -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;

View File

@ -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>