@xuda.io/ai_module 1.1.3853 → 1.1.3855

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 +2 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4056,7 +4056,7 @@ export const create_conversation = async function (req, job_id, headers) {
4056
4056
 
4057
4057
  setTimeout(async () => {
4058
4058
  // Ask GPT for title
4059
- const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano' });
4059
+ const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano', metadata: { conversation_id: conversation_doc._id } });
4060
4060
 
4061
4061
  conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_obj.id);
4062
4062
  conversation_doc.title = title.data;
@@ -5071,7 +5071,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
5071
5071
  conversation_doc.stat = 3;
5072
5072
  conversation_doc.messages.push(obj);
5073
5073
  await db_module.save_app_couch_doc_native(app_id, conversation_doc);
5074
- record_chat_usage(uid, output.state._context.usage.inputTokens, output.state._context.usage.outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: obj.ai_agent_id });
5074
+ record_chat_usage(uid, output.state._context.usage.inputTokens, output.state._context.usage.outputTokens, 'conversation chat', prompt, model, { conversation_id, ai_agent_id: obj.ai_agent_id, item_id: obj.id });
5075
5075
  // if (!conversation_doc.chat_image && (!conversation_doc.thumbnail_request_ts || Date.now() - conversation_doc.thumbnail_request_ts > 120000)) {
5076
5076
  // update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
5077
5077
  // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3853",
3
+ "version": "1.1.3855",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",