@xuda.io/ai_module 1.1.4969 → 1.1.4971

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 +9 -9
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -85,7 +85,7 @@ try {
85
85
  } catch (err) {
86
86
  report_ai_status('init', err);
87
87
  }
88
- const model = 'gpt-5-nano';
88
+ const model = _conf.default_ai_model;
89
89
 
90
90
  // var studio_units = {};
91
91
  var visitors = {};
@@ -2633,7 +2633,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid, fiel
2633
2633
  prompt: `Generate a professional assistant name (e.g., “Data Analyst Assistant”) for the AI agent titled:
2634
2634
  “${doc.properties.menuName}” and also base on the instructions : "${doc.agentConfig.agent_instructions}"
2635
2635
  Output one option 3 words max.`,
2636
- model: 'gpt-5-nano',
2636
+ model,
2637
2637
  metadata: { agent_id: db_doc._id, func: 'get_agent_assistant_name' },
2638
2638
  account_profile_info,
2639
2639
  });
@@ -2658,7 +2658,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid, fiel
2658
2658
  Automation & Integration
2659
2659
  Security & Risk
2660
2660
  Infrastructure & Cloud`,
2661
- model: 'gpt-5-nano',
2661
+ model,
2662
2662
  metadata: { agent_id: db_doc._id, func: 'get_agent_category' },
2663
2663
  account_profile_info,
2664
2664
  });
@@ -2672,7 +2672,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid, fiel
2672
2672
  prompt: `Generate agent industry for the AI agent titled:
2673
2673
  “${doc.properties.menuName}” choose only one from the list:
2674
2674
  Artificial Intelligence,SaaS,Fintech,Healthtech,Edtech,Blockchain/Crypto,Cybersecurity,Gaming,Consulting,Marketing & Advertising,Human Resources,Legal Services,Real Estate,E-commerce,Retail,Fashion & Apparel,Consumer Goods,Healthcare,Medical,Pharmaceutical,Banking,Insurance,Investment,Manufacturing,Logistics & Supply Chain,Construction,Energy,Media,Entertainment,Sports,Education,Travel & Hospitality,Food & Beverage,Non-Profit,Government,Agriculture,Automotive,Telecommunications`,
2675
- model: 'gpt-5-nano',
2675
+ model,
2676
2676
  metadata: { agent_id: db_doc._id, func: 'get_agent_industry' },
2677
2677
  account_profile_info,
2678
2678
  });
@@ -2752,7 +2752,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid, fiel
2752
2752
  }
2753
2753
 
2754
2754
  `,
2755
- model: 'gpt-5-nano',
2755
+ model,
2756
2756
  metadata: { agent_id: db_doc._id, func: 'get_agent_user_guide_fields' },
2757
2757
  account_profile_info,
2758
2758
  });
@@ -2808,7 +2808,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid, fiel
2808
2808
  ]
2809
2809
 
2810
2810
  `,
2811
- model: 'gpt-5-nano',
2811
+ model,
2812
2812
  metadata: { agent_id: db_doc._id, func: 'get_agent_user_guide_steps' },
2813
2813
  account_profile_info,
2814
2814
  });
@@ -3325,7 +3325,7 @@ export const delete_prompt_attachment = async function (req, job_id, headers, fi
3325
3325
  };
3326
3326
 
3327
3327
  export const submit_chat_gpt_prompt = async function (req) {
3328
- const { model = 'gpt-5-nano', prompt, response_format, uid, metadata = {}, account_profile_info, tools = [] } = req; //'gpt-5-mini
3328
+ const { model = _conf.default_ai_model, prompt, response_format, uid, metadata = {}, account_profile_info, tools = [] } = req; //'gpt-5-mini
3329
3329
 
3330
3330
  let formattedParams;
3331
3331
  if (response_format) {
@@ -3498,7 +3498,7 @@ const process_conversation = async function (uid, conversation_id, account_profi
3498
3498
  // Ask GPT for title
3499
3499
  if (conversation_type !== 'email') {
3500
3500
  if (prompt.split(' ').length > 10) {
3501
- const title = 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: { conversation_id: conversation_doc._id, func: 'create_conversation' }, account_profile_info });
3501
+ const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: _conf.default_ai_model, metadata: { conversation_id: conversation_doc._id, func: 'create_conversation' }, account_profile_info });
3502
3502
 
3503
3503
  conversation_doc = await db_ms.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
3504
3504
  conversation_doc.title = title.data;
@@ -3633,7 +3633,7 @@ const update_conversation_mood_level = async function (uid, target_contacts = []
3633
3633
  const mood_level = await submit_chat_gpt_prompt({
3634
3634
  uid,
3635
3635
  prompt: `analyze the mood of the following prompt: ${prompt}. return -2: very negative,-1: negative 0:natural 1:positive 2: very positive.`,
3636
- model: 'gpt-5-nano',
3636
+ model,
3637
3637
  response_format: z.object({
3638
3638
  mood_level: z.number().describe('mood level of interaction: -2: very negative,-1: negative 0:natural 1:positive 2: very positive'),
3639
3639
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4969",
3
+ "version": "1.1.4971",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",