mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 00:56:26 +00:00
20 lines
676 B
TypeScript
20 lines
676 B
TypeScript
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
import { jsonRes } from '@/service/response';
|
|
import type { ChatModelItemType } from '@/constants/model';
|
|
import { ChatModelMap, OpenAiChatEnum } from '@/constants/model';
|
|
|
|
// get the models available to the system
|
|
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
const chatModelList: ChatModelItemType[] = [];
|
|
|
|
if (process.env.OPENAIKEY) {
|
|
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT3516k]);
|
|
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT35]);
|
|
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT4]);
|
|
}
|
|
|
|
jsonRes(res, {
|
|
data: chatModelList
|
|
});
|
|
}
|