@xuda.io/ai_module 1.1.3806 → 1.1.3808

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 -9
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4976,11 +4976,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4976
4976
  file_names.push(file.filename);
4977
4977
  const transcript = await get_transcript(file.filename);
4978
4978
 
4979
- system_message_items.push({
4980
- type: 'message',
4981
- role: 'system',
4982
- content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript.data || transcript}` }],
4983
- });
4979
+ // system_message_items.push({
4980
+ // type: 'message',
4981
+ // role: 'system',
4982
+ // content: [{ type: 'input_text', text: `the user attached file name: ${file.filename} with content: ${transcript.data || transcript}` }],
4983
+ // });
4984
4984
 
4985
4985
  // prompt += await generate_XU_markdown('attachment', file); //`[![Alt Text](${file.file_url})]`;
4986
4986
 
@@ -4993,13 +4993,14 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4993
4993
  },
4994
4994
  ],
4995
4995
  });
4996
+ system_message_items.push({ id: items.last_id, ts: Date.now(), usage: { inputTokens: output.state._context.usage.inputTokens, outputTokens: output.state._context.usage.outputTokens }, attachment: file });
4996
4997
  }
4997
4998
 
4998
- const items = await client.conversations.items.create(conversation_id, {
4999
- items: system_message_items,
5000
- });
4999
+ // const items = await client.conversations.items.create(conversation_id, {
5000
+ // items: system_message_items,
5001
+ // });
5001
5002
 
5002
- console.log(items.data);
5003
+ // console.log(items.data);
5003
5004
 
5004
5005
  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 };
5005
5006
  conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3806",
3
+ "version": "1.1.3808",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",