@aigne/gemini 0.12.0 → 0.12.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 +17 -0
- package/lib/cjs/gemini-chat-model.js +5 -6
- package/lib/esm/gemini-chat-model.js +5 -6
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.1](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.12.0...gemini-v0.12.1) (2025-09-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* should not return local path from aigne hub service ([#460](https://github.com/AIGNE-io/aigne-framework/issues/460)) ([c959717](https://github.com/AIGNE-io/aigne-framework/commit/c95971774f7e84dbeb3313f60b3e6464e2bb22e4))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/openai bumped to 0.14.1
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @aigne/core bumped to 1.58.1
|
|
18
|
+
* @aigne/test-utils bumped to 0.5.45
|
|
19
|
+
|
|
3
20
|
## [0.12.0](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.11.6...gemini-v0.12.0) (2025-09-05)
|
|
4
21
|
|
|
5
22
|
|
|
@@ -49,9 +49,9 @@ class GeminiChatModel extends openai_1.OpenAIChatModel {
|
|
|
49
49
|
const model = input.modelOptions?.model || this.credential.model;
|
|
50
50
|
if (!model.includes("image"))
|
|
51
51
|
return super.process(input, options);
|
|
52
|
-
return this.handleImageModelProcessing(input
|
|
52
|
+
return this.handleImageModelProcessing(input);
|
|
53
53
|
}
|
|
54
|
-
async *handleImageModelProcessing(input
|
|
54
|
+
async *handleImageModelProcessing(input) {
|
|
55
55
|
const model = input.modelOptions?.model || this.credential.model;
|
|
56
56
|
const { contents, config } = await this.buildContents(input);
|
|
57
57
|
const parameters = {
|
|
@@ -92,13 +92,12 @@ class GeminiChatModel extends openai_1.OpenAIChatModel {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
if (part.inlineData?.data) {
|
|
95
|
-
files.push(
|
|
95
|
+
files.push({
|
|
96
96
|
type: "file",
|
|
97
97
|
data: part.inlineData.data,
|
|
98
98
|
filename: part.inlineData.displayName,
|
|
99
99
|
mimeType: part.inlineData.mimeType,
|
|
100
|
-
}
|
|
101
|
-
yield { delta: { json: { files } } };
|
|
100
|
+
});
|
|
102
101
|
}
|
|
103
102
|
if (part.functionCall?.name) {
|
|
104
103
|
toolCalls.push({
|
|
@@ -117,12 +116,12 @@ class GeminiChatModel extends openai_1.OpenAIChatModel {
|
|
|
117
116
|
if (chunk.usageMetadata) {
|
|
118
117
|
usage.inputTokens += chunk.usageMetadata.promptTokenCount || 0;
|
|
119
118
|
usage.outputTokens += chunk.usageMetadata.candidatesTokenCount || 0;
|
|
120
|
-
yield { delta: { json: { usage } } };
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
if (input.responseFormat?.type === "json_schema") {
|
|
124
122
|
yield { delta: { json: { json: (0, core_1.safeParseJSON)(text) } } };
|
|
125
123
|
}
|
|
124
|
+
yield { delta: { json: { usage, files } } };
|
|
126
125
|
}
|
|
127
126
|
async buildConfig(input) {
|
|
128
127
|
const config = {};
|
|
@@ -46,9 +46,9 @@ export class GeminiChatModel extends OpenAIChatModel {
|
|
|
46
46
|
const model = input.modelOptions?.model || this.credential.model;
|
|
47
47
|
if (!model.includes("image"))
|
|
48
48
|
return super.process(input, options);
|
|
49
|
-
return this.handleImageModelProcessing(input
|
|
49
|
+
return this.handleImageModelProcessing(input);
|
|
50
50
|
}
|
|
51
|
-
async *handleImageModelProcessing(input
|
|
51
|
+
async *handleImageModelProcessing(input) {
|
|
52
52
|
const model = input.modelOptions?.model || this.credential.model;
|
|
53
53
|
const { contents, config } = await this.buildContents(input);
|
|
54
54
|
const parameters = {
|
|
@@ -89,13 +89,12 @@ export class GeminiChatModel extends OpenAIChatModel {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
if (part.inlineData?.data) {
|
|
92
|
-
files.push(
|
|
92
|
+
files.push({
|
|
93
93
|
type: "file",
|
|
94
94
|
data: part.inlineData.data,
|
|
95
95
|
filename: part.inlineData.displayName,
|
|
96
96
|
mimeType: part.inlineData.mimeType,
|
|
97
|
-
}
|
|
98
|
-
yield { delta: { json: { files } } };
|
|
97
|
+
});
|
|
99
98
|
}
|
|
100
99
|
if (part.functionCall?.name) {
|
|
101
100
|
toolCalls.push({
|
|
@@ -114,12 +113,12 @@ export class GeminiChatModel extends OpenAIChatModel {
|
|
|
114
113
|
if (chunk.usageMetadata) {
|
|
115
114
|
usage.inputTokens += chunk.usageMetadata.promptTokenCount || 0;
|
|
116
115
|
usage.outputTokens += chunk.usageMetadata.candidatesTokenCount || 0;
|
|
117
|
-
yield { delta: { json: { usage } } };
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
if (input.responseFormat?.type === "json_schema") {
|
|
121
119
|
yield { delta: { json: { json: safeParseJSON(text) } } };
|
|
122
120
|
}
|
|
121
|
+
yield { delta: { json: { usage, files } } };
|
|
123
122
|
}
|
|
124
123
|
async buildConfig(input) {
|
|
125
124
|
const config = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/gemini",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "AIGNE Gemini SDK for integrating with Google's Gemini AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@google/genai": "^1.15.0",
|
|
39
39
|
"uuid": "^11.1.0",
|
|
40
40
|
"zod": "^3.25.67",
|
|
41
|
-
"@aigne/
|
|
42
|
-
"@aigne/
|
|
41
|
+
"@aigne/openai": "^0.14.1",
|
|
42
|
+
"@aigne/platform-helpers": "^0.6.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "^1.2.18",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"npm-run-all": "^4.1.5",
|
|
48
48
|
"rimraf": "^6.0.1",
|
|
49
49
|
"typescript": "^5.8.3",
|
|
50
|
-
"@aigne/
|
|
51
|
-
"@aigne/
|
|
50
|
+
"@aigne/test-utils": "^0.5.45",
|
|
51
|
+
"@aigne/core": "^1.58.1"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"lint": "tsc --noEmit",
|