@aigne/example-chat-bot 1.12.1-3 → 1.13.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.
@@ -1,18 +1,44 @@
1
1
  # Change the name of this file to .env.local and fill in the following values
2
2
 
3
- # Use this for OpenAI models
4
- # MODEL="openai:gpt-4.1"
5
- OPENAI_API_KEY="" # Your OpenAI API key
3
+ # Uncomment the lines below to enable debug logging
4
+ # DEBUG="aigne:*"
6
5
 
7
- # Use this for Anthropic models
6
+ # Use different Models
7
+
8
+ # OpenAI
9
+ MODEL="openai:gpt-4.1"
10
+ OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
11
+
12
+ # Anthropic claude
8
13
  # MODEL="anthropic:claude-3-7-sonnet-latest"
9
- # ANTHROPIC_API_KEY="" # Your Anthropic API key
14
+ # ANTHROPIC_API_KEY=""
10
15
 
11
- # Use this for AWS Bedrock models
16
+ # Gemini
17
+ # MODEL="gemini:gemini-2.0-flash"
18
+ # GEMINI_API_KEY=""
19
+
20
+ # Bedrock nova
21
+ # MODEL=bedrock:us.amazon.nova-premier-v1:0
12
22
  # AWS_ACCESS_KEY_ID=""
13
23
  # AWS_SECRET_ACCESS_KEY=""
14
24
  # AWS_REGION=us-west-2
15
- # MODEL=Bedrock:us.amazon.nova-premier-v1:0
25
+
26
+ # DeepSeek
27
+ # MODEL="deepseek:deepseek-chat"
28
+ # DEEPSEEK_API_KEY=""
29
+
30
+ # OpenRouter
31
+ # MODEL="openrouter:openai/gpt-4o"
32
+ # OPEN_ROUTER_API_KEY=""
33
+
34
+ # xAI
35
+ # MODEL="xai:grok-2-latest"
36
+ # XAI_API_KEY=""
37
+
38
+ # Ollama
39
+ # MODEL="ollama:llama3.2"
40
+ # OLLAMA_DEFAULT_BASE_URL="http://localhost:11434/v1";
41
+
16
42
 
17
43
  # Setup proxy if needed
18
44
  # HTTPS_PROXY=http://localhost:7890
