perf: init model (#4610)

* fix: model config undefined value

* perf: init model
This commit is contained in:
Archer
2025-04-21 14:44:34 +08:00
committed by GitHub
parent f789af51f5
commit 9cd6d2e81f
11 changed files with 80 additions and 60 deletions

View File

@@ -1,3 +1,4 @@
import { cloneDeep } from 'lodash';
import { SystemModelItemType } from './type';
export const getDefaultLLMModel = () => global?.systemDefaultModel.llm!;
@@ -53,5 +54,5 @@ export const findAIModel = (model: string): SystemModelItemType | undefined => {
);
};
export const findModelFromAlldata = (model: string) => {
return global.systemModelList.find((item) => item.model === model);
return cloneDeep(global.systemModelList.find((item) => item.model === model));
};