model
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { getSystemModelList } from '@/api/system';
|
||||
import type { ShareChatEditType } from '@/types/model';
|
||||
import type { ModelSchema } from '@/types/mongoSchema';
|
||||
|
||||
@@ -10,7 +9,8 @@ export enum OpenAiChatEnum {
|
||||
'GPT35' = 'gpt-3.5-turbo',
|
||||
'GPT3516k' = 'gpt-3.5-turbo-16k',
|
||||
'GPT4' = 'gpt-4',
|
||||
'GPT432k' = 'gpt-4-32k'
|
||||
'GPT432k' = 'gpt-4-32k',
|
||||
'GPT4LOW' = 'gpt-4-0314'
|
||||
}
|
||||
|
||||
export type ChatModelType = `${OpenAiChatEnum}`;
|
||||
@@ -25,6 +25,14 @@ export type ChatModelItemType = {
|
||||
};
|
||||
|
||||
export const ChatModelMap = {
|
||||
[OpenAiChatEnum.GPT4LOW]: {
|
||||
chatModel: OpenAiChatEnum.GPT4LOW,
|
||||
name: '窝牛Gpt4不稳定',
|
||||
contextMaxToken: 4000,
|
||||
systemMaxToken: 2400,
|
||||
maxTemperature: 1.2,
|
||||
price: 1.5
|
||||
},
|
||||
[OpenAiChatEnum.GPT35]: {
|
||||
chatModel: OpenAiChatEnum.GPT35,
|
||||
name: 'Gpt35-4k',
|
||||
@@ -59,15 +67,12 @@ export const ChatModelMap = {
|
||||
}
|
||||
};
|
||||
|
||||
let chatModelList: ChatModelItemType[] = [];
|
||||
export const getChatModelList = async () => {
|
||||
if (chatModelList.length > 0) {
|
||||
return chatModelList;
|
||||
}
|
||||
const list = await getSystemModelList();
|
||||
chatModelList = list;
|
||||
return list;
|
||||
};
|
||||
export const chatModelList: ChatModelItemType[] = [
|
||||
ChatModelMap[OpenAiChatEnum.GPT3516k],
|
||||
ChatModelMap[OpenAiChatEnum.GPT35],
|
||||
ChatModelMap[OpenAiChatEnum.GPT4LOW],
|
||||
ChatModelMap[OpenAiChatEnum.GPT4]
|
||||
];
|
||||
|
||||
export const defaultModel: ModelSchema = {
|
||||
_id: 'modelId',
|
||||
|
||||
Reference in New Issue
Block a user