mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 14:03:43 +08:00
添加主题
This commit is contained in:
@@ -30,12 +30,13 @@ async function handle(
|
||||
// const matchResponse = request_data.logEntry.match(regex);
|
||||
const regex_message = /(?<="content":")(.*?)(?="}[,\]])/g;
|
||||
const matchAllMessage = request_data.logEntry.match(regex_message);
|
||||
console.log(matchAllMessage, "=====");
|
||||
// console.log(matchAllMessage, "=====");
|
||||
if (matchAllMessage.length > 0) {
|
||||
request_data.logToken =
|
||||
getTokenLength(matchAllMessage.join(" ")) +
|
||||
matchAllMessage.length * 3;
|
||||
}
|
||||
delete request_data["logEntry"];
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("[LOG]", "logToken", e);
|
||||
|
||||
Reference in New Issue
Block a user