@aigne/gemini 0.13.4 → 0.13.5
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,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.13.5](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.13.4...gemini-v0.13.5) (2025-09-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **gemini:** should include at least one user message ([#521](https://github.com/AIGNE-io/aigne-framework/issues/521)) ([eb2752e](https://github.com/AIGNE-io/aigne-framework/commit/eb2752ed7d78f59c435ecc3ccb7227e804e3781e))
|
|
9
|
+
|
|
3
10
|
## [0.13.4](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.13.3...gemini-v0.13.4) (2025-09-18)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -232,9 +232,14 @@ class GeminiChatModel extends openai_1.OpenAIChatModel {
|
|
|
232
232
|
}
|
|
233
233
|
async getRunMessages(input) {
|
|
234
234
|
const messages = await super.getRunMessages(input);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
if (!messages.some((i) => i.role === "user")) {
|
|
236
|
+
for (const msg of messages) {
|
|
237
|
+
if (msg.role === "system") {
|
|
238
|
+
// Ensure the last message is from the user
|
|
239
|
+
msg.role = "user";
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
238
243
|
}
|
|
239
244
|
return messages;
|
|
240
245
|
}
|
|
@@ -229,9 +229,14 @@ export class GeminiChatModel extends OpenAIChatModel {
|
|
|
229
229
|
}
|
|
230
230
|
async getRunMessages(input) {
|
|
231
231
|
const messages = await super.getRunMessages(input);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
if (!messages.some((i) => i.role === "user")) {
|
|
233
|
+
for (const msg of messages) {
|
|
234
|
+
if (msg.role === "system") {
|
|
235
|
+
// Ensure the last message is from the user
|
|
236
|
+
msg.role = "user";
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
235
240
|
}
|
|
236
241
|
return messages;
|
|
237
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/gemini",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"description": "AIGNE Gemini SDK for integrating with Google's Gemini AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"npm-run-all": "^4.1.5",
|
|
48
48
|
"rimraf": "^6.0.1",
|
|
49
49
|
"typescript": "^5.9.2",
|
|
50
|
-
"@aigne/
|
|
51
|
-
"@aigne/
|
|
50
|
+
"@aigne/test-utils": "^0.5.52",
|
|
51
|
+
"@aigne/core": "^1.60.3"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"lint": "tsc --noEmit",
|