@xuda.io/ai_module 1.1.3989 → 1.1.3991

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 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4627,6 +4627,12 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4627
4627
  let tools = [];
4628
4628
  let tool_resources = {};
4629
4629
 
4630
+ const register_tool=function(opt){
4631
+ tools.push(
4632
+ tool(opt)
4633
+ }
4634
+
4635
+
4630
4636
  for (const [key, val] of Object.entries(ai_agent_doc?.agentConfig?.agent_tools || [])) {
4631
4637
  const { name, description } = val;
4632
4638
  switch (val.type) {
@@ -4712,6 +4718,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4712
4718
  }
4713
4719
  }
4714
4720
  try {
4721
+ register_tool()
4715
4722
  tools.push(
4716
4723
  tool({
4717
4724
  name: method_name.replace(/_/g, ' ').replace(/\b(\w)/g, (_, char) => char.toUpperCase()),
@@ -4976,9 +4983,9 @@ const ai_chat_conversation = async function (req, job_id, headers) {
4976
4983
  }
4977
4984
  // if (!tools.length) continue;
4978
4985
  // console.log('tool', tools);
4979
-
4986
+ const agent_name = `${ai_agent_doc._id} ##${ai_agent_doc?.properties?.menuName || ''}`;
4980
4987
  const agent = new Agent({
4981
- name: `${ai_agent_doc._id} ##${ai_agent_doc?.properties?.menuName || ''}`,
4988
+ name: agent_name.substring(0, 60),
4982
4989
  instructions: ai_agent_doc.agentConfig.agent_instructions + (reference_type === 'ai_agents' ? get_agent_instructions() : ''),
4983
4990
  model,
4984
4991
  tools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3989",
3
+ "version": "1.1.3991",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",