Merge branch 'Yidadaa:main' into main

This commit is contained in:
DirkSchlossmacher
2023-11-08 10:35:15 +01:00
committed by GitHub
5 changed files with 34 additions and 17 deletions

View File

@@ -20,7 +20,7 @@ export async function requestOpenai(req: NextRequest) {
baseUrl = `${PROTOCOL}://${baseUrl}`;
}
if (baseUrl.endsWith('/')) {
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
@@ -31,9 +31,12 @@ export async function requestOpenai(req: NextRequest) {
console.log("[Org ID]", process.env.OPENAI_ORG_ID);
}
const timeoutId = setTimeout(() => {
controller.abort();
}, 10 * 60 * 1000);
const timeoutId = setTimeout(
() => {
controller.abort();
},
10 * 60 * 1000,
);
const fetchUrl = `${baseUrl}/${openaiPath}`;
const fetchOptions: RequestInit = {