Commit 9a831b5b by archer

fix: env conf

parent 7957f96d
...@@ -8,7 +8,7 @@ import { axiosConfig } from '@/service/utils/tools'; ...@@ -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);
} }
......
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment