@xuda.io/ai_module 1.1.3803 → 1.1.3805

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 +10 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4982,13 +4982,22 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4982
4982
  content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript.data || transcript}` }],
4983
4983
  });
4984
4984
 
4985
- prompt += generate_XU_markdown('attachment', file); //`[![Alt Text](${file.file_url})]`;
4985
+ // prompt += await generate_XU_markdown('attachment', file); //`[![Alt Text](${file.file_url})]`;
4986
4986
  }
4987
4987
 
4988
4988
  const items = await client.conversations.items.create(conversation_id, {
4989
4989
  items: system_message_items,
4990
4990
  });
4991
+
4991
4992
  console.log(items.data);
4993
+
4994
+ const obj = { id: output?.output?.[0]?.id, ts: Date.now(), usage: { inputTokens: output.state._context.usage.inputTokens, outputTokens: output.state._context.usage.outputTokens }, ai_agent_id: output.state._currentAgent.name, attachments };
4995
+ conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
4996
+
4997
+ conversation_doc.ts = Date.now();
4998
+ conversation_doc.stat = 3;
4999
+ conversation_doc.messages.push(obj);
5000
+ await db_module.save_app_couch_doc_native(app_id, conversation_doc);
4992
5001
  };
4993
5002
 
4994
5003
  const set_ts_to_agent = async function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3803",
3
+ "version": "1.1.3805",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",