@xuda.io/ai_module 1.1.4009 → 1.1.4010
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +2 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5151,8 +5151,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
5151
5151
|
conversation_doc.stat = 3;
|
|
5152
5152
|
conversation_doc.messages.push(obj);
|
|
5153
5153
|
|
|
5154
|
-
let inputTokens = output
|
|
5155
|
-
let outputTokens = output
|
|
5154
|
+
let inputTokens = output?.state?._context.usage?.inputTokens || 0;
|
|
5155
|
+
let outputTokens = output?.state?._context?.usage?.outputTokens || 0;
|
|
5156
5156
|
debugger;
|
|
5157
5157
|
for (const item of output?.stat?._modelResponses || []) {
|
|
5158
5158
|
inputTokens += item.usage.inputTokens;
|