@xuda.io/ai_module 1.1.3990 → 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.
- package/index.mjs +7 -0
- 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()),
|