@aigne/aigne-hub 0.6.10 → 0.7.0

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,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.6.10...aigne-hub-v0.7.0) (2025-08-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * **models:** support gemini and ideogram images models ([#412](https://github.com/AIGNE-io/aigne-framework/issues/412)) ([6534fec](https://github.com/AIGNE-io/aigne-framework/commit/6534fecb0bdfb4b0a4440d44c0e563b9a029a68f))
9
+ * **models:** support gemini and ideogram images models ([#412](https://github.com/AIGNE-io/aigne-framework/issues/412)) ([6534fec](https://github.com/AIGNE-io/aigne-framework/commit/6534fecb0bdfb4b0a4440d44c0e563b9a029a68f))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @aigne/deepseek bumped to 0.7.29
17
+ * @aigne/doubao bumped to 1.0.23
18
+ * @aigne/gemini bumped to 0.10.0
19
+ * @aigne/ideogram bumped to 0.2.0
20
+ * @aigne/ollama bumped to 0.7.29
21
+ * @aigne/open-router bumped to 0.7.29
22
+ * @aigne/openai bumped to 0.13.0
23
+ * @aigne/poe bumped to 1.0.9
24
+ * @aigne/transport bumped to 0.14.9
25
+ * @aigne/xai bumped to 0.7.29
26
+ * devDependencies
27
+ * @aigne/openai bumped to 0.13.0
28
+
3
29
  ## [0.6.10](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.6.9...aigne-hub-v0.6.10) (2025-08-26)
4
30
 
5
31
 
@@ -1,4 +1,4 @@
1
- import type { ChatModel, ChatModelOptions } from "@aigne/core";
1
+ import type { ChatModel, ChatModelOptions, ImageModel, ImageModelOptions } from "@aigne/core";
2
2
  export interface LoadableModel {
3
3
  name: string | string[];
4
4
  apiKeyEnvName?: string | string[];
@@ -10,6 +10,15 @@ export interface LoadableModel {
10
10
  }) => ChatModel;
11
11
  }
12
12
  export declare function availableModels(): LoadableModel[];
13
+ export interface LoadableImageModel {
14
+ name: string;
15
+ apiKeyEnvName: string;
16
+ create: (options: {
17
+ model?: string;
18
+ modelOptions?: ImageModelOptions;
19
+ }) => ImageModel;
20
+ }
21
+ export declare function availableImageModels(): LoadableImageModel[];
13
22
  export declare function findModel(provider: string): {
14
23
  all: LoadableModel[];
15
24
  match: LoadableModel | undefined;
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.availableModels = availableModels;
4
+ exports.availableImageModels = availableImageModels;
4
5
  exports.findModel = findModel;
5
6
  const anthropic_1 = require("@aigne/anthropic");
6
7
  const bedrock_1 = require("@aigne/bedrock");
7
8
  const deepseek_1 = require("@aigne/deepseek");
8
9
  const doubao_1 = require("@aigne/doubao");
9
10
  const gemini_1 = require("@aigne/gemini");
11
+ const ideogram_1 = require("@aigne/ideogram");
10
12
  const ollama_1 = require("@aigne/ollama");
11
13
  const open_router_1 = require("@aigne/open-router");
12
14
  const openai_1 = require("@aigne/openai");
@@ -15,7 +17,7 @@ const xai_1 = require("@aigne/xai");
15
17
  const node_http_handler_1 = require("@smithy/node-http-handler");
16
18
  const https_proxy_agent_1 = require("https-proxy-agent");
17
19
  const aigne_hub_model_js_1 = require("../aigne-hub-model.js");
18
- function availableModels() {
20
+ const getClientOptions = () => {
19
21
  const proxy = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"]
20
22
  .map((i) => process.env[i])
21
23
  .filter(Boolean)[0];
@@ -26,6 +28,13 @@ function availableModels() {
26
28
  agent: httpAgent,
27
29
  },
28
30
  };
31
+ return {
32
+ clientOptions,
33
+ httpAgent,
34
+ };
35
+ };
36
+ function availableModels() {
37
+ const { clientOptions, httpAgent } = getClientOptions();
29
38
  return [
30
39
  {
31
40
  name: openai_1.OpenAIChatModel.name,
@@ -90,6 +99,41 @@ function availableModels() {
90
99
  },
91
100
  ];
92
101
  }
102
+ function availableImageModels() {
103
+ const { clientOptions } = getClientOptions();
104
+ return [
105
+ {
106
+ name: openai_1.OpenAIImageModel.name,
107
+ apiKeyEnvName: "OPENAI_API_KEY",
108
+ create: (params) => new openai_1.OpenAIImageModel({
109
+ model: params.model,
110
+ clientOptions,
111
+ ...(params.modelOptions && {
112
+ modelOptions: params.modelOptions,
113
+ }),
114
+ }),
115
+ },
116
+ {
117
+ name: gemini_1.GeminiImageModel.name,
118
+ apiKeyEnvName: "GEMINI_API_KEY",
119
+ create: (params) => new gemini_1.GeminiImageModel({
120
+ ...params,
121
+ clientOptions,
122
+ ...(params.modelOptions && {
123
+ modelOptions: params.modelOptions,
124
+ }),
125
+ }),
126
+ },
127
+ {
128
+ name: ideogram_1.IdeogramImageModel.name,
129
+ apiKeyEnvName: "IDEOGRAM_API_KEY",
130
+ create: (params) => new ideogram_1.IdeogramImageModel({
131
+ ...params,
132
+ modelOptions: params.modelOptions,
133
+ }),
134
+ },
135
+ ];
136
+ }
93
137
  function findModel(provider) {
94
138
  provider = provider.toLowerCase().replace(/-/g, "");
95
139
  const all = availableModels();
@@ -1,4 +1,4 @@
1
- import type { ChatModel, ChatModelOptions } from "@aigne/core";
1
+ import type { ChatModel, ChatModelOptions, ImageModel, ImageModelOptions } from "@aigne/core";
2
2
  export interface LoadableModel {
3
3
  name: string | string[];
4
4
  apiKeyEnvName?: string | string[];
@@ -10,6 +10,15 @@ export interface LoadableModel {
10
10
  }) => ChatModel;
11
11
  }
12
12
  export declare function availableModels(): LoadableModel[];
13
+ export interface LoadableImageModel {
14
+ name: string;
15
+ apiKeyEnvName: string;
16
+ create: (options: {
17
+ model?: string;
18
+ modelOptions?: ImageModelOptions;
19
+ }) => ImageModel;
20
+ }
21
+ export declare function availableImageModels(): LoadableImageModel[];
13
22
  export declare function findModel(provider: string): {
14
23
  all: LoadableModel[];
15
24
  match: LoadableModel | undefined;
@@ -1,4 +1,4 @@
1
- import type { ChatModel, ChatModelOptions } from "@aigne/core";
1
+ import type { ChatModel, ChatModelOptions, ImageModel, ImageModelOptions } from "@aigne/core";
2
2
  export interface LoadableModel {
3
3
  name: string | string[];
4
4
  apiKeyEnvName?: string | string[];
@@ -10,6 +10,15 @@ export interface LoadableModel {
10
10
  }) => ChatModel;
11
11
  }
12
12
  export declare function availableModels(): LoadableModel[];
13
+ export interface LoadableImageModel {
14
+ name: string;
15
+ apiKeyEnvName: string;
16
+ create: (options: {
17
+ model?: string;
18
+ modelOptions?: ImageModelOptions;
19
+ }) => ImageModel;
20
+ }
21
+ export declare function availableImageModels(): LoadableImageModel[];
13
22
  export declare function findModel(provider: string): {
14
23
  all: LoadableModel[];
15
24
  match: LoadableModel | undefined;
@@ -2,16 +2,17 @@ import { AnthropicChatModel } from "@aigne/anthropic";
2
2
  import { BedrockChatModel } from "@aigne/bedrock";
3
3
  import { DeepSeekChatModel } from "@aigne/deepseek";
4
4
  import { DoubaoChatModel } from "@aigne/doubao";
5
- import { GeminiChatModel } from "@aigne/gemini";
5
+ import { GeminiChatModel, GeminiImageModel } from "@aigne/gemini";
6
+ import { IdeogramImageModel } from "@aigne/ideogram";
6
7
  import { OllamaChatModel } from "@aigne/ollama";
7
8
  import { OpenRouterChatModel } from "@aigne/open-router";
8
- import { OpenAIChatModel } from "@aigne/openai";
9
+ import { OpenAIChatModel, OpenAIImageModel, } from "@aigne/openai";
9
10
  import { PoeChatModel } from "@aigne/poe";
10
11
  import { XAIChatModel } from "@aigne/xai";
11
12
  import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler";
12
13
  import { HttpsProxyAgent } from "https-proxy-agent";
13
14
  import { AIGNEHubChatModel } from "../aigne-hub-model.js";
14
- export function availableModels() {
15
+ const getClientOptions = () => {
15
16
  const proxy = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"]
16
17
  .map((i) => process.env[i])
17
18
  .filter(Boolean)[0];
@@ -22,6 +23,13 @@ export function availableModels() {
22
23
  agent: httpAgent,
23
24
  },
24
25
  };
26
+ return {
27
+ clientOptions,
28
+ httpAgent,
29
+ };
30
+ };
31
+ export function availableModels() {
32
+ const { clientOptions, httpAgent } = getClientOptions();
25
33
  return [
26
34
  {
27
35
  name: OpenAIChatModel.name,
@@ -86,6 +94,41 @@ export function availableModels() {
86
94
  },
87
95
  ];
88
96
  }
97
+ export function availableImageModels() {
98
+ const { clientOptions } = getClientOptions();
99
+ return [
100
+ {
101
+ name: OpenAIImageModel.name,
102
+ apiKeyEnvName: "OPENAI_API_KEY",
103
+ create: (params) => new OpenAIImageModel({
104
+ model: params.model,
105
+ clientOptions,
106
+ ...(params.modelOptions && {
107
+ modelOptions: params.modelOptions,
108
+ }),
109
+ }),
110
+ },
111
+ {
112
+ name: GeminiImageModel.name,
113
+ apiKeyEnvName: "GEMINI_API_KEY",
114
+ create: (params) => new GeminiImageModel({
115
+ ...params,
116
+ clientOptions,
117
+ ...(params.modelOptions && {
118
+ modelOptions: params.modelOptions,
119
+ }),
120
+ }),
121
+ },
122
+ {
123
+ name: IdeogramImageModel.name,
124
+ apiKeyEnvName: "IDEOGRAM_API_KEY",
125
+ create: (params) => new IdeogramImageModel({
126
+ ...params,
127
+ modelOptions: params.modelOptions,
128
+ }),
129
+ },
130
+ ];
131
+ }
89
132
  export function findModel(provider) {
90
133
  provider = provider.toLowerCase().replace(/-/g, "");
91
134
  const all = availableModels();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/aigne-hub",
3
- "version": "0.6.10",
3
+ "version": "0.7.0",
4
4
  "description": "AIGNE Hub SDK for integrating with Hub AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,19 +39,20 @@
39
39
  "https-proxy-agent": "^7.0.6",
40
40
  "ufo": "^1.6.1",
41
41
  "zod": "^3.25.67",
42
+ "@aigne/anthropic": "^0.11.10",
42
43
  "@aigne/core": "^1.55.1",
43
44
  "@aigne/bedrock": "^0.9.10",
44
- "@aigne/gemini": "^0.9.10",
45
- "@aigne/doubao": "^1.0.22",
46
- "@aigne/ollama": "^0.7.28",
47
- "@aigne/deepseek": "^0.7.28",
48
- "@aigne/open-router": "^0.7.28",
49
- "@aigne/anthropic": "^0.11.10",
45
+ "@aigne/deepseek": "^0.7.29",
46
+ "@aigne/gemini": "^0.10.0",
47
+ "@aigne/doubao": "^1.0.23",
48
+ "@aigne/open-router": "^0.7.29",
49
+ "@aigne/ollama": "^0.7.29",
50
+ "@aigne/ideogram": "^0.2.0",
51
+ "@aigne/openai": "^0.13.0",
50
52
  "@aigne/platform-helpers": "^0.6.2",
51
- "@aigne/openai": "^0.12.4",
52
- "@aigne/xai": "^0.7.28",
53
- "@aigne/transport": "^0.14.8",
54
- "@aigne/poe": "^1.0.8"
53
+ "@aigne/xai": "^0.7.29",
54
+ "@aigne/poe": "^1.0.9",
55
+ "@aigne/transport": "^0.14.9"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@types/bun": "^1.2.18",
@@ -60,7 +61,7 @@
60
61
  "npm-run-all": "^4.1.5",
61
62
  "rimraf": "^6.0.1",
62
63
  "typescript": "^5.8.3",
63
- "@aigne/openai": "^0.12.4",
64
+ "@aigne/openai": "^0.13.0",
64
65
  "@aigne/test-utils": "^0.5.36"
65
66
  },
66
67
  "scripts": {