@aigne/gemini 0.13.3 → 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,24 @@
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
+
10
+ ## [0.13.4](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.13.3...gemini-v0.13.4) (2025-09-18)
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * The following workspace dependencies were updated
16
+ * dependencies
17
+ * @aigne/openai bumped to 0.15.4
18
+ * devDependencies
19
+ * @aigne/core bumped to 1.60.3
20
+ * @aigne/test-utils bumped to 0.5.52
21
+
3
22
  ## [0.13.3](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.13.2...gemini-v0.13.3) (2025-09-11)
4
23
 
5
24
 
@@ -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
- const lastMessage = messages.at(-1);
236
- if (lastMessage?.role === "system") {
237
- lastMessage.role = "user"; // Ensure the last message is from the user
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
- const lastMessage = messages.at(-1);
233
- if (lastMessage?.role === "system") {
234
- lastMessage.role = "user"; // Ensure the last message is from the user
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",
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"
@@ -35,20 +35,20 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@google/genai": "^1.15.0",
39
- "uuid": "^11.1.0",
38
+ "@google/genai": "^1.20.0",
39
+ "uuid": "^13.0.0",
40
40
  "zod": "^3.25.67",
41
- "@aigne/openai": "^0.15.3",
41
+ "@aigne/openai": "^0.15.4",
42
42
  "@aigne/platform-helpers": "^0.6.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/bun": "^1.2.18",
46
- "@types/node": "^24.0.12",
45
+ "@types/bun": "^1.2.22",
46
+ "@types/node": "^24.5.1",
47
47
  "npm-run-all": "^4.1.5",
48
48
  "rimraf": "^6.0.1",
49
- "typescript": "^5.8.3",
50
- "@aigne/core": "^1.60.2",
51
- "@aigne/test-utils": "^0.5.51"
49
+ "typescript": "^5.9.2",
50
+ "@aigne/test-utils": "^0.5.52",
51
+ "@aigne/core": "^1.60.3"
52
52
  },
53
53
  "scripts": {
54
54
  "lint": "tsc --noEmit",