@aigne/agent-library 1.8.0 → 1.9.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 +23 -0
- package/README.md +26 -15
- package/README.zh.md +12 -9
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
- chore: release 1.2.0
|
|
4
4
|
|
|
5
|
+
## [1.9.0](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.8.1...agent-library-v1.9.0) (2025-05-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **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))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* The following workspace dependencies were updated
|
|
16
|
+
* dependencies
|
|
17
|
+
* @aigne/core bumped to 1.16.0
|
|
18
|
+
|
|
19
|
+
## [1.8.1](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.8.0...agent-library-v1.8.1) (2025-05-15)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
|
|
24
|
+
* The following workspace dependencies were updated
|
|
25
|
+
* dependencies
|
|
26
|
+
* @aigne/core bumped to 1.15.0
|
|
27
|
+
|
|
5
28
|
## [1.8.0](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.7.1...agent-library-v1.8.0) (2025-05-12)
|
|
6
29
|
|
|
7
30
|
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@ Collection of agent libraries for [AIGNE Framework](https://github.com/AIGNE-io/
|
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
* **Orchestrator Agent**: Provides OrchestratorAgent implementation for coordinating workflows between multiple agents
|
|
20
|
+
* **Task Concurrency**: Supports parallel execution of multiple tasks to improve processing efficiency
|
|
21
|
+
* **Planning & Execution**: Automatically generates execution plans and executes them step by step
|
|
22
|
+
* **Result Synthesis**: Intelligently synthesizes results from multiple steps and tasks
|
|
23
|
+
* **TypeScript Support**: Complete type definitions providing an excellent development experience
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
@@ -61,12 +61,16 @@ const aigne = new AIGNE({ model });
|
|
|
61
61
|
// Create orchestrator agent
|
|
62
62
|
const orchestrator = new OrchestratorAgent({
|
|
63
63
|
name: "MainOrchestrator",
|
|
64
|
-
instructions:
|
|
64
|
+
instructions:
|
|
65
|
+
"You are a task orchestrator responsible for coordinating multiple specialized agents to complete complex tasks.",
|
|
65
66
|
// Configure sub-agents and tools...
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
// Execute orchestration task
|
|
69
|
-
const result = await aigne.invoke(
|
|
70
|
+
const result = await aigne.invoke(
|
|
71
|
+
orchestrator,
|
|
72
|
+
"Analyze this article and generate a summary and keywords",
|
|
73
|
+
);
|
|
70
74
|
console.log(result);
|
|
71
75
|
```
|
|
72
76
|
|
|
@@ -74,7 +78,7 @@ console.log(result);
|
|
|
74
78
|
|
|
75
79
|
The library currently provides one specialized agent implementation:
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
* **Orchestrator Agent (OrchestratorAgent)**: Responsible for coordinating work between multiple agents and managing complex workflows. It can automatically plan task steps, distribute and execute tasks across multiple agents, and finally synthesize the results.
|
|
78
82
|
|
|
79
83
|
## Advanced Usage
|
|
80
84
|
|
|
@@ -93,36 +97,43 @@ const model = new OpenAIChatModel({
|
|
|
93
97
|
// Create specialized sub-agents
|
|
94
98
|
const researchAgent = AIAgent.from({
|
|
95
99
|
name: "Researcher",
|
|
96
|
-
instructions:
|
|
100
|
+
instructions:
|
|
101
|
+
"You are a professional researcher responsible for collecting and analyzing information.",
|
|
97
102
|
outputKey: "research",
|
|
98
103
|
});
|
|
99
104
|
|
|
100
105
|
const writerAgent = AIAgent.from({
|
|
101
106
|
name: "Writer",
|
|
102
|
-
instructions:
|
|
107
|
+
instructions:
|
|
108
|
+
"You are a professional writer responsible for creating high-quality content.",
|
|
103
109
|
outputKey: "content",
|
|
104
110
|
});
|
|
105
111
|
|
|
106
112
|
const editorAgent = AIAgent.from({
|
|
107
113
|
name: "Editor",
|
|
108
|
-
instructions:
|
|
114
|
+
instructions:
|
|
115
|
+
"You are a strict editor responsible for checking content quality and formatting.",
|
|
109
116
|
outputKey: "edited",
|
|
110
117
|
});
|
|
111
118
|
|
|
112
119
|
// Create orchestrator agent
|
|
113
120
|
const orchestrator = new OrchestratorAgent({
|
|
114
121
|
name: "WorkflowOrchestrator",
|
|
115
|
-
instructions:
|
|
122
|
+
instructions:
|
|
123
|
+
"You are responsible for coordinating research, writing, and editing processes.",
|
|
116
124
|
skills: [researchAgent, writerAgent, editorAgent],
|
|
117
125
|
// Optional configuration
|
|
118
|
-
maxIterations: 30,
|
|
119
|
-
tasksConcurrency: 5,
|
|
126
|
+
maxIterations: 30, // Maximum number of iterations
|
|
127
|
+
tasksConcurrency: 5, // Task concurrency
|
|
120
128
|
});
|
|
121
129
|
|
|
122
130
|
// Use the orchestrator agent
|
|
123
131
|
const aigne = new AIGNE({ model });
|
|
124
132
|
|
|
125
|
-
const result = await aigne.invoke(
|
|
133
|
+
const result = await aigne.invoke(
|
|
134
|
+
orchestrator,
|
|
135
|
+
"Applications of artificial intelligence in healthcare",
|
|
136
|
+
);
|
|
126
137
|
|
|
127
138
|
console.log(result);
|
|
128
139
|
```
|
package/README.zh.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
## 特性
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
* **编排代理**:提供 OrchestratorAgent 实现,用于协调多个代理之间的工作流
|
|
20
|
+
* **任务并发**:支持并行执行多个任务,提高处理效率
|
|
21
|
+
* **计划与执行**:自动生成执行计划并逐步执行
|
|
22
|
+
* **结果合成**:智能合成多个步骤和任务的结果
|
|
23
|
+
* **TypeScript 支持**:完整的类型定义,提供优秀的开发体验
|
|
24
24
|
|
|
25
25
|
## 安装
|
|
26
26
|
|
|
@@ -66,7 +66,10 @@ const orchestrator = new OrchestratorAgent({
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
// 执行编排任务
|
|
69
|
-
const result = await aigne.invoke(
|
|
69
|
+
const result = await aigne.invoke(
|
|
70
|
+
orchestrator,
|
|
71
|
+
"分析这篇文章并生成摘要和关键词",
|
|
72
|
+
);
|
|
70
73
|
|
|
71
74
|
console.log(result);
|
|
72
75
|
```
|
|
@@ -75,7 +78,7 @@ console.log(result);
|
|
|
75
78
|
|
|
76
79
|
该库目前提供了一种专业化的代理实现:
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
* **编排代理(OrchestratorAgent)**:负责协调多个代理之间的工作,管理复杂工作流。它能够自动规划任务步骤,并在多个代理之间分配和执行任务,最后合成结果。
|
|
79
82
|
|
|
80
83
|
## 高级用法
|
|
81
84
|
|
|
@@ -116,8 +119,8 @@ const orchestrator = new OrchestratorAgent({
|
|
|
116
119
|
instructions: "你负责协调研究、写作和编辑流程。",
|
|
117
120
|
skills: [researchAgent, writerAgent, editorAgent],
|
|
118
121
|
// 可选配置
|
|
119
|
-
maxIterations: 30,
|
|
120
|
-
tasksConcurrency: 5,
|
|
122
|
+
maxIterations: 30, // 最大迭代次数
|
|
123
|
+
tasksConcurrency: 5, // 任务并发数
|
|
121
124
|
});
|
|
122
125
|
|
|
123
126
|
// 使用编排代理
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/agent-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Collection of agent libraries for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"fastq": "^1.19.1",
|
|
43
43
|
"yaml": "^2.7.1",
|
|
44
44
|
"zod": "^3.24.4",
|
|
45
|
-
"@aigne/core": "^1.
|
|
45
|
+
"@aigne/core": "^1.16.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/bun": "^1.2.12",
|