d565d275 by Jonille Arreglo

28594_usage_tracking

1 parent 1d354b8b
Showing 1 changed file with 1 additions and 4 deletions
......@@ -129,10 +129,7 @@ app.post('/api', async (req, res) => {
usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
// TOKEN USAGE
axios.post(`${process.env.API_URL}e/set-chat-usage`,
{ aiwp_logged_in: req.cookies[user_secret_id], app: 'chatbot', prompt_token: usage.prompt_tokens, total_token: usage.total_tokens },
{ headers: { 'content-type': 'application/x-www-form-urlencoded' }
});
btutil_setChatUsage('chatgpt', usage.prompt_tokens, usage.total_tokens);
} catch (e) {
console.log('Error encoding prompt text', e);
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!