@xuda.io/ai_module 1.1.4818 → 1.1.4820

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 +11 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2493,10 +2493,15 @@ const upload_agent_files = async function (uid, agent_doc) {
2493
2493
  tool.file.file_id = uploadedFile.id;
2494
2494
 
2495
2495
  if (!tool.file.vector_file_id) {
2496
- const ret = await client.vectorStores.files.create(_conf.OPENAI_VECTOR_STORE_ID, {
2497
- file_id: tool.file.file_id,
2498
- });
2499
- tool.file.vector_store_id = ret.vector_store_id;
2496
+ try {
2497
+ const ret = await client.vectorStores.files.create(_conf.OPENAI_VECTOR_STORE_ID, {
2498
+ file_id: tool.file.file_id,
2499
+ });
2500
+ tool.file.vector_store_id = ret.vector_store_id;
2501
+ } catch (error) {
2502
+ report_ai_status('vectorStores', error);
2503
+ throw error;
2504
+ }
2500
2505
  }
2501
2506
  }
2502
2507
  await save_agent_status(uid, agent_doc._id, 3, agentConfig);
@@ -2523,8 +2528,9 @@ const upload_agent_files = async function (uid, agent_doc) {
2523
2528
  });
2524
2529
 
2525
2530
  tool.youtube.file_id = uploadedFile.id;
2531
+ report_ai_status('files');
2526
2532
  } catch (error) {
2527
- report_ai_status('vectorStores', error);
2533
+ report_ai_status('files', error);
2528
2534
  throw error;
2529
2535
  }
2530
2536
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4818",
3
+ "version": "1.1.4820",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",