@xuda.io/ai_module 1.1.5401 → 1.1.5403

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 +12 -10
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4247,12 +4247,13 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4247
4247
 
4248
4248
  agent.on('agent_tool_start', (context, tool, details) => {
4249
4249
  debugger;
4250
- emitToDashboard('agent_tool_start', tool.name);
4250
+ // emitToDashboard('agent_tool_start', tool.name);
4251
+ emitToDashboard('stream_phase', `Starting ${tool.name} tool`);
4251
4252
  });
4252
4253
 
4253
4254
  agent.on('agent_tool_end', (context, tool, result, details) => {
4254
- debugger;
4255
- emitToDashboard('agent_tool_end', tool.name);
4255
+ // debugger;
4256
+ // emitToDashboard('agent_tool_end', tool.name);
4256
4257
  });
4257
4258
  };
4258
4259
  const get_agent_instructions = function (is_agent) {
@@ -4522,16 +4523,12 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4522
4523
  async execute(e, RunContext) {
4523
4524
  debugger;
4524
4525
  const { prompt, numGenerations } = e;
4525
- emitToDashboard('stream_phase', 'Starting image tool');
4526
+
4526
4527
  try {
4527
4528
  let imgTags = '';
4528
4529
  const images_arr = await create_and_upload_image_to_drive('workspace', 'Chat Images', agent_id, prompt, numGenerations, uid, account_profile_info.app_id, job_id, headers, null, null, account_profile_info);
4529
- // for (const img_obj of images_arr) {
4530
- // imgTags += `<img src="${img_obj.file_url}" alt="${prompt}" style="max-width: 100%; border-radius: 8px;" />`;
4531
- // }
4532
-
4533
4530
  for (const img_obj of images_arr) {
4534
- imgTags += `![${prompt}](${img_obj.file_url})\n\n`;
4531
+ imgTags += `<img src="${img_obj.file_url}" alt="${prompt}" style="max-width: 100%; border-radius: 8px;" />`;
4535
4532
  }
4536
4533
 
4537
4534
  return imgTags;
@@ -4727,7 +4724,12 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4727
4724
  if (eligible_agent) {
4728
4725
  // allow read only agents if not ai_agent scope
4729
4726
  if (!prompt_suggestion_activated) {
4730
- init_agent_hooks(agent);
4727
+ // init_agent_hooks(agent);
4728
+ agent.on('agent_tool_start', (context, tool, details) => {
4729
+ debugger;
4730
+ // emitToDashboard('agent_tool_start', tool.name);
4731
+ emitToDashboard('stream_phase', `Starting ${tool.name} tool`);
4732
+ });
4731
4733
  }
4732
4734
  list.push(agent);
4733
4735
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5401",
3
+ "version": "1.1.5403",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",