mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-18 09:24:03 +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) {
|
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
try {
|
try {
|
||||||
if (global.systemEnv.sensitiveCheck) {
|
if (!global.systemEnv.sensitiveCheck) {
|
||||||
return jsonRes(res);
|
return jsonRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,21 +1,18 @@
|
|||||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||||
import { jsonRes } from '@/service/response';
|
import { jsonRes } from '@/service/response';
|
||||||
import type { ChatModelItemType } from '@/constants/model';
|
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
|
// get the models available to the system
|
||||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
const chatModelList: ChatModelItemType[] = [];
|
const chatModelList: ChatModelItemType[] = [];
|
||||||
|
|
||||||
if (process.env.OPENAIKEY) {
|
if (global.systemEnv.openAIKeys) {
|
||||||
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT35]);
|
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT35]);
|
||||||
}
|
}
|
||||||
if (process.env.GPT4KEY) {
|
if (global.systemEnv.gpt4Key) {
|
||||||
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT4]);
|
chatModelList.push(ChatModelMap[OpenAiChatEnum.GPT4]);
|
||||||
}
|
}
|
||||||
if (process.env.CLAUDE_KEY) {
|
|
||||||
chatModelList.push(ChatModelMap[ClaudeEnum.Claude]);
|
|
||||||
}
|
|
||||||
|
|
||||||
jsonRes(res, {
|
jsonRes(res, {
|
||||||
data: chatModelList
|
data: chatModelList
|
||||||
|
Reference in New Issue
Block a user