4.8.20 update (#3706)

* fix: rerank auth token

* feat: check null value

* bind notify

* perf: reasoning config

* Adapt mongo 4.x index
This commit is contained in:
Archer
2025-02-06 14:34:43 +08:00
committed by GitHub
parent 772c1cde77
commit d857a391b3
14 changed files with 61 additions and 30 deletions

View File

@@ -24,7 +24,7 @@ export const aiTranscriptions = async ({
? { url: modelData.requestUrl }
: {
baseURL: aiAxiosConfig.baseUrl,
url: modelData.requestUrl || '/audio/transcriptions'
url: '/audio/transcriptions'
}),
headers: {
Authorization: modelData.requestAuth

View File

@@ -11,7 +11,11 @@ import {
ReRankModelItemType
} from '@fastgpt/global/core/ai/model.d';
import { debounce } from 'lodash';
import { ModelProviderType } from '@fastgpt/global/core/ai/provider';
import {
getModelProvider,
ModelProviderIdType,
ModelProviderType
} from '@fastgpt/global/core/ai/provider';
import { findModelFromAlldata } from '../model';
import {
reloadFastGPTConfigBuffer,
@@ -91,7 +95,7 @@ export const loadSystemModels = async (init = false) => {
await Promise.all(
providerList.map(async (name) => {
const fileContent = (await import(`./provider/${name}`))?.default as {
provider: ModelProviderType;
provider: ModelProviderIdType;
list: SystemModelItemType[];
};
@@ -101,7 +105,7 @@ export const loadSystemModels = async (init = false) => {
const modelData: any = {
...fileModel,
...dbModel?.metadata,
provider: dbModel?.metadata?.provider || fileContent.provider,
provider: getModelProvider(dbModel?.metadata?.provider || fileContent.provider).id,
type: dbModel?.metadata?.type || fileModel.type,
isCustom: false
};

View File

@@ -32,12 +32,14 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
model: model.model,
input: [input]
},
model.requestUrl && model.requestAuth
model.requestUrl
? {
path: model.requestUrl,
headers: {
Authorization: `Bearer ${model.requestAuth}`
}
headers: model.requestAuth
? {
Authorization: `Bearer ${model.requestAuth}`
}
: undefined
}
: {}
)

View File

@@ -26,7 +26,7 @@ export function reRankRecall({
return Promise.reject('no rerank model');
}
const { baseUrl, authorization } = getAxiosConfig({});
const { baseUrl, authorization } = getAxiosConfig();
let start = Date.now();
return POST<PostReRankResponse>(
@@ -38,7 +38,7 @@ export function reRankRecall({
},
{
headers: {
Authorization: model.requestAuth ? model.requestAuth : authorization
Authorization: model.requestAuth ? `Bearer ${model.requestAuth}` : authorization
},
timeout: 30000
}

View File

@@ -37,12 +37,7 @@ try {
{ teamId: 1, datasetId: 1, fullTextToken: 'text' },
{
name: 'teamId_1_datasetId_1_fullTextToken_text',
default_language: 'none',
collation: {
locale: 'simple', // 使用简单匹配规则
strength: 2, // 忽略大小写
caseLevel: false // 进一步确保大小写不敏感
}
default_language: 'none'
}
);
DatasetDataTextSchema.index({ dataId: 1 }, { unique: true });