@xuda.io/ai_module 1.1.4838 → 1.1.4839
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 +13 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5719,13 +5719,20 @@ const create_ai_agent_image = async function (req, job_id, headers) {
|
|
|
5719
5719
|
- Light interaction Use advanced or reflective materials to convey intelligence and sophistication.
|
|
5720
5720
|
The overall composition should symbolize the fusion of human creativity and machine intelligence.
|
|
5721
5721
|
`;
|
|
5722
|
-
const ai_avatar_response = await client.images.edit({
|
|
5723
|
-
model,
|
|
5724
|
-
image: image_blob_ret.image_blob,
|
|
5725
5722
|
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5723
|
+
let ai_avatar_response;
|
|
5724
|
+
try {
|
|
5725
|
+
ai_avatar_response = await client.images.edit({
|
|
5726
|
+
model,
|
|
5727
|
+
image: image_blob_ret.image_blob,
|
|
5728
|
+
|
|
5729
|
+
prompt,
|
|
5730
|
+
background: 'transparent',
|
|
5731
|
+
});
|
|
5732
|
+
} catch (err) {
|
|
5733
|
+
report_ai_status(model, err);
|
|
5734
|
+
throw err;
|
|
5735
|
+
}
|
|
5729
5736
|
imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
5730
5737
|
account_module.record_ai_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'agent avatar', prompt, model, { ai_agent_id }, account_profile_info);
|
|
5731
5738
|
console.log('Normalizing final avatar to 1024 with transparent padding...');
|