fix: Resolve Token Credit Balance Issues for Instruct Models 🛠️ (#1232)

* Fix: balance update error and add environment variable check

* fix(ChatGPTClient): return promptTokens for instruct/davinci models

* chore: remove unnecessary comments
This commit is contained in:
Danny Avila 2023-11-26 18:12:27 -05:00 committed by GitHub
parent d7ef4590ea
commit f5f5b2bbdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -548,7 +548,7 @@ ${botMessage.message}
if (isChatGptModel) {
return { prompt: [instructionsPayload, messagePayload], context };
}
return { prompt, context };
return { prompt, context, promptTokens: currentTokenCount };
}
getTokenCount(text) {