@aigne/gemini 0.14.14 → 0.14.15-beta.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,37 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.14.15-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.14.15-beta...gemini-v0.14.15-beta.1) (2025-12-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * correct run example & doc improvements ([#707](https://github.com/AIGNE-io/aigne-framework/issues/707)) ([f98fc5d](https://github.com/AIGNE-io/aigne-framework/commit/f98fc5df28fd6ce6134128c2f0e5395c1554b740))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.71.0-beta.1
16
+ * devDependencies
17
+ * @aigne/test-utils bumped to 0.5.68-beta.1
18
+
19
+ ## [0.14.15-beta](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.14.14...gemini-v0.14.15-beta) (2025-12-07)
20
+
21
+
22
+ ### Features
23
+
24
+ * support define agent by third library & orchestrator agent refactor ([#799](https://github.com/AIGNE-io/aigne-framework/issues/799)) ([7264b11](https://github.com/AIGNE-io/aigne-framework/commit/7264b11ab6eed787e928367f09aa08d254968d40))
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @aigne/core bumped to 1.71.0-beta
32
+ * devDependencies
33
+ * @aigne/test-utils bumped to 0.5.68-beta
34
+
3
35
  ## [0.14.14](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.14.14-beta...gemini-v0.14.14) (2025-12-06)
4
36
 
5
37
 
@@ -68,21 +68,21 @@ export declare class GeminiChatModel extends ChatModel {
68
68
  protected thinkingBudgetModelMap: ({
69
69
  pattern: RegExp;
70
70
  support: boolean;
71
- type: string;
71
+ type?: undefined;
72
72
  min?: undefined;
73
73
  max?: undefined;
74
74
  } | {
75
75
  pattern: RegExp;
76
76
  support: boolean;
77
- min: number;
78
- max: number;
79
- type?: undefined;
77
+ type: string;
78
+ min?: undefined;
79
+ max?: undefined;
80
80
  } | {
81
81
  pattern: RegExp;
82
82
  support: boolean;
83
+ min: number;
84
+ max: number;
83
85
  type?: undefined;
84
- min?: undefined;
85
- max?: undefined;
86
86
  })[];
87
87
  protected thinkingBudgetLevelMap: {
88
88
  high: number;
@@ -8,6 +8,7 @@ const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
8
8
  const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
9
9
  const uuid_1 = require("@aigne/uuid");
10
10
  const genai_1 = require("@google/genai");
11
+ const yaml_1 = require("yaml");
11
12
  const zod_1 = require("zod");
12
13
  const zod_to_json_schema_1 = require("zod-to-json-schema");
13
14
  const GEMINI_DEFAULT_CHAT_MODEL = "gemini-2.0-flash";
@@ -65,6 +66,11 @@ class GeminiChatModel extends core_1.ChatModel {
65
66
  }
66
67
  // References: https://ai.google.dev/gemini-api/docs/thinking#set-budget
67
68
  thinkingBudgetModelMap = [
69
+ // 注意:gemini-2.5-flash-image-preview 模型并不支持 thinking。see: https://github.com/CherryHQ/cherry-studio/issues/9614
70
+ {
71
+ pattern: /gemini-2.5-flash-image-preview/,
72
+ support: false,
73
+ },
68
74
  {
69
75
  pattern: /gemini-3(?!.*-image-)/,
70
76
  support: true,
@@ -426,7 +432,7 @@ class GeminiChatModel extends core_1.ChatModel {
426
432
  .find((c) => c?.id === msg.toolCallId);
427
433
  if (!call)
428
434
  throw new Error(`Tool call not found: ${msg.toolCallId}`);
429
- const output = JSON.parse(msg.content);
435
+ const output = (0, yaml_1.parse)(msg.content);
430
436
  const isError = "error" in output && Boolean(input.error);
431
437
  const response = {
432
438
  tool: call.function.name,
@@ -68,21 +68,21 @@ export declare class GeminiChatModel extends ChatModel {
68
68
  protected thinkingBudgetModelMap: ({
69
69
  pattern: RegExp;
70
70
  support: boolean;
71
- type: string;
71
+ type?: undefined;
72
72
  min?: undefined;
73
73
  max?: undefined;
74
74
  } | {
75
75
  pattern: RegExp;
76
76
  support: boolean;
77
- min: number;
78
- max: number;
79
- type?: undefined;
77
+ type: string;
78
+ min?: undefined;
79
+ max?: undefined;
80
80
  } | {
81
81
  pattern: RegExp;
82
82
  support: boolean;
83
+ min: number;
84
+ max: number;
83
85
  type?: undefined;
84
- min?: undefined;
85
- max?: undefined;
86
86
  })[];
87
87
  protected thinkingBudgetLevelMap: {
88
88
  high: number;
@@ -68,21 +68,21 @@ export declare class GeminiChatModel extends ChatModel {
68
68
  protected thinkingBudgetModelMap: ({
69
69
  pattern: RegExp;
70
70
  support: boolean;
71
- type: string;
71
+ type?: undefined;
72
72
  min?: undefined;
73
73
  max?: undefined;
74
74
  } | {
75
75
  pattern: RegExp;
76
76
  support: boolean;
77
- min: number;
78
- max: number;
79
- type?: undefined;
77
+ type: string;
78
+ min?: undefined;
79
+ max?: undefined;
80
80
  } | {
81
81
  pattern: RegExp;
82
82
  support: boolean;
83
+ min: number;
84
+ max: number;
83
85
  type?: undefined;
84
- min?: undefined;
85
- max?: undefined;
86
86
  })[];
87
87
  protected thinkingBudgetLevelMap: {
88
88
  high: number;
@@ -5,6 +5,7 @@ import { isNonNullable } from "@aigne/core/utils/type-utils.js";
5
5
  import { nodejs } from "@aigne/platform-helpers/nodejs/index.js";
6
6
  import { v7 } from "@aigne/uuid";
7
7
  import { createPartFromUri, createUserContent, FunctionCallingConfigMode, GoogleGenAI, ThinkingLevel, } from "@google/genai";
8
+ import { parse } from "yaml";
8
9
  import { z } from "zod";
9
10
  import { zodToJsonSchema } from "zod-to-json-schema";
10
11
  const GEMINI_DEFAULT_CHAT_MODEL = "gemini-2.0-flash";
@@ -62,6 +63,11 @@ export class GeminiChatModel extends ChatModel {
62
63
  }
63
64
  // References: https://ai.google.dev/gemini-api/docs/thinking#set-budget
64
65
  thinkingBudgetModelMap = [
66
+ // 注意:gemini-2.5-flash-image-preview 模型并不支持 thinking。see: https://github.com/CherryHQ/cherry-studio/issues/9614
67
+ {
68
+ pattern: /gemini-2.5-flash-image-preview/,
69
+ support: false,
70
+ },
65
71
  {
66
72
  pattern: /gemini-3(?!.*-image-)/,
67
73
  support: true,
@@ -423,7 +429,7 @@ export class GeminiChatModel extends ChatModel {
423
429
  .find((c) => c?.id === msg.toolCallId);
424
430
  if (!call)
425
431
  throw new Error(`Tool call not found: ${msg.toolCallId}`);
426
- const output = JSON.parse(msg.content);
432
+ const output = parse(msg.content);
427
433
  const isError = "error" in output && Boolean(input.error);
428
434
  const response = {
429
435
  tool: call.function.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/gemini",
3
- "version": "0.14.14",
3
+ "version": "0.14.15-beta.1",
4
4
  "description": "AIGNE Gemini SDK for integrating with Google's Gemini AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,9 +37,10 @@
37
37
  "dependencies": {
38
38
  "@aigne/uuid": "^13.0.1",
39
39
  "@google/genai": "^1.30.0",
40
+ "yaml": "^2.8.1",
40
41
  "zod": "^3.25.67",
41
42
  "zod-to-json-schema": "^3.24.6",
42
- "@aigne/core": "^1.70.1",
43
+ "@aigne/core": "^1.71.0-beta.1",
43
44
  "@aigne/platform-helpers": "^0.6.5"
44
45
  },
45
46
  "devDependencies": {
@@ -48,7 +49,7 @@
48
49
  "npm-run-all": "^4.1.5",
49
50
  "rimraf": "^6.0.1",
50
51
  "typescript": "^5.9.2",
51
- "@aigne/test-utils": "^0.5.67"
52
+ "@aigne/test-utils": "^0.5.68-beta.1"
52
53
  },
53
54
  "scripts": {
54
55
  "lint": "tsc --noEmit",