@cloudbase/agent-examples-langgraph-agentic-chat 0.0.2

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 ADDED
@@ -0,0 +1,545 @@
1
+ # @cloudbase/agent-examples-langgraph-agentic-chat
2
+
3
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - stable release 0.0.10
8
+ - Update all public packages to version 0.0.10
9
+ - Trigger automated stable release workflow
10
+ - Includes latest features and improvements
11
+
12
+ - Updated dependencies
13
+ - @cloudbase/agent-agents@0.0.10
14
+ - @cloudbase/agent-adapter-langgraph@0.0.10
15
+
16
+ ## 0.0.10-alpha.1
17
+
18
+ ### Patch Changes
19
+
20
+ - alpha release 0.0.9-alpha.3
21
+ - Update all public packages to version 0.0.9-alpha.3
22
+ - Trigger automated alpha release workflow
23
+ - Includes latest features and improvements
24
+
25
+ - Updated dependencies
26
+ - @cloudbase/agent-agents@0.0.10-alpha.1
27
+ - @cloudbase/agent-adapter-langgraph@0.0.10-alpha.1
28
+
29
+ ## 0.0.10-alpha.0
30
+
31
+ ### Patch Changes
32
+
33
+ - alpha release 0.0.9-alpha.3
34
+ - Update all public packages to version 0.0.9-alpha.3
35
+ - Trigger automated alpha release workflow
36
+ - Includes latest features and improvements
37
+
38
+ - Updated dependencies
39
+ - @cloudbase/agent-agents@0.0.10-alpha.0
40
+ - @cloudbase/agent-adapter-langgraph@0.0.10-alpha.0
41
+
42
+ ## 0.0.9
43
+
44
+ ### Patch Changes
45
+
46
+ - stable release 0.0.9
47
+ - Update all public packages to version 0.0.9
48
+ - Trigger automated stable release workflow
49
+ - Includes latest features and improvements
50
+
51
+ - Updated dependencies
52
+ - @cloudbase/agent-agents@0.0.9
53
+
54
+ ## 0.0.9-alpha.2
55
+
56
+ ### Patch Changes
57
+
58
+ - alpha release 0.0.8-alpha.1
59
+ - Update all public packages to version 0.0.8-alpha.1
60
+ - Trigger automated alpha release workflow
61
+ - Includes latest features and improvements
62
+
63
+ - Updated dependencies
64
+ - @cloudbase/agent-agents@0.0.9-alpha.2
65
+
66
+ ## 0.0.9-alpha.1
67
+
68
+ ### Patch Changes
69
+
70
+ - alpha release 0.0.8-alpha.1
71
+ - Update all public packages to version 0.0.8-alpha.1
72
+ - Trigger automated alpha release workflow
73
+ - Includes latest features and improvements
74
+
75
+ - Updated dependencies
76
+ - @cloudbase/agent-agents@0.0.9-alpha.1
77
+
78
+ ## 0.0.9-alpha.0
79
+
80
+ ### Patch Changes
81
+
82
+ - alpha release 0.0.8-alpha.1
83
+ - Update all public packages to version 0.0.8-alpha.1
84
+ - Trigger automated alpha release workflow
85
+ - Includes latest features and improvements
86
+
87
+ - Updated dependencies
88
+ - @cloudbase/agent-agents@0.0.9-alpha.0
89
+
90
+ ## 0.0.8
91
+
92
+ ### Patch Changes
93
+
94
+ - stable release 0.0.8
95
+ - Update all public packages to version 0.0.8
96
+ - Trigger automated stable release workflow
97
+ - Includes latest features and improvements
98
+
99
+ - Updated dependencies
100
+ - @cloudbase/agent-agents@0.0.8
101
+
102
+ ## 0.0.4-alpha.0
103
+
104
+ ### Patch Changes
105
+
106
+ - alpha release 0.0.7-alpha.1
107
+ - Update all public packages to version 0.0.7-alpha.1
108
+ - Trigger automated alpha release workflow
109
+ - Includes latest features and improvements
110
+
111
+ - Updated dependencies
112
+ - @cloudbase/agent-agents@0.0.4-alpha.0
113
+
114
+ ## 0.0.0-alpha-20251103123845
115
+
116
+ ### Patch Changes
117
+
118
+ - alpha release 0.0.7-alpha.1
119
+ - Update all public packages to version 0.0.7-alpha.1
120
+ - Trigger automated alpha release workflow
121
+ - Includes latest features and improvements
122
+
123
+ - Updated dependencies
124
+ - @cloudbase/agent-agents@0.0.0-alpha-20251103123845
125
+
126
+ ## 0.0.5
127
+
128
+ ### Patch Changes
129
+
130
+ - stable release 0.0.7
131
+ - Update all public packages to version 0.0.7
132
+ - Trigger automated stable release workflow
133
+ - Includes latest features and improvements
134
+
135
+ - Updated dependencies
136
+ - @cloudbase/agent-agents@0.0.5
137
+
138
+ ## 0.0.4
139
+
140
+ ### Patch Changes
141
+
142
+ - stable release 0.0.6
143
+ - Update all public packages to version 0.0.6
144
+ - Trigger automated stable release workflow
145
+ - Includes latest features and improvements
146
+
147
+ - Updated dependencies
148
+ - @cloudbase/agent-agents@0.0.4
149
+
150
+ ## 0.0.0-alpha-20251030080320
151
+
152
+ ### Patch Changes
153
+
154
+ - alpha release 0.0.5-alpha.7
155
+ - Update all public packages to version 0.0.5-alpha.7
156
+ - Trigger automated alpha release workflow
157
+ - Includes latest features and improvements
158
+
159
+ - Updated dependencies
160
+ - @cloudbase/agent-agents@0.0.0-alpha-20251030080320
161
+
162
+ ## 0.0.0-alpha-20251028115618
163
+
164
+ ### Patch Changes
165
+
166
+ - alpha release 0.0.5-alpha.6
167
+ - Update all public packages to version 0.0.5-alpha.6
168
+ - Trigger automated alpha release workflow
169
+ - Includes latest features and improvements
170
+
171
+ - Updated dependencies
172
+ - @cloudbase/agent-agents@0.0.0-alpha-20251028115618
173
+
174
+ ## 0.0.0-alpha-20251028114708
175
+
176
+ ### Patch Changes
177
+
178
+ - alpha release 0.0.5-alpha.5
179
+ - Update all public packages to version 0.0.5-alpha.5
180
+ - Trigger automated alpha release workflow
181
+ - Includes latest features and improvements
182
+
183
+ - Updated dependencies
184
+ - @cloudbase/agent-agents@0.0.0-alpha-20251028114708
185
+
186
+ ## 0.0.0-alpha-20251027092338
187
+
188
+ ### Patch Changes
189
+
190
+ - alpha release 0.0.5-alpha.4
191
+ - Update all public packages to version 0.0.5-alpha.4
192
+ - Trigger automated alpha release workflow
193
+ - Includes latest features and improvements
194
+
195
+ - Updated dependencies
196
+ - @cloudbase/agent-agents@0.0.0-alpha-20251027092338
197
+
198
+ ## 0.0.0-alpha-20251027092045
199
+
200
+ ### Patch Changes
201
+
202
+ - alpha release 0.0.5-alpha.3
203
+ - Update all public packages to version 0.0.5-alpha.3
204
+ - Trigger automated alpha release workflow
205
+ - Includes latest features and improvements
206
+
207
+ - Updated dependencies
208
+ - @cloudbase/agent-agents@0.0.0-alpha-20251027092045
209
+
210
+ ## 0.0.0-alpha-20251024113345
211
+
212
+ ### Patch Changes
213
+
214
+ - alpha release 0.0.5-alpha.2
215
+ - Update all public packages to version 0.0.5-alpha.2
216
+ - Trigger automated alpha release workflow
217
+ - Includes latest features and improvements
218
+
219
+ - Updated dependencies
220
+ - @cloudbase/agent-agents@0.0.0-alpha-20251024113345
221
+
222
+ ## 0.0.0-alpha-20251024090137
223
+
224
+ ### Patch Changes
225
+
226
+ - alpha release 0.0.5-alpha.1
227
+ - Update all public packages to version 0.0.5-alpha.1
228
+ - Trigger automated alpha release workflow
229
+ - Includes latest features and improvements
230
+
231
+ - Updated dependencies
232
+ - @cloudbase/agent-agents@0.0.0-alpha-20251024090137
233
+
234
+ ## 0.0.0-alpha-20251024085927
235
+
236
+ ### Patch Changes
237
+
238
+ - alpha release 0.0.1-alpha.18
239
+ - Update all public packages to version 0.0.1-alpha.18
240
+ - Trigger automated alpha release workflow
241
+ - Includes latest features and improvements
242
+
243
+ - Updated dependencies
244
+ - @cloudbase/agent-agents@0.0.0-alpha-20251024085927
245
+
246
+ ## 0.0.0-alpha-20251023135253
247
+
248
+ ### Patch Changes
249
+
250
+ - Alpha release with latest features and improvements
251
+ - Update all public packages to alpha version
252
+ - Include playground preview enhancements
253
+ - Add Python Server deployment support
254
+ - Include Mastra framework examples
255
+ - Trigger automated alpha release workflow
256
+
257
+ - Updated dependencies
258
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023135253
259
+
260
+ ## 0.0.0-alpha-20251023135056
261
+
262
+ ### Patch Changes
263
+
264
+ - Alpha release with latest features and improvements
265
+ - Update all public packages to alpha version
266
+ - Include playground preview enhancements
267
+ - Add Python Server deployment support
268
+ - Trigger automated alpha release workflow
269
+
270
+ - 579f801: Stable release with latest features and improvements
271
+ - Update all public packages to stable version
272
+ - Include playground preview enhancements
273
+ - Add new playground examples
274
+ - Trigger automated stable release workflow
275
+
276
+ - Updated dependencies
277
+ - Updated dependencies [579f801]
278
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023135056
279
+
280
+ ## 0.0.4
281
+
282
+ ### Patch Changes
283
+
284
+ - Stable release with latest features and improvements
285
+ - Update all public packages to stable version
286
+ - Include playground preview enhancements
287
+ - Add new playground examples
288
+ - Trigger automated stable release workflow
289
+
290
+ - Updated dependencies
291
+ - @cloudbase/agent-agents@0.0.4
292
+
293
+ ## 0.0.0-alpha-20251023125455
294
+
295
+ ### Patch Changes
296
+
297
+ - Alpha release with latest features and improvements
298
+ - Update all public packages to alpha version
299
+ - Include playground preview enhancements
300
+ - Add new playground examples
301
+ - Trigger automated alpha release workflow
302
+
303
+ - Updated dependencies
304
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023125455
305
+
306
+ ## 0.0.0-alpha-20251023125311
307
+
308
+ ### Patch Changes
309
+
310
+ - Alpha release with latest features and improvements
311
+ - Update all public packages to alpha version
312
+ - Include playground preview enhancements
313
+ - Add new playground examples (LlamaIndex, Mastra)
314
+ - Fix workspace configuration for new packages
315
+ - Trigger automated alpha release workflow
316
+
317
+ - Updated dependencies
318
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023125311
319
+
320
+ ## 0.0.4
321
+
322
+ ### Patch Changes
323
+
324
+ - @cloudbase/agent-agents@0.0.4
325
+
326
+ ## 0.0.2
327
+
328
+ ### Patch Changes
329
+
330
+ - stable release 0.0.3
331
+ - Update all public packages to version 0.0.3
332
+ - Trigger automated stable release workflow
333
+ - Includes latest features and improvements
334
+
335
+ - Updated dependencies
336
+ - @cloudbase/agent-agents@0.0.2
337
+
338
+ ## 0.0.0-alpha-20251023094104
339
+
340
+ ### Patch Changes
341
+
342
+ - alpha release 0.0.1-alpha.14
343
+ - Update all public packages to version 0.0.1-alpha.14
344
+ - Trigger automated alpha release workflow
345
+ - Includes latest features and improvements
346
+
347
+ - Updated dependencies
348
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023094104
349
+
350
+ ## 0.0.0-alpha-20251023093942
351
+
352
+ ### Patch Changes
353
+
354
+ - alpha release 0.0.1-alpha.13
355
+ - Update all public packages to version 0.0.1-alpha.13
356
+ - Trigger automated alpha release workflow
357
+ - Includes latest features and improvements
358
+
359
+ - Updated dependencies
360
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023093942
361
+
362
+ ## 0.0.2
363
+
364
+ ### Patch Changes
365
+
366
+ - stable release 0.0.2
367
+ - Update all public packages to version 0.0.2
368
+ - Trigger automated stable release workflow
369
+ - Includes latest features and improvements
370
+
371
+ - Updated dependencies
372
+ - @cloudbase/agent-agents@0.0.2
373
+
374
+ ## 0.0.0-alpha-20251023054807
375
+
376
+ ### Patch Changes
377
+
378
+ - alpha release 0.0.1-alpha.12
379
+ - Update all public packages to version 0.0.1-alpha.12
380
+ - Trigger automated alpha release workflow
381
+ - Includes latest features and improvements
382
+
383
+ - Updated dependencies
384
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023054807
385
+
386
+ ## 0.0.0-alpha-20251023054737
387
+
388
+ ### Patch Changes
389
+
390
+ - Alpha release with latest features and improvements including MCP knowledge retrieval examples and configuration validation fixes.
391
+ - Updated dependencies
392
+ - @cloudbase/agent-agents@0.0.0-alpha-20251023054737
393
+
394
+ ## 0.0.2
395
+
396
+ ### Patch Changes
397
+
398
+ - stable release 0.0.1
399
+ - Update all public packages to version 0.0.1
400
+ - Trigger automated stable release workflow
401
+ - Includes latest features and improvements
402
+
403
+ - Updated dependencies
404
+ - @cloudbase/agent-agents@0.0.2
405
+
406
+ ## 0.0.0-alpha-20251022083933
407
+
408
+ ### Patch Changes
409
+
410
+ - alpha release 0.0.1-alpha.11
411
+ - Update all public packages to version 0.0.1-alpha.11
412
+ - Trigger automated alpha release workflow
413
+ - Includes latest features and improvements
414
+
415
+ - Updated dependencies
416
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022083933
417
+
418
+ ## 0.0.0-alpha-20251022080712
419
+
420
+ ### Patch Changes
421
+
422
+ - Alpha release 0.0.1-alpha.10
423
+ - Update all public packages to version 0.0.1-alpha.10
424
+ - Trigger automated alpha release workflow
425
+ - Includes latest features and improvements
426
+
427
+ - Updated dependencies
428
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022080712
429
+
430
+ ## 0.0.0-alpha-20251022072016
431
+
432
+ ### Patch Changes
433
+
434
+ - Alpha release with latest features and improvements
435
+ - Make @cloudbase/agent-example-ui-web-shared package public
436
+ - Update all public packages to alpha version
437
+ - Include shared UI components in public release
438
+
439
+ - Updated dependencies
440
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022072016
441
+
442
+ ## 0.0.0-alpha-20251022071917
443
+
444
+ ### Patch Changes
445
+
446
+ - Alpha release with latest features and improvements
447
+ - Make @cloudbase/agent-example-ui-web-shared package public
448
+ - Update all public packages to alpha version
449
+ - Include shared UI components in public release
450
+
451
+ - Updated dependencies
452
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022071917
453
+
454
+ ## 0.0.0-alpha-20251022064104
455
+
456
+ ### Patch Changes
457
+
458
+ - Fix alpha release versioning format
459
+ - Fix Changesets configuration for proper alpha versioning
460
+ - Reset to correct v0.0.1-alpha.X format
461
+ - Include recent improvements and bug fixes
462
+
463
+ - Updated dependencies
464
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022064104
465
+
466
+ ## 0.0.0-alpha-20251022043017
467
+
468
+ ### Patch Changes
469
+
470
+ - Alpha release with CI improvements and quickstart enhancements
471
+ - Remove CloudBase docs deployment from CI workflow
472
+ - Update quickstart guide with modern ES modules setup
473
+ - Add support for multiple LLM providers (OpenAI, Zhipu, Qwen, DeepSeek, Ollama)
474
+ - Simplify configuration and improve code examples
475
+ - Remove UUID validation from conversationId for flexibility
476
+ - Update dependencies and build scripts for better DX
477
+
478
+ - Updated dependencies
479
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022043017
480
+
481
+ ## 0.0.0-alpha-20251022031106
482
+
483
+ ### Patch Changes
484
+
485
+ - Alpha release with dependency updates and improvements
486
+ - Updated dependencies and package configurations
487
+ - Enhanced example configurations
488
+ - Bug fixes and performance improvements
489
+ - Improved stability and reliability
490
+
491
+ - Updated dependencies
492
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022031106
493
+
494
+ ## 0.0.0-alpha-20251022025955
495
+
496
+ ### Patch Changes
497
+
498
+ - Alpha release with latest features and improvements
499
+ - Enhanced documentation and hero section
500
+ - Improved framework logo integration
501
+ - Updated documentation standards
502
+ - Bug fixes and performance improvements
503
+
504
+ - Updated dependencies
505
+ - @cloudbase/agent-agents@0.0.0-alpha-20251022025955
506
+
507
+ ## 0.0.0-alpha-20251017101436
508
+
509
+ ### Patch Changes
510
+
511
+ - Fix GitHub permissions and test deployment pipeline
512
+ - Updated dependencies
513
+ - @cloudbase/agent-agents@0.0.0-alpha-20251017101436
514
+
515
+ ## 0.0.0-alpha-20251017100216
516
+
517
+ ### Patch Changes
518
+
519
+ - Fix GitHub Actions workflow issues and test deployment
520
+ - Updated dependencies
521
+ - @cloudbase/agent-agents@0.0.0-alpha-20251017100216
522
+
523
+ ## 0.0.0-alpha-20251017094344
524
+
525
+ ### Patch Changes
526
+
527
+ - Alpha release with latest features and improvements
528
+ - Updated dependencies
529
+ - @cloudbase/agent-agents@0.0.0-alpha-20251017094344
530
+
531
+ ## 0.0.0-alpha-20251017093946
532
+
533
+ ### Patch Changes
534
+
535
+ - 54e476e: Initial alpha release for testing purposes. This release includes all core AG-Kit packages and example implementations for community testing and feedback.
536
+ - Updated dependencies [54e476e]
537
+ - @cloudbase/agent-agents@0.0.0-alpha-20251017093946
538
+
539
+ ## 0.0.0-alpha-20251017081242
540
+
541
+ ### Patch Changes
542
+
543
+ - Initial alpha release for testing purposes. This release includes all core AG-Kit packages and example implementations for community testing and feedback.
544
+ - Updated dependencies
545
+ - @cloudbase/agent-agents@0.0.0-alpha-20251017081242
@@ -0,0 +1,140 @@
1
+ import * as _langchain_langgraph from '@langchain/langgraph';
2
+ import * as _langchain_core_messages from '@langchain/core/messages';
3
+
4
+ /**
5
+ * A simple agentic chat flow using LangGraph instead of CrewAI.
6
+ */
7
+ declare const agenticChatGraph: _langchain_langgraph.CompiledStateGraph<{
8
+ messages: _langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[];
9
+ agKit: _langchain_langgraph.StateType<{
10
+ actions: {
11
+ (): _langchain_langgraph.LastValue<any[]>;
12
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
13
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
14
+ };
15
+ }>;
16
+ }, {
17
+ messages?: _langchain_langgraph.Messages | undefined;
18
+ agKit?: _langchain_langgraph.StateType<{
19
+ actions: {
20
+ (): _langchain_langgraph.LastValue<any[]>;
21
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
22
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
23
+ };
24
+ }> | undefined;
25
+ }, "__start__" | "chat_node", {
26
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
27
+ agKit: {
28
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
29
+ actions: {
30
+ (): _langchain_langgraph.LastValue<any[]>;
31
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
32
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
33
+ };
34
+ }>>;
35
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
36
+ actions: {
37
+ (): _langchain_langgraph.LastValue<any[]>;
38
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
39
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
40
+ };
41
+ }>, _langchain_langgraph.StateType<{
42
+ actions: {
43
+ (): _langchain_langgraph.LastValue<any[]>;
44
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
45
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
46
+ };
47
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
48
+ actions: {
49
+ (): _langchain_langgraph.LastValue<any[]>;
50
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
51
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
52
+ };
53
+ }>, _langchain_langgraph.StateType<{
54
+ actions: {
55
+ (): _langchain_langgraph.LastValue<any[]>;
56
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
57
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
58
+ };
59
+ }>>;
60
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
61
+ };
62
+ }, {
63
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
64
+ agKit: {
65
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
66
+ actions: {
67
+ (): _langchain_langgraph.LastValue<any[]>;
68
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
69
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
70
+ };
71
+ }>>;
72
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
73
+ actions: {
74
+ (): _langchain_langgraph.LastValue<any[]>;
75
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
76
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
77
+ };
78
+ }>, _langchain_langgraph.StateType<{
79
+ actions: {
80
+ (): _langchain_langgraph.LastValue<any[]>;
81
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
82
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
83
+ };
84
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
85
+ actions: {
86
+ (): _langchain_langgraph.LastValue<any[]>;
87
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
88
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
89
+ };
90
+ }>, _langchain_langgraph.StateType<{
91
+ actions: {
92
+ (): _langchain_langgraph.LastValue<any[]>;
93
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
94
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
95
+ };
96
+ }>>;
97
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
98
+ };
99
+ }, _langchain_langgraph.StateDefinition, {
100
+ chat_node: _langchain_langgraph.UpdateType<{
101
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
102
+ agKit: {
103
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
104
+ actions: {
105
+ (): _langchain_langgraph.LastValue<any[]>;
106
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
107
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
108
+ };
109
+ }>>;
110
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
111
+ actions: {
112
+ (): _langchain_langgraph.LastValue<any[]>;
113
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
114
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
115
+ };
116
+ }>, _langchain_langgraph.StateType<{
117
+ actions: {
118
+ (): _langchain_langgraph.LastValue<any[]>;
119
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
120
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
121
+ };
122
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
123
+ actions: {
124
+ (): _langchain_langgraph.LastValue<any[]>;
125
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
126
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
127
+ };
128
+ }>, _langchain_langgraph.StateType<{
129
+ actions: {
130
+ (): _langchain_langgraph.LastValue<any[]>;
131
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
132
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
133
+ };
134
+ }>>;
135
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
136
+ };
137
+ }>;
138
+ }, unknown, unknown>;
139
+
140
+ export { agenticChatGraph };
@@ -0,0 +1,140 @@
1
+ import * as _langchain_langgraph from '@langchain/langgraph';
2
+ import * as _langchain_core_messages from '@langchain/core/messages';
3
+
4
+ /**
5
+ * A simple agentic chat flow using LangGraph instead of CrewAI.
6
+ */
7
+ declare const agenticChatGraph: _langchain_langgraph.CompiledStateGraph<{
8
+ messages: _langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[];
9
+ agKit: _langchain_langgraph.StateType<{
10
+ actions: {
11
+ (): _langchain_langgraph.LastValue<any[]>;
12
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
13
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
14
+ };
15
+ }>;
16
+ }, {
17
+ messages?: _langchain_langgraph.Messages | undefined;
18
+ agKit?: _langchain_langgraph.StateType<{
19
+ actions: {
20
+ (): _langchain_langgraph.LastValue<any[]>;
21
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
22
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
23
+ };
24
+ }> | undefined;
25
+ }, "__start__" | "chat_node", {
26
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
27
+ agKit: {
28
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
29
+ actions: {
30
+ (): _langchain_langgraph.LastValue<any[]>;
31
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
32
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
33
+ };
34
+ }>>;
35
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
36
+ actions: {
37
+ (): _langchain_langgraph.LastValue<any[]>;
38
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
39
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
40
+ };
41
+ }>, _langchain_langgraph.StateType<{
42
+ actions: {
43
+ (): _langchain_langgraph.LastValue<any[]>;
44
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
45
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
46
+ };
47
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
48
+ actions: {
49
+ (): _langchain_langgraph.LastValue<any[]>;
50
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
51
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
52
+ };
53
+ }>, _langchain_langgraph.StateType<{
54
+ actions: {
55
+ (): _langchain_langgraph.LastValue<any[]>;
56
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
57
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
58
+ };
59
+ }>>;
60
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
61
+ };
62
+ }, {
63
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
64
+ agKit: {
65
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
66
+ actions: {
67
+ (): _langchain_langgraph.LastValue<any[]>;
68
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
69
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
70
+ };
71
+ }>>;
72
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
73
+ actions: {
74
+ (): _langchain_langgraph.LastValue<any[]>;
75
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
76
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
77
+ };
78
+ }>, _langchain_langgraph.StateType<{
79
+ actions: {
80
+ (): _langchain_langgraph.LastValue<any[]>;
81
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
82
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
83
+ };
84
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
85
+ actions: {
86
+ (): _langchain_langgraph.LastValue<any[]>;
87
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
88
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
89
+ };
90
+ }>, _langchain_langgraph.StateType<{
91
+ actions: {
92
+ (): _langchain_langgraph.LastValue<any[]>;
93
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
94
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
95
+ };
96
+ }>>;
97
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
98
+ };
99
+ }, _langchain_langgraph.StateDefinition, {
100
+ chat_node: _langchain_langgraph.UpdateType<{
101
+ messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage<_langchain_core_messages.MessageStructure, _langchain_core_messages.MessageType>[], _langchain_langgraph.Messages>;
102
+ agKit: {
103
+ (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
104
+ actions: {
105
+ (): _langchain_langgraph.LastValue<any[]>;
106
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
107
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
108
+ };
109
+ }>>;
110
+ (annotation: _langchain_langgraph.SingleReducer<_langchain_langgraph.StateType<{
111
+ actions: {
112
+ (): _langchain_langgraph.LastValue<any[]>;
113
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
114
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
115
+ };
116
+ }>, _langchain_langgraph.StateType<{
117
+ actions: {
118
+ (): _langchain_langgraph.LastValue<any[]>;
119
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
120
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
121
+ };
122
+ }>>): _langchain_langgraph.BinaryOperatorAggregate<_langchain_langgraph.StateType<{
123
+ actions: {
124
+ (): _langchain_langgraph.LastValue<any[]>;
125
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
126
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
127
+ };
128
+ }>, _langchain_langgraph.StateType<{
129
+ actions: {
130
+ (): _langchain_langgraph.LastValue<any[]>;
131
+ (annotation: _langchain_langgraph.SingleReducer<any[], any[]>): _langchain_langgraph.BinaryOperatorAggregate<any[], any[]>;
132
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
133
+ };
134
+ }>>;
135
+ Root: <S extends _langchain_langgraph.StateDefinition>(sd: S) => _langchain_langgraph.AnnotationRoot<S>;
136
+ };
137
+ }>;
138
+ }, unknown, unknown>;
139
+
140
+ export { agenticChatGraph };
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ agenticChatGraph: () => agenticChatGraph
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/agent.ts
28
+ var import_openai = require("@langchain/openai");
29
+ var import_messages = require("@langchain/core/messages");
30
+ var import_langgraph = require("@langchain/langgraph");
31
+ var import_agent_adapter_langgraph = require("@cloudbase/agent-adapter-langgraph");
32
+ var import_langgraph2 = require("@langchain/langgraph");
33
+ async function chatNode(state, config) {
34
+ const model = new import_openai.ChatOpenAI({
35
+ model: process.env.OPENAI_MODEL || "gpt-4o-mini",
36
+ apiKey: process.env.OPENAI_API_KEY,
37
+ configuration: {
38
+ baseURL: process.env.OPENAI_BASE_URL
39
+ }
40
+ });
41
+ if (!config) {
42
+ config = { recursionLimit: 25 };
43
+ }
44
+ const modelWithTools = model.bindTools([...state.agKit?.actions || []], {
45
+ parallel_tool_calls: false
46
+ });
47
+ const systemMessage = new import_messages.SystemMessage({
48
+ content: "You are a helpful assistant."
49
+ });
50
+ const response = await modelWithTools.invoke(
51
+ [systemMessage, ...state.messages],
52
+ config
53
+ );
54
+ return new import_langgraph.Command({
55
+ goto: import_langgraph.END,
56
+ update: {
57
+ messages: [response]
58
+ }
59
+ });
60
+ }
61
+ var workflow = new import_langgraph.StateGraph(import_agent_adapter_langgraph.AGKitStateAnnotation).addNode("chat_node", chatNode).addEdge(import_langgraph.START, "chat_node").addEdge("chat_node", import_langgraph.END);
62
+ var agenticChatGraph = workflow.compile({
63
+ checkpointer: new import_langgraph2.MemorySaver()
64
+ });
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ agenticChatGraph
68
+ });
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/agent.ts"],"sourcesContent":["export * from \"./agent\";\n","/**\n * A simple agentic chat flow using LangGraph instead of CrewAI.\n */\n\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { SystemMessage } from \"@langchain/core/messages\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph, Command, START, END } from \"@langchain/langgraph\";\n\nimport { AGKitStateAnnotation, AGKitState } from \"@cloudbase/agent-adapter-langgraph\";\nimport { MemorySaver } from \"@langchain/langgraph\";\n\nasync function chatNode(state: AGKitState, config?: RunnableConfig) {\n const model = new ChatOpenAI({\n model: process.env.OPENAI_MODEL || \"gpt-4o-mini\",\n apiKey: process.env.OPENAI_API_KEY,\n configuration: {\n baseURL: process.env.OPENAI_BASE_URL,\n },\n });\n\n if (!config) {\n config = { recursionLimit: 25 };\n }\n\n const modelWithTools = model.bindTools([...(state.agKit?.actions || [])], {\n parallel_tool_calls: false,\n });\n\n const systemMessage = new SystemMessage({\n content: \"You are a helpful assistant.\",\n });\n\n const response = await modelWithTools.invoke(\n [systemMessage, ...state.messages],\n config\n );\n\n return new Command({\n goto: END,\n update: {\n messages: [response],\n },\n });\n}\n\nconst workflow = new StateGraph(AGKitStateAnnotation)\n .addNode(\"chat_node\", chatNode)\n .addEdge(START, \"chat_node\")\n .addEdge(\"chat_node\", END);\n\nexport const agenticChatGraph = workflow.compile({\n checkpointer: new MemorySaver(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIA,oBAA2B;AAC3B,sBAA8B;AAE9B,uBAAgD;AAEhD,qCAAiD;AACjD,IAAAA,oBAA4B;AAE5B,eAAe,SAAS,OAAmB,QAAyB;AAClE,QAAM,QAAQ,IAAI,yBAAW;AAAA,IAC3B,OAAO,QAAQ,IAAI,gBAAgB;AAAA,IACnC,QAAQ,QAAQ,IAAI;AAAA,IACpB,eAAe;AAAA,MACb,SAAS,QAAQ,IAAI;AAAA,IACvB;AAAA,EACF,CAAC;AAED,MAAI,CAAC,QAAQ;AACX,aAAS,EAAE,gBAAgB,GAAG;AAAA,EAChC;AAEA,QAAM,iBAAiB,MAAM,UAAU,CAAC,GAAI,MAAM,OAAO,WAAW,CAAC,CAAE,GAAG;AAAA,IACxE,qBAAqB;AAAA,EACvB,CAAC;AAED,QAAM,gBAAgB,IAAI,8BAAc;AAAA,IACtC,SAAS;AAAA,EACX,CAAC;AAED,QAAM,WAAW,MAAM,eAAe;AAAA,IACpC,CAAC,eAAe,GAAG,MAAM,QAAQ;AAAA,IACjC;AAAA,EACF;AAEA,SAAO,IAAI,yBAAQ;AAAA,IACjB,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,UAAU,CAAC,QAAQ;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAEA,IAAM,WAAW,IAAI,4BAAW,mDAAoB,EACjD,QAAQ,aAAa,QAAQ,EAC7B,QAAQ,wBAAO,WAAW,EAC1B,QAAQ,aAAa,oBAAG;AAEpB,IAAM,mBAAmB,SAAS,QAAQ;AAAA,EAC/C,cAAc,IAAI,8BAAY;AAChC,CAAC;","names":["import_langgraph"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,42 @@
1
+ // src/agent.ts
2
+ import { ChatOpenAI } from "@langchain/openai";
3
+ import { SystemMessage } from "@langchain/core/messages";
4
+ import { StateGraph, Command, START, END } from "@langchain/langgraph";
5
+ import { AGKitStateAnnotation } from "@cloudbase/agent-adapter-langgraph";
6
+ import { MemorySaver } from "@langchain/langgraph";
7
+ async function chatNode(state, config) {
8
+ const model = new ChatOpenAI({
9
+ model: process.env.OPENAI_MODEL || "gpt-4o-mini",
10
+ apiKey: process.env.OPENAI_API_KEY,
11
+ configuration: {
12
+ baseURL: process.env.OPENAI_BASE_URL
13
+ }
14
+ });
15
+ if (!config) {
16
+ config = { recursionLimit: 25 };
17
+ }
18
+ const modelWithTools = model.bindTools([...state.agKit?.actions || []], {
19
+ parallel_tool_calls: false
20
+ });
21
+ const systemMessage = new SystemMessage({
22
+ content: "You are a helpful assistant."
23
+ });
24
+ const response = await modelWithTools.invoke(
25
+ [systemMessage, ...state.messages],
26
+ config
27
+ );
28
+ return new Command({
29
+ goto: END,
30
+ update: {
31
+ messages: [response]
32
+ }
33
+ });
34
+ }
35
+ var workflow = new StateGraph(AGKitStateAnnotation).addNode("chat_node", chatNode).addEdge(START, "chat_node").addEdge("chat_node", END);
36
+ var agenticChatGraph = workflow.compile({
37
+ checkpointer: new MemorySaver()
38
+ });
39
+ export {
40
+ agenticChatGraph
41
+ };
42
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agent.ts"],"sourcesContent":["/**\n * A simple agentic chat flow using LangGraph instead of CrewAI.\n */\n\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { SystemMessage } from \"@langchain/core/messages\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph, Command, START, END } from \"@langchain/langgraph\";\n\nimport { AGKitStateAnnotation, AGKitState } from \"@cloudbase/agent-adapter-langgraph\";\nimport { MemorySaver } from \"@langchain/langgraph\";\n\nasync function chatNode(state: AGKitState, config?: RunnableConfig) {\n const model = new ChatOpenAI({\n model: process.env.OPENAI_MODEL || \"gpt-4o-mini\",\n apiKey: process.env.OPENAI_API_KEY,\n configuration: {\n baseURL: process.env.OPENAI_BASE_URL,\n },\n });\n\n if (!config) {\n config = { recursionLimit: 25 };\n }\n\n const modelWithTools = model.bindTools([...(state.agKit?.actions || [])], {\n parallel_tool_calls: false,\n });\n\n const systemMessage = new SystemMessage({\n content: \"You are a helpful assistant.\",\n });\n\n const response = await modelWithTools.invoke(\n [systemMessage, ...state.messages],\n config\n );\n\n return new Command({\n goto: END,\n update: {\n messages: [response],\n },\n });\n}\n\nconst workflow = new StateGraph(AGKitStateAnnotation)\n .addNode(\"chat_node\", chatNode)\n .addEdge(START, \"chat_node\")\n .addEdge(\"chat_node\", END);\n\nexport const agenticChatGraph = workflow.compile({\n checkpointer: new MemorySaver(),\n});\n"],"mappings":";AAIA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,SAAS,YAAY,SAAS,OAAO,WAAW;AAEhD,SAAS,4BAAwC;AACjD,SAAS,mBAAmB;AAE5B,eAAe,SAAS,OAAmB,QAAyB;AAClE,QAAM,QAAQ,IAAI,WAAW;AAAA,IAC3B,OAAO,QAAQ,IAAI,gBAAgB;AAAA,IACnC,QAAQ,QAAQ,IAAI;AAAA,IACpB,eAAe;AAAA,MACb,SAAS,QAAQ,IAAI;AAAA,IACvB;AAAA,EACF,CAAC;AAED,MAAI,CAAC,QAAQ;AACX,aAAS,EAAE,gBAAgB,GAAG;AAAA,EAChC;AAEA,QAAM,iBAAiB,MAAM,UAAU,CAAC,GAAI,MAAM,OAAO,WAAW,CAAC,CAAE,GAAG;AAAA,IACxE,qBAAqB;AAAA,EACvB,CAAC;AAED,QAAM,gBAAgB,IAAI,cAAc;AAAA,IACtC,SAAS;AAAA,EACX,CAAC;AAED,QAAM,WAAW,MAAM,eAAe;AAAA,IACpC,CAAC,eAAe,GAAG,MAAM,QAAQ;AAAA,IACjC;AAAA,EACF;AAEA,SAAO,IAAI,QAAQ;AAAA,IACjB,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,UAAU,CAAC,QAAQ;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAEA,IAAM,WAAW,IAAI,WAAW,oBAAoB,EACjD,QAAQ,aAAa,QAAQ,EAC7B,QAAQ,OAAO,WAAW,EAC1B,QAAQ,aAAa,GAAG;AAEpB,IAAM,mBAAmB,SAAS,QAAQ;AAAA,EAC/C,cAAc,IAAI,YAAY;AAChC,CAAC;","names":[]}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@cloudbase/agent-examples-langgraph-agentic-chat",
3
+ "version": "0.0.2",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "keywords": [],
7
+ "author": "",
8
+ "license": "ISC",
9
+ "dependencies": {
10
+ "@langchain/core": "^1.0.2",
11
+ "@langchain/langgraph": "^1.0.1",
12
+ "@langchain/openai": "^1.0.0",
13
+ "@cloudbase/agent-agents": "^0.0.2",
14
+ "@cloudbase/agent-adapter-langgraph": "^0.0.2"
15
+ },
16
+ "devDependencies": {
17
+ "tsup": "^8.5.0"
18
+ },
19
+ "scripts": {
20
+ "build": "tsup --config tsup.config.ts"
21
+ }
22
+ }
package/src/agent.ts ADDED
@@ -0,0 +1,54 @@
1
+ /**
2
+ * A simple agentic chat flow using LangGraph instead of CrewAI.
3
+ */
4
+
5
+ import { ChatOpenAI } from "@langchain/openai";
6
+ import { SystemMessage } from "@langchain/core/messages";
7
+ import { RunnableConfig } from "@langchain/core/runnables";
8
+ import { StateGraph, Command, START, END } from "@langchain/langgraph";
9
+
10
+ import { AGKitStateAnnotation, AGKitState } from "@cloudbase/agent-adapter-langgraph";
11
+ import { MemorySaver } from "@langchain/langgraph";
12
+
13
+ async function chatNode(state: AGKitState, config?: RunnableConfig) {
14
+ const model = new ChatOpenAI({
15
+ model: process.env.OPENAI_MODEL || "gpt-4o-mini",
16
+ apiKey: process.env.OPENAI_API_KEY,
17
+ configuration: {
18
+ baseURL: process.env.OPENAI_BASE_URL,
19
+ },
20
+ });
21
+
22
+ if (!config) {
23
+ config = { recursionLimit: 25 };
24
+ }
25
+
26
+ const modelWithTools = model.bindTools([...(state.agKit?.actions || [])], {
27
+ parallel_tool_calls: false,
28
+ });
29
+
30
+ const systemMessage = new SystemMessage({
31
+ content: "You are a helpful assistant.",
32
+ });
33
+
34
+ const response = await modelWithTools.invoke(
35
+ [systemMessage, ...state.messages],
36
+ config
37
+ );
38
+
39
+ return new Command({
40
+ goto: END,
41
+ update: {
42
+ messages: [response],
43
+ },
44
+ });
45
+ }
46
+
47
+ const workflow = new StateGraph(AGKitStateAnnotation)
48
+ .addNode("chat_node", chatNode)
49
+ .addEdge(START, "chat_node")
50
+ .addEdge("chat_node", END);
51
+
52
+ export const agenticChatGraph = workflow.compile({
53
+ checkpointer: new MemorySaver(),
54
+ });
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./agent";
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "declaration": true,
7
+ "jsx": "react-jsx",
8
+ "outDir": "dist",
9
+ "strict": true,
10
+ "skipLibCheck": true,
11
+ "resolveJsonModule": true,
12
+ "esModuleInterop": true
13
+ },
14
+ "include": ["src/**/*"],
15
+ "exclude": ["dist", "node_modules"]
16
+ }
17
+
package/tsup.config.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ outDir: "dist",
6
+ dts: true,
7
+ format: ["esm", "cjs"],
8
+ sourcemap: true,
9
+ clean: true,
10
+ tsconfig: "tsconfig.json",
11
+ });