@aigne/ideogram 0.4.5-beta → 0.4.5-beta.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.5-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.4.5-beta...ideogram-v0.4.5-beta.1) (2025-11-04)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add fetch utility with timeout and enhanced error handling ([#694](https://github.com/AIGNE-io/aigne-framework/issues/694)) ([c2d4076](https://github.com/AIGNE-io/aigne-framework/commit/c2d4076ec590150d2751591a4f723721f78381e9))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.65.1-beta.1
16
+
3
17
  ## [0.4.5-beta](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.4.4...ideogram-v0.4.5-beta) (2025-11-03)
4
18
 
5
19
 
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IdeogramImageModel = void 0;
4
4
  const core_1 = require("@aigne/core");
5
5
  const camelize_js_1 = require("@aigne/core/utils/camelize.js");
6
+ const fetch_js_1 = require("@aigne/core/utils/fetch.js");
6
7
  const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
7
8
  const ufo_1 = require("ufo");
8
9
  const zod_1 = require("zod");
@@ -83,15 +84,11 @@ class IdeogramImageModel extends core_1.ImageModel {
83
84
  if (!apiKey)
84
85
  throw new Error(`${this.name} requires an API key. Please provide it via \`options.apiKey\`, or set the \`${this.apiKeyEnvName}\` environment variable`);
85
86
  const apiURL = (0, ufo_1.joinURL)(new URL(url).origin, "v1", model, image ? "remix" : "generate");
86
- const response = await fetch(apiURL, {
87
+ const response = await (0, fetch_js_1.fetch)(apiURL, {
87
88
  method: "POST",
88
89
  headers: { "api-key": apiKey },
89
90
  body: formData,
90
91
  });
91
- if (!response.ok) {
92
- const error = await response.text();
93
- throw new Error(`Ideogram API error: ${response.status} ${response.statusText} ${error}`);
94
- }
95
92
  const data = await response.json();
96
93
  return {
97
94
  images: data.data.map((item) => ({ type: "url", url: item.url, mimeType: "image/png" })),
@@ -1,5 +1,6 @@
1
1
  import { ImageModel, imageModelInputSchema, } from "@aigne/core";
2
2
  import { snakelize } from "@aigne/core/utils/camelize.js";
3
+ import { fetch } from "@aigne/core/utils/fetch.js";
3
4
  import { checkArguments, flat, pick } from "@aigne/core/utils/type-utils.js";
4
5
  import { joinURL } from "ufo";
5
6
  import { z } from "zod";
@@ -85,10 +86,6 @@ export class IdeogramImageModel extends ImageModel {
85
86
  headers: { "api-key": apiKey },
86
87
  body: formData,
87
88
  });
88
- if (!response.ok) {
89
- const error = await response.text();
90
- throw new Error(`Ideogram API error: ${response.status} ${response.statusText} ${error}`);
91
- }
92
89
  const data = await response.json();
93
90
  return {
94
91
  images: data.data.map((item) => ({ type: "url", url: item.url, mimeType: "image/png" })),
package/package.json CHANGED
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "ufo": "^1.6.1",
38
38
  "zod": "3.25.67",
39
- "@aigne/core": "1.65.1-beta"
39
+ "@aigne/core": "1.65.1-beta.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/bun": "^1.2.22",
@@ -47,7 +47,7 @@
47
47
  "rimraf": "^6.0.1",
48
48
  "typescript": "^5.9.2"
49
49
  },
50
- "version": "0.4.5-beta",
50
+ "version": "0.4.5-beta.1",
51
51
  "scripts": {
52
52
  "lint": "tsc --noEmit",
53
53
  "build": "tsc --build scripts/tsconfig.build.json",