feat: rerank modal select and weight (#4164)

This commit is contained in:
Archer
2025-03-14 14:49:27 +08:00
committed by GitHub
parent 561a496f80
commit d8712d4092
36 changed files with 282 additions and 178 deletions

View File

@@ -5,7 +5,7 @@ import { findModelFromAlldata } from '@fastgpt/service/core/ai/model';
import {
EmbeddingModelItemType,
LLMModelItemType,
ReRankModelItemType,
RerankModelItemType,
STTModelType,
TTSModelType
} from '@fastgpt/global/core/ai/model.d';
@@ -151,7 +151,7 @@ const testSTTModel = async (model: STTModelType, headers: Record<string, string>
addLog.info(`STT result: ${text}`);
};
const testReRankModel = async (model: ReRankModelItemType, headers: Record<string, string>) => {
const testReRankModel = async (model: RerankModelItemType, headers: Record<string, string>) => {
await reRankRecall({
model,
query: 'Hi',

View File

@@ -27,13 +27,6 @@ async function handler(
const dbModel = await MongoSystemModel.findOne({ model }).lean();
const modelData = findModelFromAlldata(model);
if (metadata) {
delete metadata.isActive;
delete metadata.isDefault;
delete metadata.isDefaultDatasetTextModel;
delete metadata.isDefaultDatasetImageModel;
}
const metadataConcat: Record<string, any> = {
...modelData, // system config
...dbModel?.metadata, // db config