@xuda.io/ai_module 1.1.4167 → 1.1.4168

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 +22 -21
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3017,7 +3017,7 @@ const upload_agent_files = async function (uid, agent_doc) {
3017
3017
 
3018
3018
  case 'document':
3019
3019
  case 'text': {
3020
- file = await get_drive_file_stream('user', app_id, uid, tool.file.name);
3020
+ file = await get_drive_file_stream('user', agent_doc.account_profile_info.app_id, uid, tool.file.name);
3021
3021
  // tool.file.file_id = await upload_file_to_openai_storage(tool.file.name);
3022
3022
  break;
3023
3023
  }
@@ -3082,34 +3082,35 @@ const upload_agent_files = async function (uid, agent_doc) {
3082
3082
  }
3083
3083
  };
3084
3084
 
3085
- const validate_ai_agent = async function (req) {
3086
- // "tool_type": {
3087
- // "name": "Tool Type",
3088
- // "description": "",
3089
- // "type": "array",
3090
- // "enum": [
3091
- // "web_search",
3092
- // "file_search",
3093
- // "program",
3094
- // "mcp",
3095
- // "plugin",
3096
- // "ai_agent",
3097
- // "table",
3098
- // "image_generate"
3099
- // ],
3100
- // "mandatory": true
3101
- // }
3102
- };
3085
+ // const validate_ai_agent = async function (req) {
3086
+ // // "tool_type": {
3087
+ // // "name": "Tool Type",
3088
+ // // "description": "",
3089
+ // // "type": "array",
3090
+ // // "enum": [
3091
+ // // "web_search",
3092
+ // // "file_search",
3093
+ // // "program",
3094
+ // // "mcp",
3095
+ // // "plugin",
3096
+ // // "ai_agent",
3097
+ // // "table",
3098
+ // // "image_generate"
3099
+ // // ],
3100
+ // // "mandatory": true
3101
+ // // }
3102
+ // };
3103
3103
 
3104
3104
  const save_agent_status = async function (uid, agent_id, stat, agentConfig) {
3105
3105
  const project_db = await get_account_project_db(uid);
3106
+ const account_profile_info = await account_module.get_active_account_profile_info(uid);
3106
3107
 
3107
3108
  try {
3108
- let agent_doc = await project_db.get(agent_id);
3109
+ let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
3109
3110
  agent_doc.ts = Date.now();
3110
3111
  agent_doc.stat = stat;
3111
3112
  agent_doc.agentConfig = agentConfig;
3112
- const data = await project_db.insert(agent_doc);
3113
+ const data = await db_module.save_app_couch_doc_native(account_profile_info.app_id, agent_doc);
3113
3114
 
3114
3115
  return { code: 12, data };
3115
3116
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4167",
3
+ "version": "1.1.4168",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",