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) => { ...@@ -129,7 +129,10 @@ app.post('/api', async (req, res) => {
129 usage.total_tokens = usage.prompt_tokens + usage.completion_tokens; 129 usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
130 130
131 // TOKEN USAGE 131 // TOKEN USAGE
132 btutil_setChatUsage('chatbot+', usage.prompt_tokens, usage.total_tokens); 132 axios.post(`${process.env.API_URL}/e/set-chat-usage`,
133 { aiwp_logged_in: req.cookies[user_secret_id], app: 'chatbot', prompt_token: usage.prompt_tokens, total_token: usage.total_tokens },
134 { headers: { 'content-type': 'application/x-www-form-urlencoded' }
135 });
133 } catch (e) { 136 } catch (e) {
134 console.log('Error encoding prompt text', e); 137 console.log('Error encoding prompt text', e);
135 } 138 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!