@xuda.io/ai_module 1.1.5449 → 1.1.5451

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 +6 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3514,7 +3514,7 @@ export const create_conversation = async function (req, job_id, headers) {
3514
3514
  title: conversation_type !== 'email' ? getFirstNWords(prompt, 10) : prompt,
3515
3515
  date_created_ts: date_created ? new Date(date_created).getTime() : d,
3516
3516
  ts: d,
3517
- stat: !conversation_type || conversation_type === 'ai' ? 1 : 3,
3517
+ stat: !conversation_type || conversation_type === 'ai_chat' ? 1 : 3,
3518
3518
  uid,
3519
3519
  messages: [],
3520
3520
  reference_type,
@@ -3628,7 +3628,7 @@ const process_conversation = async function (uid, conversation_id, account_profi
3628
3628
  let category_info = {};
3629
3629
  if (prompt?.length > 1) {
3630
3630
  switch (conversation_type) {
3631
- case 'ai': {
3631
+ case 'ai_chat': {
3632
3632
  category_info = await categorize_ai_prompt(uid, prompt, account_profile_info);
3633
3633
  break;
3634
3634
  }
@@ -3724,7 +3724,7 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
3724
3724
  ret = await chat_note(req, job_id, headers);
3725
3725
  break;
3726
3726
  }
3727
- case 'ai': {
3727
+ case 'ai_chat': {
3728
3728
  ret = await ai_chat_conversation(req, job_id, headers);
3729
3729
  break;
3730
3730
  }
@@ -4390,14 +4390,14 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4390
4390
  } catch (err) {
4391
4391
  throw new Error(err.message);
4392
4392
  }
4393
- debugger;
4393
+
4394
4394
  if (prompt_suggestion_activated || chat_suggestion_activated || reference_type === 'ai_agents') {
4395
4395
  if (ai_agent_doc?.agentConfig?.agent_ai_model) {
4396
4396
  model = ai_agent_doc.agentConfig.agent_ai_model;
4397
4397
  }
4398
4398
  }
4399
4399
 
4400
- if (ai_agent_doc.use_tools_only) {
4400
+ if (ai_agent_doc.use_tools_only || chat_suggestion_activated) {
4401
4401
  modelSettings.toolChoice = 'required';
4402
4402
  }
4403
4403
 
@@ -4902,6 +4902,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4902
4902
  emitToDashboard('stream_phase', 'Submitting chat', { update: true });
4903
4903
  init_agent_hooks(_agent);
4904
4904
  // const output = await runner.run(_agent, prompt, opt);
4905
+ debugger;
4905
4906
  const output = await run_agent(_agent, prompt, opt);
4906
4907
  const done = async function (output) {
4907
4908
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5449",
3
+ "version": "1.1.5451",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",