@xuda.io/ai_module 1.1.4435 → 1.1.4437
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 +4 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6157,8 +6157,8 @@ const record_chat_usage = async function (uid, input_tokens, output_tokens, sour
|
|
|
6157
6157
|
|
|
6158
6158
|
const t = Date.now();
|
|
6159
6159
|
let usage_doc = {
|
|
6160
|
-
_id: await _common.xuda_get_uuid('
|
|
6161
|
-
docType: '
|
|
6160
|
+
_id: await _common.xuda_get_uuid('ai_usage'),
|
|
6161
|
+
docType: 'ai_usage',
|
|
6162
6162
|
prompt: typeof prompt === 'string' ? prompt.substr(0, 40) : '',
|
|
6163
6163
|
date_created_ts: t,
|
|
6164
6164
|
uid,
|
|
@@ -6170,8 +6170,9 @@ const record_chat_usage = async function (uid, input_tokens, output_tokens, sour
|
|
|
6170
6170
|
model,
|
|
6171
6171
|
cost,
|
|
6172
6172
|
account_profile_info,
|
|
6173
|
+
profile_uid: account_profile_info.uid,
|
|
6173
6174
|
};
|
|
6174
|
-
const save_ret = await db_module.
|
|
6175
|
+
const save_ret = await db_module.save_couch_doc('xuda_usage', usage_doc);
|
|
6175
6176
|
// console.log(save_ret);
|
|
6176
6177
|
} catch (err) {
|
|
6177
6178
|
console.error(err);
|