mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 00:17:31 +00:00
perf: model provider show; perf: get init data buffer (#3459)
* pr code * perf: model table show * perf: model provider show * perf: get init data buffer * perf: get init data buffer * perf: icon
This commit is contained in:
@@ -4,7 +4,12 @@ import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
|
||||
import { FastGPTProUrl } from '../constants';
|
||||
|
||||
export const getFastGPTConfigFromDB = async () => {
|
||||
if (!FastGPTProUrl) return {} as FastGPTConfigFileType;
|
||||
if (!FastGPTProUrl) {
|
||||
return {
|
||||
config: {} as FastGPTConfigFileType,
|
||||
configId: undefined
|
||||
};
|
||||
}
|
||||
|
||||
const res = await MongoSystemConfigs.findOne({
|
||||
type: SystemConfigsTypeEnum.fastgpt
|
||||
@@ -14,5 +19,8 @@ export const getFastGPTConfigFromDB = async () => {
|
||||
|
||||
const config = res?.value || {};
|
||||
|
||||
return config as FastGPTConfigFileType;
|
||||
return {
|
||||
configId: res ? String(res._id) : undefined,
|
||||
config: config as FastGPTConfigFileType
|
||||
};
|
||||
};
|
||||
|
@@ -39,8 +39,6 @@ export const computedTemperature = ({
|
||||
model: LLMModelItemType;
|
||||
temperature: number;
|
||||
}) => {
|
||||
if (temperature < 1) return temperature;
|
||||
|
||||
temperature = +(model.maxTemperature * (temperature / 10)).toFixed(2);
|
||||
temperature = Math.max(temperature, 0.01);
|
||||
|
||||
|
1
packages/service/core/plugin/type.d.ts
vendored
1
packages/service/core/plugin/type.d.ts
vendored
@@ -2,6 +2,5 @@ import { PluginTemplateType } from '@fastgpt/global/core/plugin/type.d';
|
||||
import { SystemPluginTemplateItemType } from '@fastgpt/global/core/workflow/type';
|
||||
|
||||
declare global {
|
||||
var communityPluginsV1: PluginTemplateType[];
|
||||
var communityPlugins: SystemPluginTemplateItemType[];
|
||||
}
|
||||
|
5
packages/service/type.d.ts
vendored
5
packages/service/type.d.ts
vendored
@@ -2,7 +2,7 @@ import { FastGPTFeConfigsType, SystemEnvType } from '@fastgpt/global/common/syst
|
||||
import {
|
||||
AudioSpeechModelType,
|
||||
ReRankModelItemType,
|
||||
WhisperModelType,
|
||||
STTModelType,
|
||||
VectorModelItemType,
|
||||
LLMModelItemType
|
||||
} from '@fastgpt/global/core/ai/model.d';
|
||||
@@ -12,6 +12,7 @@ import { Worker } from 'worker_threads';
|
||||
import { TemplateMarketItemType } from '@fastgpt/global/core/workflow/type';
|
||||
|
||||
declare global {
|
||||
var systemInitBufferId: string | undefined;
|
||||
var systemVersion: string;
|
||||
var feConfigs: FastGPTFeConfigsType;
|
||||
var systemEnv: SystemEnvType;
|
||||
@@ -20,7 +21,7 @@ declare global {
|
||||
var llmModels: LLMModelItemType[];
|
||||
var vectorModels: VectorModelItemType[];
|
||||
var audioSpeechModels: AudioSpeechModelType[];
|
||||
var whisperModel: WhisperModelType;
|
||||
var whisperModel: STTModelType;
|
||||
var reRankModels: ReRankModelItemType[];
|
||||
|
||||
var workerPoll: Record<WorkerNameEnum, WorkerPool>;
|
||||
|
Reference in New Issue
Block a user