@aigne/gemini 0.6.2 → 0.7.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,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.1](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.7.0...gemini-v0.7.1) (2025-07-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** update deps to latest version ([#247](https://github.com/AIGNE-io/aigne-framework/issues/247)) ([3972f88](https://github.com/AIGNE-io/aigne-framework/commit/3972f887a9abff20c26da6b51c1071cbd54c0bf1))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/openai bumped to 0.9.1
16
+ * devDependencies
17
+ * @aigne/core bumped to 1.33.1
18
+ * @aigne/test-utils bumped to 0.5.6
19
+
20
+ ## [0.7.0](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.6.2...gemini-v0.7.0) (2025-07-10)
21
+
22
+
23
+ ### Features
24
+
25
+ * **model:** reduce unnecessary LLM requests for structured output ([#241](https://github.com/AIGNE-io/aigne-framework/issues/241)) ([e28813c](https://github.com/AIGNE-io/aigne-framework/commit/e28813c021ed35c0251e198e2e007e2d746ab3d8))
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * The following workspace dependencies were updated
31
+ * dependencies
32
+ * @aigne/openai bumped to 0.9.0
33
+ * devDependencies
34
+ * @aigne/core bumped to 1.33.0
35
+ * @aigne/test-utils bumped to 0.5.5
36
+
3
37
  ## [0.6.2](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.6.1...gemini-v0.6.2) (2025-07-09)
4
38
 
5
39
 
package/README.md CHANGED
@@ -6,8 +6,6 @@
6
6
  [![NPM Version](https://img.shields.io/npm/v/@aigne/gemini)](https://www.npmjs.com/package/@aigne/gemini)
7
7
  [![Elastic-2.0 licensed](https://img.shields.io/npm/l/@aigne/gemini)](https://github.com/AIGNE-io/aigne-framework/blob/main/LICENSE.md)
8
8
 
9
- **English** | [中文](README.zh.md)
10
-
11
9
  AIGNE Gemini SDK for integrating with Google's Gemini AI models within the [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework).
12
10
 
13
11
  ## Introduction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/gemini",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "description": "AIGNE Gemini SDK for integrating with Google's Gemini AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,16 +32,16 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@aigne/openai": "^0.8.2"
35
+ "@aigne/openai": "^0.9.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/bun": "^1.2.17",
39
- "@types/node": "^24.0.10",
38
+ "@types/bun": "^1.2.18",
39
+ "@types/node": "^24.0.12",
40
40
  "npm-run-all": "^4.1.5",
41
41
  "rimraf": "^6.0.1",
42
42
  "typescript": "^5.8.3",
43
- "@aigne/core": "^1.32.2",
44
- "@aigne/test-utils": "^0.5.4"
43
+ "@aigne/core": "^1.33.1",
44
+ "@aigne/test-utils": "^0.5.6"
45
45
  },
46
46
  "scripts": {
47
47
  "lint": "tsc --noEmit",
package/README.zh.md DELETED
@@ -1,112 +0,0 @@
1
- # @aigne/gemini
2
-
3
- [![GitHub star chart](https://img.shields.io/github/stars/AIGNE-io/aigne-framework?style=flat-square)](https://star-history.com/#AIGNE-io/aigne-framework)
4
- [![Open Issues](https://img.shields.io/github/issues-raw/AIGNE-io/aigne-framework?style=flat-square)](https://github.com/AIGNE-io/aigne-framework/issues)
5
- [![codecov](https://codecov.io/gh/AIGNE-io/aigne-framework/graph/badge.svg?token=DO07834RQL)](https://codecov.io/gh/AIGNE-io/aigne-framework)
6
- [![NPM Version](https://img.shields.io/npm/v/@aigne/gemini)](https://www.npmjs.com/package/@aigne/gemini)
7
- [![Elastic-2.0 licensed](https://img.shields.io/npm/l/@aigne/gemini)](https://github.com/AIGNE-io/aigne-framework/blob/main/LICENSE.md)
8
-
9
- [English](README.md) | **中文**
10
-
11
- AIGNE Gemini SDK,用于在 [AIGNE 框架](https://github.com/AIGNE-io/aigne-framework) 中集成 Google 的 Gemini AI 模型。
12
-
13
- ## 简介
14
-
15
- `@aigne/gemini` 提供了 AIGNE 框架与 Google 的 Gemini 语言模型和 API 之间的无缝集成。该包使开发者能够在 AIGNE 应用程序中轻松利用 Gemini 的先进 AI 能力,同时提供框架内一致的接口,充分发挥 Google 最先进的多模态模型优势。
16
-
17
- ## 特性
18
-
19
- * **Google Gemini API 集成**:直接连接到 Google 的 Gemini API 服务
20
- * **聊天完成**:支持 Gemini 的聊天完成 API 和所有可用模型
21
- * **多模态支持**:内置支持处理文本和图像输入
22
- * **函数调用**:支持函数调用功能
23
- * **流式响应**:支持流式响应,提供更高响应性的应用程序体验
24
- * **类型安全**:为所有 API 和模型提供全面的 TypeScript 类型定义
25
- * **一致接口**:兼容 AIGNE 框架的模型接口
26
- * **错误处理**:健壮的错误处理和重试机制
27
- * **完整配置**:丰富的配置选项用于微调行为
28
-
29
- ## 安装
30
-
31
- ### 使用 npm
32
-
33
- ```bash
34
- npm install @aigne/gemini @aigne/core
35
- ```
36
-
37
- ### 使用 yarn
38
-
39
- ```bash
40
- yarn add @aigne/gemini @aigne/core
41
- ```
42
-
43
- ### 使用 pnpm
44
-
45
- ```bash
46
- pnpm add @aigne/gemini @aigne/core
47
- ```
48
-
49
- ## 基本用法
50
-
51
- ```typescript file="test/gemini-chat-model.test.ts" region="example-gemini-chat-model"
52
- import { GeminiChatModel } from "@aigne/gemini";
53
-
54
- const model = new GeminiChatModel({
55
- // Provide API key directly or use environment variable GOOGLE_API_KEY
56
- apiKey: "your-api-key", // Optional if set in env variables
57
- // Specify Gemini model version (defaults to 'gemini-1.5-pro' if not specified)
58
- model: "gemini-1.5-flash",
59
- modelOptions: {
60
- temperature: 0.7,
61
- },
62
- });
63
-
64
- const result = await model.invoke({
65
- messages: [{ role: "user", content: "Hi there, introduce yourself" }],
66
- });
67
-
68
- console.log(result);
69
- /* Output:
70
- {
71
- text: "Hello from Gemini! I'm Google's helpful AI assistant. How can I assist you today?",
72
- model: "gemini-1.5-flash"
73
- }
74
- */
75
- ```
76
-
77
- ## 流式响应
78
-
79
- ```typescript file="test/gemini-chat-model.test.ts" region="example-gemini-chat-model-streaming"
80
- import { isAgentResponseDelta } from "@aigne/core";
81
- import { GeminiChatModel } from "@aigne/gemini";
82
-
83
- const model = new GeminiChatModel({
84
- apiKey: "your-api-key",
85
- model: "gemini-1.5-flash",
86
- });
87
-
88
- const stream = await model.invoke(
89
- {
90
- messages: [{ role: "user", content: "Hi there, introduce yourself" }],
91
- },
92
- { streaming: true },
93
- );
94
-
95
- let fullText = "";
96
- const json = {};
97
-
98
- for await (const chunk of stream) {
99
- if (isAgentResponseDelta(chunk)) {
100
- const text = chunk.delta.text?.text;
101
- if (text) fullText += text;
102
- if (chunk.delta.json) Object.assign(json, chunk.delta.json);
103
- }
104
- }
105
-
106
- console.log(fullText); // Output: "Hello from Gemini! I'm Google's helpful AI assistant. How can I assist you today?"
107
- console.log(json); // { model: "gemini-1.5-flash" }
108
- ```
109
-
110
- ## 许可证
111
-
112
- Elastic-2.0