From 8e962b156322a56450e28aa481e24dd198399008 Mon Sep 17 00:00:00 2001 From: tt <1109394634@qq.com> Date: Tue, 20 Feb 2024 15:29:10 +0800 Subject: [PATCH] update --- src/app/[locale]/api/generate/route.ts | 6 +----- src/configs/openai.ts | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 src/configs/openai.ts diff --git a/src/app/[locale]/api/generate/route.ts b/src/app/[locale]/api/generate/route.ts index a00d93d..d89b4a0 100644 --- a/src/app/[locale]/api/generate/route.ts +++ b/src/app/[locale]/api/generate/route.ts @@ -1,8 +1,4 @@ - - -export const apiKey = process.env.OPENAI_API_KEY || 'sk-xxxxxx' -export const model = process.env.OPENAI_API_MODEL || 'sora-1.0-turbo' -export const baseUrl = process.env.OPENAI_API_BASE_URL || 'https://fake-sora-api.sorawebui.com' +import {apiKey, baseUrl, model} from "~/configs/openai"; export async function POST(req: Request, res: Response) { diff --git a/src/configs/openai.ts b/src/configs/openai.ts new file mode 100644 index 0000000..9822f87 --- /dev/null +++ b/src/configs/openai.ts @@ -0,0 +1,3 @@ +export const apiKey = process.env.OPENAI_API_KEY || 'sk-xxxxxx' +export const model = process.env.OPENAI_API_MODEL || 'sora-1.0-turbo' +export const baseUrl = process.env.OPENAI_API_BASE_URL || 'https://fake-sora-api.sorawebui.com'