@xuda.io/ai_module 1.1.4876 → 1.1.4878

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 +19 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6183,6 +6183,25 @@ export const get_transcript = async function (uid, app_id, conversation_id, acco
6183
6183
  return transcript;
6184
6184
  };
6185
6185
 
6186
+ export const add_conversation_item = async function (reference_conversation_id, filename, transcript) {
6187
+ try {
6188
+ const items = await client.conversations.items.create(reference_conversation_id, {
6189
+ items: [
6190
+ {
6191
+ type: 'message',
6192
+ role: 'system',
6193
+ content: [{ type: 'input_text', text: `the user attached file name: ${filename} with content: ${transcript?.data || transcript || ''}` }],
6194
+ },
6195
+ ],
6196
+ });
6197
+ report_ai_status('conversations');
6198
+ return items;
6199
+ } catch (err) {
6200
+ report_ai_status('conversations', err);
6201
+ throw err;
6202
+ }
6203
+ };
6204
+
6186
6205
  const attachment_handler = async function (uid, app_id, conversation_id, attachments, account_profile_info, date_created_ts) {
6187
6206
  if (!attachments?.length) return;
6188
6207
  let 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.4876",
3
+ "version": "1.1.4878",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",