@xuda.io/ai_module 1.1.4822 → 1.1.4823

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.
Files changed (2) hide show
  1. package/index.mjs +13 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1461,13 +1461,19 @@ export const unarchive_ai_chat = async function (req) {
1461
1461
 
1462
1462
  const create_image = async function (uid, prompt, model = 'gpt-image-1-mini', size = '1024x1024', n = 1, width = 256, height = 256, metadata = {}, account_profile_info) {
1463
1463
  try {
1464
- const response = await client.images.generate({
1465
- model,
1466
- prompt,
1467
- size,
1468
- n,
1469
- });
1470
-
1464
+ let response;
1465
+ try {
1466
+ response = await client.images.generate({
1467
+ model,
1468
+ prompt,
1469
+ size,
1470
+ n,
1471
+ });
1472
+ report_ai_status('files');
1473
+ } catch (error) {
1474
+ report_ai_status('files', error);
1475
+ throw error;
1476
+ }
1471
1477
  // Try to extract base64 directly
1472
1478
  const imgObj = response.data?.[0];
1473
1479
  if (!imgObj) throw new Error('No image returned from OpenAI');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4822",
3
+ "version": "1.1.4823",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",