@aigne/ideogram 0.2.0 → 0.3.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,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.3.0...ideogram-v0.3.1) (2025-08-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * support gemini-2.0-flash model for image model ([#429](https://github.com/AIGNE-io/aigne-framework/issues/429)) ([5a0bba1](https://github.com/AIGNE-io/aigne-framework/commit/5a0bba197cf8785384b70302f86cf702d04b7fc4))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.57.0
16
+
17
+ ## [0.3.0](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.2.0...ideogram-v0.3.0) (2025-08-27)
18
+
19
+
20
+ ### Features
21
+
22
+ * **models:** support aigne hub models ([#416](https://github.com/AIGNE-io/aigne-framework/issues/416)) ([b4f014c](https://github.com/AIGNE-io/aigne-framework/commit/b4f014cf5ed08ef930d3ddfc278d3610e64c6af3))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @aigne/core bumped to 1.56.0
30
+
3
31
  ## [0.2.0](https://github.com/AIGNE-io/aigne-framework/compare/ideogram-v0.1.0...ideogram-v0.2.0) (2025-08-27)
4
32
 
5
33
 
@@ -16,6 +16,7 @@ export interface IdeogramImageModelOutput extends ImageModelOutput {
16
16
  export interface IdeogramImageModelOptions extends ImageModelOptions<IdeogramImageModelInput, IdeogramImageModelOutput> {
17
17
  apiKey?: string;
18
18
  baseURL?: string;
19
+ model?: string;
19
20
  modelOptions?: Omit<Partial<IdeogramImageModelInput>, "model">;
20
21
  }
21
22
  export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInput, IdeogramImageModelOutput> {
@@ -4,14 +4,15 @@ 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
6
  const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
7
+ const ufo_1 = require("ufo");
7
8
  const zod_1 = require("zod");
8
- const IDEOGRAM_BASE_URL = "https://api.ideogram.ai/v1/ideogram-v3/generate";
9
+ const IDEOGRAM_BASE_URL = "https://api.ideogram.ai";
9
10
  const ideogramImageModelInputSchema = core_1.imageModelInputSchema.extend({});
10
11
  const ideogramImageModelOptionsSchema = zod_1.z.object({
11
12
  apiKey: zod_1.z.string().optional(),
12
13
  baseURL: zod_1.z.string().optional(),
14
+ model: zod_1.z.string().optional(),
13
15
  modelOptions: zod_1.z.object({}).optional(),
14
- clientOptions: zod_1.z.object({}).optional(),
15
16
  });
16
17
  class IdeogramImageModel extends core_1.ImageModel {
17
18
  options;
@@ -43,6 +44,9 @@ class IdeogramImageModel extends core_1.ImageModel {
43
44
  async process(input) {
44
45
  const model = input.model;
45
46
  const formData = new FormData();
47
+ if (model !== "ideogram-v3") {
48
+ throw new Error(`${this.name} only support ideogram-v3`);
49
+ }
46
50
  const inputKeys = [
47
51
  "prompt",
48
52
  "seed",
@@ -67,7 +71,7 @@ class IdeogramImageModel extends core_1.ImageModel {
67
71
  const { url, apiKey } = this.credential;
68
72
  if (!apiKey)
69
73
  throw new Error(`${this.name} requires an API key. Please provide it via \`options.apiKey\`, or set the \`${this.apiKeyEnvName}\` environment variable`);
70
- const response = await fetch(url, {
74
+ const response = await fetch((0, ufo_1.joinURL)(new URL(url).origin, `/v1/${model}/generate`), {
71
75
  method: "POST",
72
76
  headers: { "api-key": apiKey },
73
77
  body: formData,
@@ -16,6 +16,7 @@ export interface IdeogramImageModelOutput extends ImageModelOutput {
16
16
  export interface IdeogramImageModelOptions extends ImageModelOptions<IdeogramImageModelInput, IdeogramImageModelOutput> {
17
17
  apiKey?: string;
18
18
  baseURL?: string;
19
+ model?: string;
19
20
  modelOptions?: Omit<Partial<IdeogramImageModelInput>, "model">;
20
21
  }
21
22
  export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInput, IdeogramImageModelOutput> {
@@ -16,6 +16,7 @@ export interface IdeogramImageModelOutput extends ImageModelOutput {
16
16
  export interface IdeogramImageModelOptions extends ImageModelOptions<IdeogramImageModelInput, IdeogramImageModelOutput> {
17
17
  apiKey?: string;
18
18
  baseURL?: string;
19
+ model?: string;
19
20
  modelOptions?: Omit<Partial<IdeogramImageModelInput>, "model">;
20
21
  }
21
22
  export declare class IdeogramImageModel extends ImageModel<IdeogramImageModelInput, IdeogramImageModelOutput> {
@@ -1,14 +1,15 @@
1
1
  import { ImageModel, imageModelInputSchema, } from "@aigne/core";
2
2
  import { snakelize } from "@aigne/core/utils/camelize.js";
3
3
  import { checkArguments, pick } from "@aigne/core/utils/type-utils.js";
4
+ import { joinURL } from "ufo";
4
5
  import { z } from "zod";
5
- const IDEOGRAM_BASE_URL = "https://api.ideogram.ai/v1/ideogram-v3/generate";
6
+ const IDEOGRAM_BASE_URL = "https://api.ideogram.ai";
6
7
  const ideogramImageModelInputSchema = imageModelInputSchema.extend({});
7
8
  const ideogramImageModelOptionsSchema = z.object({
8
9
  apiKey: z.string().optional(),
9
10
  baseURL: z.string().optional(),
11
+ model: z.string().optional(),
10
12
  modelOptions: z.object({}).optional(),
11
- clientOptions: z.object({}).optional(),
12
13
  });
13
14
  export class IdeogramImageModel extends ImageModel {
14
15
  options;
@@ -40,6 +41,9 @@ export class IdeogramImageModel extends ImageModel {
40
41
  async process(input) {
41
42
  const model = input.model;
42
43
  const formData = new FormData();
44
+ if (model !== "ideogram-v3") {
45
+ throw new Error(`${this.name} only support ideogram-v3`);
46
+ }
43
47
  const inputKeys = [
44
48
  "prompt",
45
49
  "seed",
@@ -64,7 +68,7 @@ export class IdeogramImageModel extends ImageModel {
64
68
  const { url, apiKey } = this.credential;
65
69
  if (!apiKey)
66
70
  throw new Error(`${this.name} requires an API key. Please provide it via \`options.apiKey\`, or set the \`${this.apiKeyEnvName}\` environment variable`);
67
- const response = await fetch(url, {
71
+ const response = await fetch(joinURL(new URL(url).origin, `/v1/${model}/generate`), {
68
72
  method: "POST",
69
73
  headers: { "api-key": apiKey },
70
74
  body: formData,
package/package.json CHANGED
@@ -34,7 +34,8 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@aigne/core": "1.55.1"
37
+ "ufo": "^1.6.1",
38
+ "@aigne/core": "1.57.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/bun": "^1.2.18",
@@ -46,7 +47,7 @@
46
47
  "typescript": "^5.8.3",
47
48
  "zod": "3.25.67"
48
49
  },
49
- "version": "0.2.0",
50
+ "version": "0.3.1",
50
51
  "scripts": {
51
52
  "lint": "tsc --noEmit",
52
53
  "build": "tsc --build scripts/tsconfig.build.json",