mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 11:36:38 +08:00
no model tracking in redis
This commit is contained in:
parent
d0a8be1f26
commit
bf334d93fe
@ -112,12 +112,11 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
|
|
||||||
console.log("[Request] openai payload: ", requestPayload);
|
console.log("[Request] openai payload: ", requestPayload);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const modelIdentifier = modelConfig.model;
|
const modelIdentifier = modelConfig.model;
|
||||||
console.log("API Call: session or email is not available - model: ", modelIdentifier);
|
console.log("API Call: session or email is not available - model: ", modelIdentifier);
|
||||||
|
|
||||||
// const session = await getMyServerSession();
|
/*
|
||||||
|
const session = await getMyServerSession();
|
||||||
|
|
||||||
if (session?.user?.email) {
|
if (session?.user?.email) {
|
||||||
// Now you have the user's email from the session
|
// Now you have the user's email from the session
|
||||||
@ -134,29 +133,6 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
console.log("API Call: session or email is not available - model: ", modelIdentifier);
|
console.log("API Call: session or email is not available - model: ", modelIdentifier);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
||||||
// Retrieve the session using getServerAuthSession
|
|
||||||
|
|
||||||
const session = await getServerSession();
|
|
||||||
|
|
||||||
if (session?.user?.email) {
|
|
||||||
// Now you have the user's email from the session
|
|
||||||
const userEmail = session.user.email;
|
|
||||||
|
|
||||||
const dateKey = new Date().toISOString().slice(0, 7); // "YYYY-MM"
|
|
||||||
console.log("API Call: ", userEmail, modelIdentifier);
|
|
||||||
|
|
||||||
// Use the userEmail to increment the API call count
|
|
||||||
await incrementAPICallCount(userEmail, modelIdentifier, dateKey);
|
|
||||||
|
|
||||||
// ... rest of your API route logic ...
|
|
||||||
} else {
|
|
||||||
// Handle cases where the session or email is not available
|
|
||||||
console.log("API Call: session or email is not available - model: ", modelIdentifier);
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const shouldStream = !!options.config.stream;
|
const shouldStream = !!options.config.stream;
|
||||||
|
Loading…
Reference in New Issue
Block a user