@agentionai/agents 0.4.0 → 0.4.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/README.md +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ A comprehensive TypeScript toolkit for building LLM-powered agents with RAG, and
|
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
|
+
### 1. Install
|
|
14
|
+
|
|
13
15
|
Install only what you need with selective imports:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
@@ -17,11 +19,29 @@ Install only what you need with selective imports:
|
|
|
17
19
|
npm install @agentionai/agents @anthropic-ai/sdk
|
|
18
20
|
```
|
|
19
21
|
|
|
22
|
+
### 2. Get API Key
|
|
23
|
+
|
|
24
|
+
Get an API key from your chosen provider:
|
|
25
|
+
|
|
26
|
+
- **Claude**: [console.anthropic.com](https://console.anthropic.com/)
|
|
27
|
+
- **OpenAI**: [platform.openai.com](https://platform.openai.com/api-keys)
|
|
28
|
+
- **Gemini**: [aistudio.google.com](https://aistudio.google.com/app/apikey)
|
|
29
|
+
- **Mistral**: [console.mistral.ai](https://console.mistral.ai/)
|
|
30
|
+
|
|
31
|
+
Set it as an environment variable:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Create Your First Agent
|
|
38
|
+
|
|
20
39
|
```typescript
|
|
21
40
|
// Import only Claude - no other agent SDKs required!
|
|
22
41
|
import { ClaudeAgent } from '@agentionai/agents/claude';
|
|
23
42
|
|
|
24
43
|
const agent = new ClaudeAgent({
|
|
44
|
+
apiKey: process.env.ANTHROPIC_API_KEY, // Or pass directly (not recommended for production)
|
|
25
45
|
model: 'claude-sonnet-4-5',
|
|
26
46
|
name: 'Assistant',
|
|
27
47
|
description: 'You are a helpful assistant.',
|
|
@@ -84,6 +104,7 @@ const weatherTool = new Tool({
|
|
|
84
104
|
});
|
|
85
105
|
|
|
86
106
|
const agent = new GeminiAgent({
|
|
107
|
+
apiKey: process.env.GEMINI_API_KEY,
|
|
87
108
|
model: 'gemini-flash-lite-latest',
|
|
88
109
|
name: 'Weather Agent',
|
|
89
110
|
description: 'You are a weather assistant.',
|
|
@@ -103,6 +124,7 @@ import { OpenAiAgent } from '@agentionai/agents/openai';
|
|
|
103
124
|
import { Pipeline } from '@agentionai/agents/core';
|
|
104
125
|
|
|
105
126
|
const researcher = new OpenAiAgent({
|
|
127
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
106
128
|
id: 'researcher',
|
|
107
129
|
name: 'Researcher',
|
|
108
130
|
description: 'Research the given topic and provide key facts.',
|
|
@@ -111,6 +133,7 @@ const researcher = new OpenAiAgent({
|
|
|
111
133
|
});
|
|
112
134
|
|
|
113
135
|
const writer = new ClaudeAgent({
|
|
136
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
114
137
|
id: 'writer',
|
|
115
138
|
name: 'Writer',
|
|
116
139
|
description: 'Write a blog post based on the research provided.',
|
|
@@ -131,6 +154,7 @@ import { OpenAiAgent } from '@agentionai/agents/openai';
|
|
|
131
154
|
|
|
132
155
|
// Research assistant (cheaper model for data gathering)
|
|
133
156
|
const researchAssistant = new OpenAiAgent({
|
|
157
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
134
158
|
id: 'research-assistant',
|
|
135
159
|
name: 'Research Assistant',
|
|
136
160
|
description: 'Search and summarize information on topics.',
|
|
@@ -140,6 +164,7 @@ const researchAssistant = new OpenAiAgent({
|
|
|
140
164
|
|
|
141
165
|
// Lead researcher delegates to assistant, synthesizes findings
|
|
142
166
|
const researcher = new ClaudeAgent({
|
|
167
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
143
168
|
id: 'researcher',
|
|
144
169
|
name: 'Lead Researcher',
|
|
145
170
|
description: 'Research topics thoroughly using your assistant.',
|