@xuda.io/ai_module 1.1.3848 → 1.1.3850
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 +3 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5071,7 +5071,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
5071
5071
|
conversation_doc.stat = 3;
|
|
5072
5072
|
conversation_doc.messages.push(obj);
|
|
5073
5073
|
await db_module.save_app_couch_doc_native(app_id, conversation_doc);
|
|
5074
|
-
record_chat_usage(uid, output.state._context.usage.inputTokens, output.state._context.usage.outputTokens, 'conversation chat', prompt, model);
|
|
5074
|
+
record_chat_usage(uid, output.state._context.usage.inputTokens, output.state._context.usage.outputTokens, 'conversation chat', prompt, model, { conversation_id });
|
|
5075
5075
|
// if (!conversation_doc.chat_image && (!conversation_doc.thumbnail_request_ts || Date.now() - conversation_doc.thumbnail_request_ts > 120000)) {
|
|
5076
5076
|
// update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
|
|
5077
5077
|
// }
|
|
@@ -5782,7 +5782,7 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
|
|
|
5782
5782
|
const prompt = `analyze the the person info : ${JSON.stringify({ first_name, last_name, bio, country, mainCategory, subCategory })}
|
|
5783
5783
|
and create realistic fictional profile picture transparent background ,person in the center of the picture return only a centered head-and-shoulders portrait facing the camera. include no labels or text add top margin the person should cover the whole picture`;
|
|
5784
5784
|
|
|
5785
|
-
imageBase64 = await create_image(uid, prompt, undefined, undefined, 1);
|
|
5785
|
+
imageBase64 = await create_image(uid, prompt, undefined, undefined, 1, undefined, undefined, { url });
|
|
5786
5786
|
avatar_source = 'fictional';
|
|
5787
5787
|
};
|
|
5788
5788
|
// personal account
|
|
@@ -6251,7 +6251,7 @@ const create_ai_agent_image = async function (req, job_id, headers) {
|
|
|
6251
6251
|
}
|
|
6252
6252
|
};
|
|
6253
6253
|
|
|
6254
|
-
const record_chat_usage = async function (uid, input_tokens, output_tokens, source, prompt, metadata) {
|
|
6254
|
+
const record_chat_usage = async function (uid, input_tokens, output_tokens, source, prompt, metadata = {}) {
|
|
6255
6255
|
try {
|
|
6256
6256
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
6257
6257
|
|