@xuda.io/ai_module 1.1.4211 → 1.1.4213

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 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1769,6 +1769,10 @@ export const get_ai_chats = async function (req, job_id, headers) {
1769
1769
  skip: skip || 0,
1770
1770
  sort: [{ ts: reference_id ? 'asc' : 'desc' }],
1771
1771
  };
1772
+ debugger;
1773
+ if (!account_profile_info.is_main) {
1774
+ opt.selector = 1;
1775
+ }
1772
1776
 
1773
1777
  switch (filter_type) {
1774
1778
  case 'archived': {
@@ -1822,7 +1826,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
1822
1826
  };
1823
1827
  }
1824
1828
 
1825
- const app_id = await account_module.get_account_default_project_id(uid);
1829
+ // const app_id = await account_module.get_account_default_project_id(uid);
1826
1830
 
1827
1831
  ////// FROM - IN
1828
1832
  let requests_from = { docs: [], total_docs: 0 };
@@ -3131,7 +3135,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
3131
3135
  const { account_project_id: app_id, account_info } = await account_module.get_default_project_account_doc(uid);
3132
3136
 
3133
3137
  const account_profile_info = await account_module.get_active_account_profile_info(uid);
3134
- const { account_profile } = account_profile_info;
3138
+ const { account_profile_obj } = account_profile_info;
3135
3139
  try {
3136
3140
  const param = { uid, properties: { menuName: agentConfig.agent_name, menuTitle: agentConfig.agent_name, menuType: 'ai_agent' }, checkedInUserName: account_info.first_name + ' ' + account_info.last_name, app_id: account_profile_info.app_id, parentId: 'ai_agents' };
3137
3141
  var agent_doc = createDoc(param);
@@ -3143,7 +3147,7 @@ export const create_ai_agent = async function (req, job_id, headers) {
3143
3147
  agent_doc.studio_meta.agent_tags = agentConfig.agent_tags;
3144
3148
  agent_doc.studio_meta.agent_user_guide = agentConfig.agent_user_guide;
3145
3149
  // agent_doc.studio_meta.account_profile_info = account_profile_info;
3146
- agent_doc.studio_meta.account_profiles[account_profile];
3150
+ agent_doc.studio_meta.account_profiles[account_profile_obj];
3147
3151
 
3148
3152
  // const data = await db.insert(agent_doc);
3149
3153
 
@@ -4140,7 +4144,7 @@ export const create_conversation = async function (req, job_id, headers) {
4140
4144
  let { reference_type, reference_id = '', conversation_type } = req;
4141
4145
 
4142
4146
  const account_profile_info = await account_module.get_active_account_profile_info(uid);
4143
- const { account_profile } = account_profile_info;
4147
+ const { account_profile_obj } = account_profile_info;
4144
4148
  try {
4145
4149
  const conversation_obj = await client.conversations.create();
4146
4150
  const t = Date.now();
@@ -4159,7 +4163,7 @@ export const create_conversation = async function (req, job_id, headers) {
4159
4163
  conversation_type,
4160
4164
  initiator_uid: uid,
4161
4165
 
4162
- account_profiles: [account_profile],
4166
+ account_profiles: [account_profile_obj],
4163
4167
  };
4164
4168
  const save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, conversation_doc);
4165
4169
 
@@ -6349,12 +6353,12 @@ export const create_mini_app = async function (req, job_id, headers) {
6349
6353
  try {
6350
6354
  const { account_project_id: app_id, account_info } = await account_module.get_default_project_account_doc(uid);
6351
6355
  const account_profile_info = await account_module.get_active_account_profile_info(uid);
6352
- const { account_profile } = account_profile_info;
6356
+ const { account_profile_obj } = account_profile_info;
6353
6357
 
6354
6358
  const param = { uid, properties: { menuName: prompt, menuTitle: prompt, menuType: 'component' }, checkedInUserName: account_info.first_name + ' ' + account_info.last_name, app_id, parentId: 'programs' };
6355
6359
  let component_doc = createDoc(param);
6356
6360
  component_doc.studio_meta.miniApp = true;
6357
- component_doc.studio_meta.account_profiles[account_profile];
6361
+ component_doc.studio_meta.account_profiles[account_profile_obj];
6358
6362
  const name = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano', metadata: { prog_id: component_doc._id, func: 'create_mini_app' } }, account_profile_info);
6359
6363
  component_doc.properties.menuName = name.data;
6360
6364
  component_doc.properties.menuTitle = name.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4211",
3
+ "version": "1.1.4213",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",