package/CHANGELOG.md ADDED
@@ -0,0 +1,395 @@
1
+ # Changelog
2
+
3
+ ## [1.13.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.12.0...example-chat-bot-v1.13.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/cli bumped to 1.18.0
16
+
17
+ ## [1.12.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.11.0...example-chat-bot-v1.12.0) (2025-07-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * **cli:** support HTTPS_PROXY and named path param ([#196](https://github.com/AIGNE-io/aigne-framework/issues/196)) ([04e684e](https://github.com/AIGNE-io/aigne-framework/commit/04e684ee26bc2d79924b0e3cb541cd07a7191804))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @aigne/cli bumped to 1.17.0
30
+ * devDependencies
31
+ * @aigne/test-utils bumped to 0.4.11
32
+
33
+ ## [1.11.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.5...example-chat-bot-v1.11.0) (2025-06-30)
34
+
35
+
36
+ ### Features
37
+
38
+ * **ux:** polish tracing ux and update docs ([#193](https://github.com/AIGNE-io/aigne-framework/issues/193)) ([f80b63e](https://github.com/AIGNE-io/aigne-framework/commit/f80b63ecb1cfb00daa9b68330026da839d33f8a2))
39
+
40
+
41
+ ### Dependencies
42
+
43
+ * The following workspace dependencies were updated
44
+ * dependencies
45
+ * @aigne/cli bumped to 1.16.0
46
+ * devDependencies
47
+ * @aigne/test-utils bumped to 0.4.10
48
+
49
+ ## [1.10.5](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.4...example-chat-bot-v1.10.5) (2025-06-29)
50
+
51
+
52
+ ### Dependencies
53
+
54
+ * The following workspace dependencies were updated
55
+ * dependencies
56
+ * @aigne/cli bumped to 1.15.0
57
+ * devDependencies
58
+ * @aigne/test-utils bumped to 0.4.9
59
+
60
+ ## [1.10.4](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.3...example-chat-bot-v1.10.4) (2025-06-26)
61
+
62
+
63
+ ### Dependencies
64
+
65
+ * The following workspace dependencies were updated
66
+ * dependencies
67
+ * @aigne/cli bumped to 1.14.1
68
+ * devDependencies
69
+ * @aigne/test-utils bumped to 0.4.8
70
+
71
+ ## [1.10.3](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.2...example-chat-bot-v1.10.3) (2025-06-26)
72
+
73
+
74
+ ### Dependencies
75
+
76
+ * The following workspace dependencies were updated
77
+ * dependencies
78
+ * @aigne/cli bumped to 1.14.0
79
+ * devDependencies
80
+ * @aigne/test-utils bumped to 0.4.7
81
+
82
+ ## [1.10.2](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.1...example-chat-bot-v1.10.2) (2025-06-25)
83
+
84
+
85
+ ### Dependencies
86
+
87
+ * The following workspace dependencies were updated
88
+ * dependencies
89
+ * @aigne/cli bumped to 1.13.2
90
+ * devDependencies
91
+ * @aigne/test-utils bumped to 0.4.6
92
+
93
+ ## [1.10.1](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.10.0...example-chat-bot-v1.10.1) (2025-06-25)
94
+
95
+
96
+ ### Dependencies
97
+
98
+ * The following workspace dependencies were updated
99
+ * dependencies
100
+ * @aigne/cli bumped to 1.13.1
101
+ * devDependencies
102
+ * @aigne/test-utils bumped to 0.4.5
103
+
104
+ ## [1.10.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.12...example-chat-bot-v1.10.0) (2025-06-24)
105
+
106
+
107
+ ### Features
108
+
109
+ * support observability for cli and blocklet ([#155](https://github.com/AIGNE-io/aigne-framework/issues/155)) ([5baa705](https://github.com/AIGNE-io/aigne-framework/commit/5baa705a33cfdba1efc5ccbe18674c27513ca97d))
110
+
111
+
112
+ ### Dependencies
113
+
114
+ * The following workspace dependencies were updated
115
+ * dependencies
116
+ * @aigne/cli bumped to 1.13.0
117
+ * devDependencies
118
+ * @aigne/test-utils bumped to 0.4.4
119
+
120
+ ## [1.9.12](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.11...example-chat-bot-v1.9.12) (2025-06-20)
121
+
122
+
123
+ ### Dependencies
124
+
125
+ * The following workspace dependencies were updated
126
+ * dependencies
127
+ * @aigne/cli bumped to 1.12.0
128
+ * devDependencies
129
+ * @aigne/test-utils bumped to 0.4.3
130
+
131
+ ## [1.9.11](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.10...example-chat-bot-v1.9.11) (2025-06-19)
132
+
133
+
134
+ ### Dependencies
135
+
136
+ * The following workspace dependencies were updated
137
+ * dependencies
138
+ * @aigne/cli bumped to 1.11.9
139
+ * devDependencies
140
+ * @aigne/test-utils bumped to 0.4.2
141
+
142
+ ## [1.9.10](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.9...example-chat-bot-v1.9.10) (2025-06-17)
143
+
144
+
145
+ ### Dependencies
146
+
147
+ * The following workspace dependencies were updated
148
+ * dependencies
149
+ * @aigne/cli bumped to 1.11.8
150
+ * devDependencies
151
+ * @aigne/test-utils bumped to 0.4.1
152
+
153
+ ## [1.9.9](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.8...example-chat-bot-v1.9.9) (2025-06-16)
154
+
155
+
156
+ ### Dependencies
157
+
158
+ * The following workspace dependencies were updated
159
+ * dependencies
160
+ * @aigne/cli bumped to 1.11.7
161
+ * devDependencies
162
+ * @aigne/test-utils bumped to 0.4.0
163
+
164
+ ## [1.9.8](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.7...example-chat-bot-v1.9.8) (2025-06-11)
165
+
166
+
167
+ ### Dependencies
168
+
169
+ * The following workspace dependencies were updated
170
+ * dependencies
171
+ * @aigne/cli bumped to 1.11.6
172
+ * devDependencies
173
+ * @aigne/test-utils bumped to 0.3.8
174
+
175
+ ## [1.9.7](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.6...example-chat-bot-v1.9.7) (2025-06-06)
176
+
177
+
178
+ ### Dependencies
179
+
180
+ * The following workspace dependencies were updated
181
+ * dependencies
182
+ * @aigne/cli bumped to 1.11.5
183
+ * devDependencies
184
+ * @aigne/test-utils bumped to 0.3.7
185
+
186
+ ## [1.9.6](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.5...example-chat-bot-v1.9.6) (2025-06-05)
187
+
188
+
189
+ ### Dependencies
190
+
191
+ * The following workspace dependencies were updated
192
+ * dependencies
193
+ * @aigne/cli bumped to 1.11.4
194
+ * devDependencies
195
+ * @aigne/test-utils bumped to 0.3.6
196
+
197
+ ## [1.9.5](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.4...example-chat-bot-v1.9.5) (2025-06-05)
198
+
199
+
200
+ ### Dependencies
201
+
202
+ * The following workspace dependencies were updated
203
+ * dependencies
204
+ * @aigne/cli bumped to 1.11.3
205
+ * devDependencies
206
+ * @aigne/test-utils bumped to 0.3.5
207
+
208
+ ## [1.9.4](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.3...example-chat-bot-v1.9.4) (2025-05-30)
209
+
210
+
211
+ ### Dependencies
212
+
213
+ * The following workspace dependencies were updated
214
+ * dependencies
215
+ * @aigne/cli bumped to 1.11.2
216
+ * devDependencies
217
+ * @aigne/test-utils bumped to 0.3.4
218
+
219
+ ## [1.9.3](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.2...example-chat-bot-v1.9.3) (2025-05-30)
220
+
221
+
222
+ ### Dependencies
223
+
224
+ * The following workspace dependencies were updated
225
+ * dependencies
226
+ * @aigne/cli bumped to 1.11.1
227
+ * devDependencies
228
+ * @aigne/test-utils bumped to 0.3.3
229
+
230
+ ## [1.9.2](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.1...example-chat-bot-v1.9.2) (2025-05-29)
231
+
232
+
233
+ ### Dependencies
234
+
235
+ * The following workspace dependencies were updated
236
+ * dependencies
237
+ * @aigne/cli bumped to 1.11.0
238
+ * devDependencies
239
+ * @aigne/test-utils bumped to 0.3.2
240
+
241
+ ## [1.9.1](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.9.0...example-chat-bot-v1.9.1) (2025-05-25)
242
+
243
+
244
+ ### Dependencies
245
+
246
+ * The following workspace dependencies were updated
247
+ * dependencies
248
+ * @aigne/cli bumped to 1.10.1
249
+ * devDependencies
250
+ * @aigne/test-utils bumped to 0.3.1
251
+
252
+ ## [1.9.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.8.1...example-chat-bot-v1.9.0) (2025-05-23)
253
+
254
+
255
+ ### Features
256
+
257
+ * add `--chat` option for `run` command ([#120](https://github.com/AIGNE-io/aigne-framework/issues/120)) ([7699550](https://github.com/AIGNE-io/aigne-framework/commit/76995507001ca33b09b29f72ff588dae513cb340))
258
+ * **models:** publish model adapters as standalone packages ([#126](https://github.com/AIGNE-io/aigne-framework/issues/126)) ([588b8ae](https://github.com/AIGNE-io/aigne-framework/commit/588b8aea6abcee5fa87def1358bf51f84021c6ef))
259
+
260
+
261
+ ### Dependencies
262
+
263
+ * The following workspace dependencies were updated
264
+ * dependencies
265
+ * @aigne/cli bumped to 1.10.0
266
+ * devDependencies
267
+ * @aigne/test-utils bumped to 0.3.0
268
+
269
+ ## [1.8.1](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.8.0...example-chat-bot-v1.8.1) (2025-05-15)
270
+
271
+
272
+ ### Dependencies
273
+
274
+ * The following workspace dependencies were updated
275
+ * dependencies
276
+ * @aigne/cli bumped to 1.9.1
277
+
278
+ ## [1.8.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.7.0...example-chat-bot-v1.8.0) (2025-05-12)
279
+
280
+
281
+ ### Features
282
+
283
+ * optimize the stability of ci and example ([#113](https://github.com/AIGNE-io/aigne-framework/issues/113)) ([d16ed6c](https://github.com/AIGNE-io/aigne-framework/commit/d16ed6cb60faea19fb4f1c12e1f83d69563b153f))
284
+
285
+
286
+ ### Dependencies
287
+
288
+ * The following workspace dependencies were updated
289
+ * dependencies
290
+ * @aigne/cli bumped to 1.9.0
291
+ * devDependencies
292
+ * @aigne/test-utils bumped to 0.2.0
293
+
294
+ ## [1.7.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.6.0...example-chat-bot-v1.7.0) (2025-04-30)
295
+
296
+
297
+ ### Features
298
+
299
+ * **core:** add BedrockChatModel support ([#101](https://github.com/AIGNE-io/aigne-framework/issues/101)) ([a0b98f0](https://github.com/AIGNE-io/aigne-framework/commit/a0b98f01bd78a135232226548848fa35a64982d1))
300
+
301
+
302
+ ### Dependencies
303
+
304
+ * The following workspace dependencies were updated
305
+ * dependencies
306
+ * @aigne/cli bumped to 1.8.1
307
+
308
+ ## [1.6.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.5.0...example-chat-bot-v1.6.0) (2025-04-27)
309
+
310
+
311
+ ### Features
312
+
313
+ * support TeamAgent and finalize API naming ([#91](https://github.com/AIGNE-io/aigne-framework/issues/91)) ([033d1b6](https://github.com/AIGNE-io/aigne-framework/commit/033d1b6a7dc5460807476abb35a413ba89a2a664))
314
+ * **tests:** add @aigne/test-utils and update example test cases ([#95](https://github.com/AIGNE-io/aigne-framework/issues/95)) ([6be48d1](https://github.com/AIGNE-io/aigne-framework/commit/6be48d1895e990f68c4978018da1a53bb58c1c6d))
315
+
316
+
317
+ ### Bug Fixes
318
+
319
+ * upgrade to streamable api for serve mcp command ([#98](https://github.com/AIGNE-io/aigne-framework/issues/98)) ([ae32bda](https://github.com/AIGNE-io/aigne-framework/commit/ae32bda20e57c2a2eb8b49fad034b0b2a5ebb15e))
320
+
321
+
322
+ ### Dependencies
323
+
324
+ * The following workspace dependencies were updated
325
+ * dependencies
326
+ * @aigne/cli bumped to 1.8.0
327
+ * devDependencies
328
+ * @aigne/test-utils bumped to 0.1.0
329
+
330
+ ## [1.5.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.4.2...example-chat-bot-v1.5.0) (2025-04-23)
331
+
332
+
333
+ ### Features
334
+
335
+ * **tests:** add example tests and update the ci configuration ([#81](https://github.com/AIGNE-io/aigne-framework/issues/81)) ([777bb8d](https://github.com/AIGNE-io/aigne-framework/commit/777bb8d184c21e74b3eb9bbb4a1003708409a338))
336
+
337
+
338
+ ### Dependencies
339
+
340
+ * The following workspace dependencies were updated
341
+ * dependencies
342
+ * @aigne/cli bumped to 1.7.0
343
+
344
+ ## [1.4.2](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.4.1...example-chat-bot-v1.4.2) (2025-04-22)
345
+
346
+
347
+ ### Dependencies
348
+
349
+ * The following workspace dependencies were updated
350
+ * dependencies
351
+ * @aigne/cli bumped to 1.6.0
352
+
353
+ ## [1.4.1](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.4.0...example-chat-bot-v1.4.1) (2025-04-22)
354
+
355
+
356
+ ### Bug Fixes
357
+
358
+ * use bunwrapper launch examples ([#79](https://github.com/AIGNE-io/aigne-framework/issues/79)) ([55022e2](https://github.com/AIGNE-io/aigne-framework/commit/55022e20bb253bac608dad3024600da91e093a69))
359
+
360
+
361
+ ### Dependencies
362
+
363
+ * The following workspace dependencies were updated
364
+ * dependencies
365
+ * @aigne/cli bumped to 1.5.1
366
+
367
+ ## [1.4.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.3.1...example-chat-bot-v1.4.0) (2025-04-22)
368
+
369
+
370
+ ### Features
371
+
372
+ * add agent library support ([#51](https://github.com/AIGNE-io/aigne-framework/issues/51)) ([1f0d34d](https://github.com/AIGNE-io/aigne-framework/commit/1f0d34ddda3154283a4bc958ddb9b68b4ac106b0))
373
+ * **ci:** support coverage examples with model matrix ([#59](https://github.com/AIGNE-io/aigne-framework/issues/59)) ([1edd704](https://github.com/AIGNE-io/aigne-framework/commit/1edd70426b80a69e3751b2d5fe818297711d0777))
374
+ * **core:** add model adapters for DeepSeek, Gemini, OpenRouter, and Ollama ([#53](https://github.com/AIGNE-io/aigne-framework/issues/53)) ([5d40546](https://github.com/AIGNE-io/aigne-framework/commit/5d40546bd5ddb70233d27ea3b20e5711b2af320a))
375
+
376
+ ## [1.3.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.2.0...example-chat-bot-v1.3.0) (2025-04-20)
377
+
378
+
379
+ ### Features
380
+
381
+ * **core:** add model adapters for DeepSeek, Gemini, OpenRouter, and Ollama ([#53](https://github.com/AIGNE-io/aigne-framework/issues/53)) ([5d40546](https://github.com/AIGNE-io/aigne-framework/commit/5d40546bd5ddb70233d27ea3b20e5711b2af320a))
382
+
383
+ ## [1.2.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.1.0...example-chat-bot-v1.2.0) (2025-04-17)
384
+
385
+
386
+ ### Features
387
+
388
+ * **ci:** support coverage examples with model matrix ([#59](https://github.com/AIGNE-io/aigne-framework/issues/59)) ([1edd704](https://github.com/AIGNE-io/aigne-framework/commit/1edd70426b80a69e3751b2d5fe818297711d0777))
389
+
390
+ ## [1.1.0](https://github.com/AIGNE-io/aigne-framework/compare/example-chat-bot-v1.0.0...example-chat-bot-v1.1.0) (2025-04-08)
391
+
392
+
393
+ ### Features
394
+
395
+ * add agent library support ([#51](https://github.com/AIGNE-io/aigne-framework/issues/51)) ([1f0d34d](https://github.com/AIGNE-io/aigne-framework/commit/1f0d34ddda3154283a4bc958ddb9b68b4ac106b0))
package/README.md CHANGED
@@ -4,11 +4,8 @@ This example demonstrates how to create and run an agent-based chatbot using the
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - [Node.js](https://nodejs.org) and npm installed on your machine
8
- - An [OpenAI API key](https://platform.openai.com/api-keys) for interacting with OpenAI's services
9
- - Optional dependencies (if running the example from source code):
10
- - [Pnpm](https://pnpm.io) for package management
11
- - [Bun](https://bun.sh) for running unit tests & examples
7
+ * [Node.js](https://nodejs.org) and npm installed on your machine
8
+ * An [OpenAI API key](https://platform.openai.com/api-keys) for interacting with OpenAI's services
12
9
 
13
10
  ## Quick Start (No Installation Required)
14
11
 
@@ -27,38 +24,53 @@ echo "Tell me about AIGNE Framework" | npx -y @aigne/example-chat-bot
27
24
 
28
25
  ## Installation
29
26
 
30
- ### Clone the Repository
27
+ ### Install AIGNE CLI
31
28
 
32
29
  ```bash
33
- git clone https://github.com/AIGNE-io/aigne-framework
30
+ npm install -g @aigne/cli
34
31
  ```
35
32
 
36
- ### Install Dependencies
33
+ ### Clone the Repository
37
34
 
38
35
  ```bash
39
- cd aigne-framework/examples/chat-bot
36
+ git clone https://github.com/AIGNE-io/aigne-framework
40
37
 
41
- pnpm install
38
+ cd aigne-framework/examples/chat-bot
42
39
  ```
43
40
 
44
41
  ### Setup Environment Variables
45
42
 
46
- Setup your OpenAI API key in the `.env.local` file:
43
+ Setup your OpenAI API key in the `.env.local` file (you can rename `.env.local.example` to `.env.local`):
47
44
 
48
45
  ```bash
49
46
  OPENAI_API_KEY="" # Set your OpenAI API key here
50
47
  ```
51
48
 
49
+ #### Using Different Models
50
+
51
+ You can use different AI models by setting the `MODEL` environment variable along with the corresponding API key. The framework supports multiple providers:
52
+
53
+ * **OpenAI**: `MODEL="openai:gpt-4.1"` with `OPENAI_API_KEY`
54
+ * **Anthropic**: `MODEL="anthropic:claude-3-7-sonnet-latest"` with `ANTHROPIC_API_KEY`
55
+ * **Google Gemini**: `MODEL="gemini:gemini-2.0-flash"` with `GEMINI_API_KEY`
56
+ * **AWS Bedrock**: `MODEL="bedrock:us.amazon.nova-premier-v1:0"` with AWS credentials
57
+ * **DeepSeek**: `MODEL="deepseek:deepseek-chat"` with `DEEPSEEK_API_KEY`
58
+ * **OpenRouter**: `MODEL="openrouter:openai/gpt-4o"` with `OPEN_ROUTER_API_KEY`
59
+ * **xAI**: `MODEL="xai:grok-2-latest"` with `XAI_API_KEY`
60
+ * **Ollama**: `MODEL="ollama:llama3.2"` with `OLLAMA_DEFAULT_BASE_URL`
61
+
62
+ For detailed configuration examples, please refer to the `.env.local.example` file in this directory.
63
+
52
64
  ### Run the Example
53
65
 
54
66
  ```bash
55
- pnpm start # Run in one-shot mode (default)
67
+ aigne run # Run in one-shot mode (default)
56
68
 
57
69
  # Run in interactive chat mode
58
- pnpm start -- --chat
70
+ aigne run --chat
59
71
 
60
72
  # Use pipeline input
61
- echo "Tell me about AIGNE Framework" | pnpm start
73
+ echo "Tell me about AIGNE Framework" | aigne run
62
74
  ```
63
75
 
64
76
  ### Run Options
@@ -68,23 +80,10 @@ The example supports the following command-line parameters:
68
80
  | Parameter | Description | Default |
69
81
  |-----------|-------------|---------|
70
82
  | `--chat` | Run in interactive chat mode | Disabled (one-shot mode) |
71
- | `--model <provider[:model]>` | AI model to use in format 'provider[:model]' where model is optional. Examples: 'openai' or 'openai:gpt-4o-mini' | openai |
83
+ | `--model <provider[:model]>` | AI model to use in format 'provider\[:model]' where model is optional. Examples: 'openai' or 'openai:gpt-4o-mini' | openai |
72
84
  | `--temperature <value>` | Temperature for model generation | Provider default |
73
85
  | `--top-p <value>` | Top-p sampling value | Provider default |
74
86
  | `--presence-penalty <value>` | Presence penalty value | Provider default |
75
87
  | `--frequency-penalty <value>` | Frequency penalty value | Provider default |
76
88
  | `--log-level <level>` | Set logging level (ERROR, WARN, INFO, DEBUG, TRACE) | INFO |
77
89
  | `--input`, `-i <input>` | Specify input directly | None |
78
-
79
- #### Examples
80
-
81
- ```bash
82
- # Run in chat mode (interactive)
83
- pnpm start -- --chat
84
-
85
- # Set logging level
86
- pnpm start -- --log-level DEBUG
87
-
88
- # Use pipeline input
89
- echo "Tell me about AIGNE Framework" | pnpm start
90
- ```
@@ -0,0 +1,8 @@
1
+ name: chat
2
+ description: Chat agent
3
+ instructions: |
4
+ You are a helpful assistant that can answer questions and provide information on a wide range of topics.
5
+ input_key: message
6
+ memory: true
7
+ skills:
8
+ - sandbox.js
@@ -0,0 +1,35 @@
1
+ import vm from "node:vm";
2
+
3
+ export default async function evaluateJs({ jsCode }) {
4
+ const sandbox = {};
5
+ const context = vm.createContext(sandbox);
6
+ const result = vm.runInContext(jsCode, context, { displayErrors: true });
7
+ return { result };
8
+ }
9
+
10
+ evaluateJs.description = `
11
+ This agent generates a JavaScript code snippet that is suitable to be passed directly into Node.js's 'vm.runInContext(code, context)' function. Follow these constraints:
12
+ - Do NOT use any top-level 'return' statements, as the code is not inside a function.
13
+ - The code can define variables or perform calculations.
14
+ - To return a value from the code, make sure the final line is an expression (not a statement) whose value will be the result.
15
+ - Do NOT wrap the code in a function or IIFE unless explicitly instructed.
16
+ - The code should be self-contained and valid JavaScript.`;
17
+
18
+ evaluateJs.input_schema = {
19
+ type: "object",
20
+ properties: {
21
+ jsCode: {
22
+ type: "string",
23
+ description: "JavaScript code snippet to evaluate",
24
+ },
25
+ },
26
+ required: ["jsCode"],
27
+ };
28
+
29
+ evaluateJs.output_schema = {
30
+ type: "object",
31
+ properties: {
32
+ result: { type: "any", description: "Result of the evaluated code" },
33
+ },
34
+ required: ["result"],
35
+ };
@@ -0,0 +1,7 @@
1
+ import assert from "node:assert";
2
+ import test from "node:test";
3
+ import evaluateJs from "./sandbox.js";
4
+
5
+ test("evaluateJs should execute script correctly", async () => {
6
+ assert.deepEqual(await evaluateJs({ jsCode: "1 + 2" }), { result: 3 });
7
+ });
package/aigne.yaml ADDED
@@ -0,0 +1,5 @@
1
+ chat_model:
2
+ name: gpt-4o-mini
3
+ temperature: 0.8
4
+ agents:
5
+ - agents/chat.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/example-chat-bot",
3
- "version": "1.12.1-3",
3
+ "version": "1.13.0",
4
4
  "description": "A demonstration of using AIGNE Framework to build a chat bot",
5
5
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
6
6
  "homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/chat-bot",
@@ -11,16 +11,11 @@
11
11
  },
12
12
  "type": "module",
13
13
  "bin": "index.js",
14
- "files": [
15
- "agents",
16
- ".env.local.example",
17
- "*.ts",
18
- "README.md"
19
- ],
20
14
  "dependencies": {
21
- "@aigne/cli": "^1.17.0"
15
+ "@aigne/cli": "^1.18.0"
22
16
  },
23
17
  "scripts": {
24
- "test": "aigne test"
18
+ "test": "aigne test",
19
+ "test:llm": "aigne run"
25
20
  }
26
21
  }