28594_usage_tracking
Showing
1 changed file
with
1 additions
and
4 deletions
| ... | @@ -129,10 +129,7 @@ app.post('/api', async (req, res) => { | ... | @@ -129,10 +129,7 @@ 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 | axios.post(`${process.env.API_URL}e/set-chat-usage`, | 132 | btutil_setChatUsage('chatgpt', usage.prompt_tokens, usage.total_tokens); |
| 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 | }); | ||
| 136 | } catch (e) { | 133 | } catch (e) { |
| 137 | console.log('Error encoding prompt text', e); | 134 | console.log('Error encoding prompt text', e); |
| 138 | } | 135 | } | ... | ... |
-
Please register or sign in to post a comment