@xuda.io/ai_module 1.1.5135 → 1.1.5137
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
|
@@ -4055,7 +4055,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4055
4055
|
throw new Error('model not supported');
|
|
4056
4056
|
}
|
|
4057
4057
|
|
|
4058
|
-
await _utils.delay(1000);
|
|
4058
|
+
// await _utils.delay(1000);
|
|
4059
4059
|
const conversation_id = conversation_doc._id;
|
|
4060
4060
|
|
|
4061
4061
|
const prev_conversation_items = await client.conversations.items.list(conversation_doc.reference_conversation_id, { order: 'desc' });
|
|
@@ -4076,7 +4076,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4076
4076
|
direction: 'out',
|
|
4077
4077
|
role: 'user',
|
|
4078
4078
|
};
|
|
4079
|
-
await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj);
|
|
4079
|
+
const out_conversation_item_save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, out_conversation_item_obj);
|
|
4080
4080
|
|
|
4081
4081
|
// const { account_profile_info } = conversation_doc;
|
|
4082
4082
|
const emitToDashboard = (type, content) => {
|
|
@@ -4113,6 +4113,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4113
4113
|
};
|
|
4114
4114
|
|
|
4115
4115
|
try {
|
|
4116
|
+
if (out_conversation_item_save_ret.code < 0) throw new Error(out_conversation_item_save_ret.data);
|
|
4116
4117
|
if (conversation_item_id) {
|
|
4117
4118
|
const conversation_item_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_item_id);
|
|
4118
4119
|
prompt = conversation_item_doc.text || conversation_item_doc.prompt;
|
|
@@ -4156,7 +4157,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4156
4157
|
// await _utils.delay(500);
|
|
4157
4158
|
|
|
4158
4159
|
// prompt_suggestions
|
|
4159
|
-
const { data: prompt_suggestions } = await get_chat_suggestions();
|
|
4160
|
+
const { data: prompt_suggestions } = await get_chat_suggestions(uid, ai_agents, out_conversation_item_save_ret.data.id);
|
|
4160
4161
|
|
|
4161
4162
|
await update_job('initiating conversation');
|
|
4162
4163
|
|