@aigne/gemini 0.3.11 → 0.4.0

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,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.3.11...gemini-v0.4.0) (2025-07-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **example:** use AIGNE cli to run chat-bot example ([#198](https://github.com/AIGNE-io/aigne-framework/issues/198)) ([7085541](https://github.com/AIGNE-io/aigne-framework/commit/708554100692f2a557f7329ea78e46c3c870ce10))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/openai bumped to 0.6.0
16
+ * devDependencies
17
+ * @aigne/core bumped to 1.28.0
18
+ * @aigne/test-utils bumped to 0.4.12
19
+
3
20
  ## [0.3.11](https://github.com/AIGNE-io/aigne-framework/compare/gemini-v0.3.10...gemini-v0.3.11) (2025-07-01)
4
21
 
5
22
 
package/README.md CHANGED
@@ -77,6 +77,7 @@ console.log(result);
77
77
  ## Streaming Responses
78
78
 
79
79
  ```typescript file="test/gemini-chat-model.test.ts" region="example-gemini-chat-model-streaming"
80
+ import { isAgentResponseDelta } from "@aigne/core";
80
81
  import { GeminiChatModel } from "@aigne/gemini";
81
82
 
82
83
  const model = new GeminiChatModel({
@@ -88,7 +89,6 @@ const stream = await model.invoke(
88
89
  {
89
90
  messages: [{ role: "user", content: "Hi there, introduce yourself" }],
90
91
  },
91
- undefined,
92
92
  { streaming: true },
93
93
  );
94
94
 
@@ -96,9 +96,11 @@ let fullText = "";
96
96
  const json = {};
97
97
 
98
98
  for await (const chunk of stream) {
99
- const text = chunk.delta.text?.text;
100
- if (text) fullText += text;
101
- if (chunk.delta.json) Object.assign(json, chunk.delta.json);
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
+ }
102
104
  }
103
105
 
104
106
  console.log(fullText); // Output: "Hello from Gemini! I'm Google's helpful AI assistant. How can I assist you today?"
package/README.zh.md CHANGED
@@ -77,6 +77,7 @@ console.log(result);
77
77
  ## 流式响应
78
78
 
79
79
  ```typescript file="test/gemini-chat-model.test.ts" region="example-gemini-chat-model-streaming"
80
+ import { isAgentResponseDelta } from "@aigne/core";
80
81
  import { GeminiChatModel } from "@aigne/gemini";
81
82
 
82
83
  const model = new GeminiChatModel({
@@ -88,7 +89,6 @@ const stream = await model.invoke(
88
89
  {
89
90
  messages: [{ role: "user", content: "Hi there, introduce yourself" }],
90
91
  },
91
- undefined,
92
92
  { streaming: true },
93
93
  );
94
94
 
@@ -96,9 +96,11 @@ let fullText = "";
96
96
  const json = {};
97
97
 
98
98
  for await (const chunk of stream) {
99
- const text = chunk.delta.text?.text;
100
- if (text) fullText += text;
101
- if (chunk.delta.json) Object.assign(json, chunk.delta.json);
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
+ }
102
104
  }
103
105
 
104
106
  console.log(fullText); // Output: "Hello from Gemini! I'm Google's helpful AI assistant. How can I assist you today?"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/gemini",
3
- "version": "0.3.11",
3
+ "version": "0.4.0",
4
4
  "description": "AIGNE Gemini SDK for integrating with Google's Gemini AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,7 +32,7 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@aigne/openai": "^0.5.0"
35
+ "@aigne/openai": "^0.6.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/bun": "^1.2.12",
@@ -40,8 +40,8 @@
40
40
  "npm-run-all": "^4.1.5",
41
41
  "rimraf": "^6.0.1",
42
42
  "typescript": "^5.8.3",
43
- "@aigne/core": "^1.27.0",
44
- "@aigne/test-utils": "^0.4.11"
43
+ "@aigne/test-utils": "^0.4.12",
44
+ "@aigne/core": "^1.28.0"
45
45
  },
46
46
  "scripts": {
47
47
  "lint": "tsc --noEmit",