@xuda.io/ai_module 1.1.5139 → 1.1.5141
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 +17 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4092,9 +4092,9 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4092
4092
|
});
|
|
4093
4093
|
};
|
|
4094
4094
|
|
|
4095
|
-
const generate_XU_markdown = async function (type, data) {
|
|
4096
|
-
|
|
4097
|
-
};
|
|
4095
|
+
// const generate_XU_markdown = async function (type, data) {
|
|
4096
|
+
// return `XU>${job_id}{type:"${type}",data:${JSON.stringify(data)}}${job_id}<XU`;
|
|
4097
|
+
// };
|
|
4098
4098
|
|
|
4099
4099
|
const contactGuardrail = {
|
|
4100
4100
|
name: 'Contact Guardrail',
|
|
@@ -4638,6 +4638,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4638
4638
|
} catch (err) {}
|
|
4639
4639
|
};
|
|
4640
4640
|
|
|
4641
|
+
const render_suggestions = async function () {
|
|
4642
|
+
for (const suggestion of prompt_suggestions) {
|
|
4643
|
+
emitToDashboard('stream_delta', `${suggestion.short_action}`);
|
|
4644
|
+
}
|
|
4645
|
+
};
|
|
4641
4646
|
// try {
|
|
4642
4647
|
const runner = new Runner();
|
|
4643
4648
|
let _agent = [];
|
|
@@ -4651,6 +4656,14 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4651
4656
|
await attachment_handler(uid, app_id, conversation_id, attachments, account_profile_info);
|
|
4652
4657
|
}
|
|
4653
4658
|
////////////
|
|
4659
|
+
if (!prompt_suggestions.length) {
|
|
4660
|
+
await _utils.delay(2000);
|
|
4661
|
+
}
|
|
4662
|
+
|
|
4663
|
+
if (prompt_suggestions.length) {
|
|
4664
|
+
await render_suggestions();
|
|
4665
|
+
}
|
|
4666
|
+
///////////
|
|
4654
4667
|
|
|
4655
4668
|
if (reference_type === 'ai_agents') {
|
|
4656
4669
|
_agent = agents[0];
|
|
@@ -4662,7 +4675,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4662
4675
|
name: 'Triage Agent',
|
|
4663
4676
|
instructions: get_agent_instructions(),
|
|
4664
4677
|
// inputGuardrails: [contactGuardrail],
|
|
4665
|
-
outputGuardrails: [contactGuardrail],
|
|
4678
|
+
// outputGuardrails: [contactGuardrail],
|
|
4666
4679
|
model,
|
|
4667
4680
|
handoffs: agents, // this lets triageAgent forward to other agents
|
|
4668
4681
|
});
|