@xuda.io/ai_module 1.1.5308 → 1.1.5310
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 +5 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4674,6 +4674,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4674
4674
|
val.plugin_id,
|
|
4675
4675
|
val.plugin_method,
|
|
4676
4676
|
{},
|
|
4677
|
+
{ ai_agent_doc },
|
|
4677
4678
|
);
|
|
4678
4679
|
|
|
4679
4680
|
tools.push(tool);
|
|
@@ -5064,7 +5065,7 @@ setTimeout(async () => {
|
|
|
5064
5065
|
|
|
5065
5066
|
///////////////////////
|
|
5066
5067
|
|
|
5067
|
-
const run_plugin = async function (app_id, uid, plugin_name, method, prop_data, dev = true, req = {}, testing = true) {
|
|
5068
|
+
const run_plugin = async function (app_id, uid, plugin_name, method, prop_data, dev = true, req = {}, testing = true, agent_info = {}) {
|
|
5068
5069
|
const db_module = await import(`${module_path}/db_module/index.mjs`);
|
|
5069
5070
|
|
|
5070
5071
|
const get_path = function (resource) {
|
|
@@ -5144,7 +5145,7 @@ const run_plugin = async function (app_id, uid, plugin_name, method, prop_data,
|
|
|
5144
5145
|
|
|
5145
5146
|
const fields = await get_fields_data(methods[method].fields, prop_data);
|
|
5146
5147
|
const params = fields;
|
|
5147
|
-
const env = { couch, app_id, uid, userName };
|
|
5148
|
+
const env = { couch, app_id, uid, userName, agent_info };
|
|
5148
5149
|
const setup_doc = plugin_doc.setup || { OPENAI_API_KEY: _conf.OPENAI_API_KEY };
|
|
5149
5150
|
|
|
5150
5151
|
///////////////////////
|
|
@@ -5196,7 +5197,7 @@ const run_plugin = async function (app_id, uid, plugin_name, method, prop_data,
|
|
|
5196
5197
|
}
|
|
5197
5198
|
};
|
|
5198
5199
|
|
|
5199
|
-
const get_plugin_tool = async function (app_id, uid, plugin_name, method, prop_data, dev = true, req = {}) {
|
|
5200
|
+
const get_plugin_tool = async function (app_id, uid, plugin_name, method, prop_data, dev = true, req = {}, agent_info = {}) {
|
|
5200
5201
|
const db_module = await import(`${module_path}/db_module/index.mjs`);
|
|
5201
5202
|
|
|
5202
5203
|
init(undefined, undefined, _, true, undefined, undefined, undefined, undefined, undefined, true, z);
|
|
@@ -5273,7 +5274,7 @@ const get_plugin_tool = async function (app_id, uid, plugin_name, method, prop_d
|
|
|
5273
5274
|
|
|
5274
5275
|
const fields = await get_fields_data(_method.fields, prop_data);
|
|
5275
5276
|
const params = fields;
|
|
5276
|
-
const env = { couch, app_id, uid, userName };
|
|
5277
|
+
const env = { couch, app_id, uid, userName, agent_info };
|
|
5277
5278
|
const setup_doc = plugin_doc.setup || { OPENAI_API_KEY: _conf.OPENAI_API_KEY };
|
|
5278
5279
|
|
|
5279
5280
|
///////////////////////
|