@xuda.io/ai_module 1.1.5193 → 1.1.5195
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 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4072,11 +4072,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4072
4072
|
const prev_conversation_items = await client.conversations.items.list(conversation_doc.reference_conversation_id, { order: 'desc' });
|
|
4073
4073
|
const last_conversation_item = prev_conversation_items?.data?.[0]?.id;
|
|
4074
4074
|
|
|
4075
|
-
const
|
|
4076
|
-
const
|
|
4075
|
+
const prompt_conversation_item_id = await _common.xuda_get_uuid('chat_conversation_item');
|
|
4076
|
+
const response_conversation_item_id = await _common.xuda_get_uuid('chat_conversation_item');
|
|
4077
4077
|
|
|
4078
4078
|
let out_conversation_item_obj = {
|
|
4079
|
-
_id:
|
|
4079
|
+
_id: prompt_conversation_item_id,
|
|
4080
4080
|
stat: 3, //1,
|
|
4081
4081
|
docType: 'chat_conversation_item',
|
|
4082
4082
|
uid,
|
|
@@ -4106,8 +4106,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4106
4106
|
conversation_id,
|
|
4107
4107
|
job_id,
|
|
4108
4108
|
delta: content,
|
|
4109
|
-
|
|
4110
|
-
|
|
4109
|
+
prompt_conversation_item_id,
|
|
4110
|
+
response_conversation_item_id,
|
|
4111
4111
|
},
|
|
4112
4112
|
});
|
|
4113
4113
|
};
|
|
@@ -4778,7 +4778,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4778
4778
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
|
|
4779
4779
|
|
|
4780
4780
|
let in_conversation_item_obj = {
|
|
4781
|
-
_id:
|
|
4781
|
+
_id: response_conversation_item_id,
|
|
4782
4782
|
stat: 3,
|
|
4783
4783
|
docType: 'chat_conversation_item',
|
|
4784
4784
|
uid,
|
|
@@ -4794,6 +4794,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4794
4794
|
role: 'assistant',
|
|
4795
4795
|
ai_agent_id: output.state._currentAgent.name,
|
|
4796
4796
|
job_id,
|
|
4797
|
+
rprompt_conversation_item_id,
|
|
4797
4798
|
};
|
|
4798
4799
|
const save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, in_conversation_item_obj);
|
|
4799
4800
|
|