Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
439c4058
authored
2024-09-10 14:16:12 +0800
by
Marwin Cañeta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
#1: Token count does not update on User Dashboard and Master Dashboard
1 parent
25cf9790
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
index.js
index.js
View file @
439c405
...
...
@@ -235,10 +235,18 @@ async function runGPTTurbo(req, res) {
}
catch
(
e
)
{
console
.
log
(
'Error encoding prompt text'
,
e
);
}
let
usage_params
=
{
"aiwp_logged_in"
:
aiwp_logged_in
,
"app"
:
"chatbot+"
,
"prompt_token"
:
usage
.
prompt_tokens
,
"total_token"
:
usage
.
total_tokens
,
"aiwp_app_id"
:
aiwp_app_id
,
"usage_tries"
:
TRIED_USAGE
,
ipdflu
:
getClientIP
(
req
)
"aiwp_logged_in"
:
aiwp_logged_in
,
"app"
:
"chatbot+"
,
"prompt_token"
:
usage
.
prompt_tokens
,
"total_token"
:
usage
.
total_tokens
,
"aiwp_app_id"
:
aiwp_app_id
,
"usage_tries"
:
TRIED_USAGE
,
ipdflu
:
getClientIP
(
req
)
};
if
(
IS_FREE_USER
)
{
if
(
IS_FREE_USER
)
{
await
setUsage
(
usage_params
);
}
else
{
await
setChatUsage
(
usage_params
);
...
...
@@ -330,11 +338,19 @@ async function runOpensource(req, res) {
}
}
finally
{
let
usage_params
=
{
"aiwp_logged_in"
:
aiwp_logged_in
,
"app"
:
"chatbot+"
,
"prompt_token"
:
usage
.
prompt_tokens
,
"total_token"
:
usage
.
total_tokens
,
"aiwp_app_id"
:
aiwp_app_id
,
"usage_tries"
:
TRIED_USAGE
,
ipdflu
:
getClientIP
(
req
)
"aiwp_logged_in"
:
aiwp_logged_in
,
"app"
:
"chatbot+"
,
"prompt_token"
:
usage
.
prompt_tokens
,
"total_token"
:
usage
.
total_tokens
,
"aiwp_app_id"
:
aiwp_app_id
,
"usage_tries"
:
TRIED_USAGE
,
ipdflu
:
getClientIP
(
req
)
};
if
(
IS_FREE_USER
)
{
if
(
IS_FREE_USER
)
{
await
setUsage
(
usage_params
);
}
else
{
await
setChatUsage
(
usage_params
);
}
result_response
=
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment