mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +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
packages/global/core/ai/model.d.ts
vendored
4
packages/global/core/ai/model.d.ts
vendored
@@ -57,13 +57,15 @@ export type ReRankModelItemType = {
|
||||
};
|
||||
|
||||
export type AudioSpeechModelType = {
|
||||
provider: ModelProviderIdType;
|
||||
model: string;
|
||||
name: string;
|
||||
charsPointsPrice: number;
|
||||
voices: { label: string; value: string; bufferId: string }[];
|
||||
};
|
||||
|
||||
export type WhisperModelType = {
|
||||
export type STTModelType = {
|
||||
provider: ModelProviderIdType;
|
||||
model: string;
|
||||
name: string;
|
||||
charsPointsPrice: number; // 60s = n points
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import type { LLMModelItemType, VectorModelItemType } from './model.d';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
import type { LLMModelItemType, STTModelType, VectorModelItemType } from './model.d';
|
||||
import { getModelProvider, ModelProviderIdType } from './provider';
|
||||
|
||||
export const defaultQAModels: LLMModelItemType[] = [
|
||||
@@ -35,6 +36,13 @@ export const defaultVectorModels: VectorModelItemType[] = [
|
||||
}
|
||||
];
|
||||
|
||||
export const defaultWhisperModel: STTModelType = {
|
||||
provider: 'OpenAI',
|
||||
model: 'whisper-1',
|
||||
name: 'whisper-1',
|
||||
charsPointsPrice: 0
|
||||
};
|
||||
|
||||
export const getModelFromList = (
|
||||
modelList: { provider: ModelProviderIdType; name: string; model: string }[],
|
||||
model: string
|
||||
@@ -46,3 +54,16 @@ export const getModelFromList = (
|
||||
avatar: provider.avatar
|
||||
};
|
||||
};
|
||||
|
||||
export enum ModelTypeEnum {
|
||||
chat = 'chat',
|
||||
embedding = 'embedding',
|
||||
tts = 'tts',
|
||||
stt = 'stt'
|
||||
}
|
||||
export const modelTypeList = [
|
||||
{ label: i18nT('common:model.type.chat'), value: ModelTypeEnum.chat },
|
||||
{ label: i18nT('common:model.type.embedding'), value: ModelTypeEnum.embedding },
|
||||
{ label: i18nT('common:model.type.tts'), value: ModelTypeEnum.tts },
|
||||
{ label: i18nT('common:model.type.stt'), value: ModelTypeEnum.stt }
|
||||
];
|
||||
|
@@ -5,6 +5,7 @@ export type ModelProviderIdType =
|
||||
| 'Claude'
|
||||
| 'Gemini'
|
||||
| 'MistralAI'
|
||||
| 'Groq'
|
||||
| 'Qwen'
|
||||
| 'Doubao'
|
||||
| 'ChatGLM'
|
||||
@@ -44,7 +45,12 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
{
|
||||
id: 'MistralAI',
|
||||
name: 'MistralAI',
|
||||
avatar: 'model/huggingface'
|
||||
avatar: 'model/mistral'
|
||||
},
|
||||
{
|
||||
id: 'Groq',
|
||||
name: 'Groq',
|
||||
avatar: 'model/groq'
|
||||
},
|
||||
{
|
||||
id: 'Qwen',
|
||||
@@ -113,7 +119,7 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
}
|
||||
];
|
||||
export const ModelProviderMap = Object.fromEntries(
|
||||
ModelProviderList.map((item) => [item.id, item])
|
||||
ModelProviderList.map((item, index) => [item.id, { ...item, order: index }])
|
||||
);
|
||||
|
||||
export const getModelProvider = (provider: ModelProviderIdType) => {
|
||||
|
Reference in New Issue
Block a user