aecae6d0 by Jonille Arreglo

Merge branch '28594_usage_tracking' into 'master'

28594_usage_tracking

See merge request !80
2 parents 216d3b57 6f8d2d2f
Showing 1 changed file with 1 additions and 1 deletions
......@@ -192,7 +192,7 @@ async function runGPTTurbo(req, res) {
let usage = {};
let enc = null;
try {
enc = encoding_for_model(tiktokenModels.includes(currentModel) ? currentModel : 'gpt-3.5-turbo');
enc = encodingForModel(tiktokenModels.includes(currentModel) ? currentModel : 'gpt-3.5-turbo');
usage.prompt_tokens = (enc.encode(query_prompt)).length;
usage.completion_tokens = (enc.encode(input)).length;
usage.total_tokens = usage.prompt_tokens + usage.completion_tokens;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!