3fc61a14 by Jonille Arreglo

update

1 parent 71af6bfe
Showing 1 changed file with 4 additions and 1 deletions
......@@ -129,7 +129,10 @@ app.post('/api', async (req, res) => {
usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
// TOKEN USAGE
btutil_setChatUsage('chatbot+', usage.prompt_tokens, usage.total_tokens);
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' }
});
} 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!