feat: model config required check;feat: dataset text model default setting (#3866)
* feat: model config required check * feat: dataset text model default setting * perf: collection list count * fix: ts * remove index count
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { LLMModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
import { EmbeddingModelItemType, LLMModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
import { useSystemStore } from './useSystemStore';
|
||||
import { getWebReqUrl } from '@fastgpt/web/common/system/utils';
|
||||
|
||||
@@ -49,7 +49,7 @@ export const getWebLLMModel = (model?: string) => {
|
||||
|
||||
return list.find((item) => item.model === model || item.name === model) ?? defaultModels.llm!;
|
||||
};
|
||||
export const getWebDefaultModel = (llmList: LLMModelItemType[] = []) => {
|
||||
export const getWebDefaultLLMModel = (llmList: LLMModelItemType[] = []) => {
|
||||
const list = llmList.length > 0 ? llmList : useSystemStore.getState().llmModelList;
|
||||
const defaultModels = useSystemStore.getState().defaultModels;
|
||||
|
||||
@@ -57,3 +57,13 @@ export const getWebDefaultModel = (llmList: LLMModelItemType[] = []) => {
|
||||
? defaultModels.llm
|
||||
: list[0];
|
||||
};
|
||||
export const getWebDefaultEmbeddingModel = (embeddingList: EmbeddingModelItemType[] = []) => {
|
||||
const list =
|
||||
embeddingList.length > 0 ? embeddingList : useSystemStore.getState().embeddingModelList;
|
||||
const defaultModels = useSystemStore.getState().defaultModels;
|
||||
|
||||
return defaultModels.embedding &&
|
||||
list.find((item) => item.model === defaultModels.embedding?.model)
|
||||
? defaultModels.embedding
|
||||
: list[0];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user