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:
Archer
2024-12-24 15:12:07 +08:00
committed by GitHub
parent f646ef8595
commit 108e1b92ef
59 changed files with 558 additions and 329 deletions

View File

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

View File

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

View File

@@ -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[];
}

View File

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