@xuda.io/ai_module 1.1.3589 → 1.1.3591
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 +26 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1914,6 +1914,27 @@ export const archive_ai_chat = async function (req) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
};
|
|
1916
1916
|
|
|
1917
|
+
export const unarchive_ai_chat = async function (req) {
|
|
1918
|
+
let { conversation_id, uid } = req;
|
|
1919
|
+
|
|
1920
|
+
const app_id = await account_module.get_account_default_project_id(uid);
|
|
1921
|
+
try {
|
|
1922
|
+
let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
|
|
1923
|
+
|
|
1924
|
+
if (conversation_doc.stat !== 5) {
|
|
1925
|
+
throw new Error('chat is not archived');
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
conversation_doc.stat = 3;
|
|
1929
|
+
conversation_doc.ts = Date.now();
|
|
1930
|
+
const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
1931
|
+
|
|
1932
|
+
return save_ret;
|
|
1933
|
+
} catch (err) {
|
|
1934
|
+
return { code: -3, data: err.message };
|
|
1935
|
+
}
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1917
1938
|
export const create_studio_app = async function (subject) {
|
|
1918
1939
|
try {
|
|
1919
1940
|
let prompt = `
|
|
@@ -5676,3 +5697,8 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
|
|
|
5676
5697
|
return { code: -111, data: err.message };
|
|
5677
5698
|
}
|
|
5678
5699
|
};
|
|
5700
|
+
|
|
5701
|
+
const delete_depended_chats = async function (reference_id) {
|
|
5702
|
+
const chats_ret = await get_ai_chats({ reference_id }, job_id, headers);
|
|
5703
|
+
console.log(chats_ret);
|
|
5704
|
+
};
|