From edaa25d1d5d37efdfa2c7ef959362b51eba383c7 Mon Sep 17 00:00:00 2001 From: DirkSchlossmacher <62424946+DirkSchlossmacher@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:56:19 +0100 Subject: [PATCH] const modelIdentifier = modelConfig.model; --- app/client/platforms/openai.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index c74af0d61..09c2be436 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -109,11 +109,12 @@ export class ChatGPTApi implements LLMApi { // export default async function handler(req: NextApiRequest, res: NextApiResponse) { // Retrieve the session using getServerAuthSession const session = await getServerSession(); - + const modelIdentifier = modelConfig.model; + if (session?.user?.email) { // Now you have the user's email from the session const userEmail = session.user.email; - const modelIdentifier = modelConfig.model; + const dateKey = new Date().toISOString().slice(0, 7); // "YYYY-MM" console.log("API Call: ", userEmail, modelIdentifier);