mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
};
|
||||
|
@@ -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
|
||||
}
|
||||
: {}
|
||||
)
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user