@xuda.io/ai_module 1.1.4145 → 1.1.4147
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 -50
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3316,53 +3316,6 @@ export const update_thumbnail = async function (type, doc, app_id, uid, job_id,
|
|
|
3316
3316
|
let db_doc;
|
|
3317
3317
|
|
|
3318
3318
|
switch (type) {
|
|
3319
|
-
// case 'ai_agent': {
|
|
3320
|
-
// db_doc = await get_db_doc();
|
|
3321
|
-
|
|
3322
|
-
// prompt = `
|
|
3323
|
-
// Create a futuristic, faceless humanoid profile portrait with a transparent background.
|
|
3324
|
-
|
|
3325
|
-
// Center the character facing forward, with subtle top spacing, showing only the head and shoulders.
|
|
3326
|
-
// The humanoid must remain completely faceless.
|
|
3327
|
-
|
|
3328
|
-
// Style the humanoid with functional, minimal attire integrated into its form
|
|
3329
|
-
// (such as collars, layered panels, shoulder structures, or fabric-like surfaces),
|
|
3330
|
-
// avoiding human fashion tropes.
|
|
3331
|
-
|
|
3332
|
-
// Select exactly ONE accessory category per generation (do not combine):
|
|
3333
|
-
// - Head-mounted element (visor, band, halo ring)
|
|
3334
|
-
// - Chest or collar element (badge, glyph, embedded tag)
|
|
3335
|
-
// - Floating or projected element (holographic symbol, light node)
|
|
3336
|
-
// - Structural or partially visible object that reinforces the role
|
|
3337
|
-
|
|
3338
|
-
// Accessories must directly reinforce the identity of
|
|
3339
|
-
// "${db_doc.properties.menuName} - ${db_doc.studio_meta.agent_assistant_name}".
|
|
3340
|
-
|
|
3341
|
-
// Use a consistent, fixed color palette across all generations.
|
|
3342
|
-
// Do not introduce new colors.
|
|
3343
|
-
// All variation must come from geometry, materials, texture, and lighting.
|
|
3344
|
-
|
|
3345
|
-
// Vary at least two of the following:
|
|
3346
|
-
// - Head geometry
|
|
3347
|
-
// - Surface structure
|
|
3348
|
-
// - Material finish
|
|
3349
|
-
// - Light interaction
|
|
3350
|
-
|
|
3351
|
-
// Use advanced or reflective materials to convey intelligence and sophistication.
|
|
3352
|
-
// The overall composition should symbolize the fusion of human creativity and machine intelligence.
|
|
3353
|
-
|
|
3354
|
-
// `;
|
|
3355
|
-
// //and a hat
|
|
3356
|
-
// const images_arr = await create_and_upload_image_to_drive('studio', 'Progs Thumbnails', doc._id, prompt, 1, uid, app_id, job_id, headers, false, tags);
|
|
3357
|
-
|
|
3358
|
-
// db_doc = await get_db_doc();
|
|
3359
|
-
// db_doc.studio_meta.thumbnail_request_ts = Date.now();
|
|
3360
|
-
// db_doc.studio_meta.agent_image = images_arr;
|
|
3361
|
-
// // db_doc.studio_meta.agent_assistant_name = agent_assistant_name.data;
|
|
3362
|
-
|
|
3363
|
-
// break;
|
|
3364
|
-
// }
|
|
3365
|
-
|
|
3366
3319
|
case 'ai_agent': {
|
|
3367
3320
|
const images_arr = await create_ai_agent_image({ app_id, uid, ai_agent_id: doc._id, tags }, job_id, headers);
|
|
3368
3321
|
db_doc = await get_db_doc();
|
|
@@ -4303,9 +4256,9 @@ export const submit_chat_conversation = async function (req, job_id, headers) {
|
|
|
4303
4256
|
let { conversation_id } = req;
|
|
4304
4257
|
try {
|
|
4305
4258
|
if (!conversation_id) throw new Error('missing conversation_id');
|
|
4306
|
-
|
|
4259
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4307
4260
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
4308
|
-
let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
|
|
4261
|
+
let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
4309
4262
|
req.conversation_doc = conversation_doc;
|
|
4310
4263
|
let ret;
|
|
4311
4264
|
if (conversation_doc.reference_type === 'contacts') {
|
|
@@ -4850,7 +4803,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4850
4803
|
const { prompt, numGenerations } = e;
|
|
4851
4804
|
try {
|
|
4852
4805
|
let imgTags = '';
|
|
4853
|
-
const images_arr = await create_and_upload_image_to_drive('workspace', 'Chat Images', agent_id, prompt, numGenerations, uid, app_id, job_id, headers);
|
|
4806
|
+
const images_arr = await create_and_upload_image_to_drive('workspace', 'Chat Images', agent_id, prompt, numGenerations, uid, app_id, job_id, headers, null, null, account_profile_info);
|
|
4854
4807
|
for (const img_obj of images_arr) {
|
|
4855
4808
|
imgTags += `<img src="${img_obj.file_url}" alt="${prompt}" style="max-width: 100%; border-radius: 8px;" />`;
|
|
4856
4809
|
}
|