mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
fix: env conf
This commit is contained in:
@@ -8,7 +8,7 @@ import { axiosConfig } from '@/service/utils/tools';
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
try {
|
||||
if (global.systemEnv.sensitiveCheck) {
|
||||
if (!global.systemEnv.sensitiveCheck) {
|
||||
return jsonRes(res);
|
||||
}
|
||||
|
||||
|
@@ -1,21 +1,18 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { jsonRes } from '@/service/response';
|
||||
import type { ChatModelItemType } from '@/constants/model';
|
||||
import { ChatModelMap, OpenAiChatEnum, ClaudeEnum } 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) {
|
||||
if (global.systemEnv.openAIKeys) {
|
||||
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT35]);
|
||||
}
|
||||
if (process.env.GPT4KEY) {
|
||||
if (global.systemEnv.gpt4Key) {
|
||||
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT4]);
|
||||
}
|
||||
if (process.env.CLAUDE_KEY) {
|
||||
chatModelList.push(ChatModelMap[ClaudeEnum.Claude]);
|
||||
}
|
||||
|
||||
jsonRes(res, {
|
||||
data: chatModelList
|
||||
|
Reference in New Issue
Block a user