@xuda.io/ai_module 1.1.5291 → 1.1.5293
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 +4 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4059,6 +4059,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4059
4059
|
const account_profile_info = await get_active_account_profile_info(uid, profile_id);
|
|
4060
4060
|
let { prompt, conversation_doc, attachments = [], ai_agents, output_format = 'md', stream = true, with_context = true, ai_model = _conf.default_ai_model } = req;
|
|
4061
4061
|
|
|
4062
|
+
let local_ai_agents = _.cloneDeep(ai_agents);
|
|
4063
|
+
|
|
4062
4064
|
const reference_type = conversation_doc.reference_type;
|
|
4063
4065
|
const reference_id = conversation_doc.reference_id;
|
|
4064
4066
|
|
|
@@ -4313,7 +4315,6 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4313
4315
|
return is_agent ? identity : triage_assistant + identity;
|
|
4314
4316
|
};
|
|
4315
4317
|
const get_agents = async function () {
|
|
4316
|
-
debugger;
|
|
4317
4318
|
if (typeof ai_agents === 'undefined') {
|
|
4318
4319
|
// no agents
|
|
4319
4320
|
ai_agents = [];
|
|
@@ -4732,7 +4733,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4732
4733
|
counter++;
|
|
4733
4734
|
const job_info = await jobs_ms.get_job_info({ job_id });
|
|
4734
4735
|
|
|
4735
|
-
if (counter >
|
|
4736
|
+
if (counter > 50) {
|
|
4736
4737
|
resolve(null);
|
|
4737
4738
|
} else {
|
|
4738
4739
|
if (job_info.code < 0 || job_info.data.stat === 4) {
|
|
@@ -4923,7 +4924,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4923
4924
|
let string_debug = '';
|
|
4924
4925
|
let chunks = 0;
|
|
4925
4926
|
for await (const chunk of output_stream) {
|
|
4926
|
-
console.log(chunks);
|
|
4927
|
+
// console.log(chunks);
|
|
4927
4928
|
if (chunks % 10 === 0) {
|
|
4928
4929
|
const job_info = await jobs_ms.get_job_info({ job_id });
|
|
4929
4930
|
if (job_info.code < 0 || job_info.data.stat === 4) {
|