@xuda.io/ai_module 1.1.4008 → 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.
Files changed (2) hide show
  1. package/index.mjs +3 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5151,10 +5151,10 @@ 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.state?._context.usage?.inputTokens || 0;
5155
- let outputTokens = output.state?._context?.usage?.outputTokens || 0;
5154
+ let inputTokens = output?.state?._context.usage?.inputTokens || 0;
5155
+ let outputTokens = output?.state?._context?.usage?.outputTokens || 0;
5156
5156
  debugger;
5157
- for (const item of output?stat?._modelResponses || []) {
5157
+ for (const item of output?.stat?._modelResponses || []) {
5158
5158
  inputTokens += item.usage.inputTokens;
5159
5159
  outputTokens += item.usage.outputTokens;
5160
5160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4008",
3
+ "version": "1.1.4010",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",