@artemiskit/adapter-anthropic 0.1.2 → 0.1.3
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 +8 -0
- package/README.md +96 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @artemiskit/adapter-anthropic
|
|
2
|
+
|
|
3
|
+
Anthropic Claude adapter for ArtemisKit LLM evaluation toolkit.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @artemiskit/adapter-anthropic
|
|
9
|
+
# or
|
|
10
|
+
bun add @artemiskit/adapter-anthropic
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This adapter provides connectivity to Anthropic's Claude models via the Anthropic API.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### With CLI
|
|
20
|
+
|
|
21
|
+
Configure in `artemis.config.yaml`:
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
provider: anthropic
|
|
25
|
+
model: claude-sonnet-4-5-20241022
|
|
26
|
+
|
|
27
|
+
providers:
|
|
28
|
+
anthropic:
|
|
29
|
+
apiKey: ${ANTHROPIC_API_KEY}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then run:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
artemiskit run my-scenario.yaml --provider anthropic
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Programmatic
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { AnthropicAdapter } from '@artemiskit/adapter-anthropic';
|
|
42
|
+
|
|
43
|
+
const adapter = new AnthropicAdapter({
|
|
44
|
+
provider: 'anthropic',
|
|
45
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
46
|
+
defaultModel: 'claude-sonnet-4-5-20241022',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const result = await adapter.generate({
|
|
50
|
+
prompt: 'Hello, how are you?',
|
|
51
|
+
model: 'claude-sonnet-4-5-20241022',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(result.text);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Configuration Options
|
|
58
|
+
|
|
59
|
+
| Option | Type | Required | Description |
|
|
60
|
+
|--------|------|----------|-------------|
|
|
61
|
+
| `provider` | `'anthropic'` | Yes | Provider identifier |
|
|
62
|
+
| `apiKey` | `string` | No | Anthropic API key (or use ANTHROPIC_API_KEY env var) |
|
|
63
|
+
| `defaultModel` | `string` | No | Default model to use |
|
|
64
|
+
| `baseUrl` | `string` | No | Custom API base URL |
|
|
65
|
+
| `timeout` | `number` | No | Request timeout in ms (default: 60000) |
|
|
66
|
+
| `maxRetries` | `number` | No | Max retry attempts (default: 2) |
|
|
67
|
+
|
|
68
|
+
## Environment Variables
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Supported Models
|
|
75
|
+
|
|
76
|
+
| Model | Description |
|
|
77
|
+
|-------|-------------|
|
|
78
|
+
| `claude-opus-4-5-20241101` | Most intelligent, flagship model |
|
|
79
|
+
| `claude-sonnet-4-5-20241022` | Balanced performance, recommended for most use cases |
|
|
80
|
+
| `claude-haiku-4-5-20241022` | Fast and efficient |
|
|
81
|
+
| `claude-opus-4-1-20250414` | Opus 4.1 - strong coding and agent capabilities |
|
|
82
|
+
| `claude-sonnet-4-1-20250414` | Sonnet 4.1 |
|
|
83
|
+
| `claude-haiku-4-1-20250414` | Haiku 4.1 |
|
|
84
|
+
|
|
85
|
+
Note: Claude 3 Opus and Claude 3 Sonnet have been deprecated. Migrate to Claude 4.x models.
|
|
86
|
+
|
|
87
|
+
## Related Packages
|
|
88
|
+
|
|
89
|
+
- [`@artemiskit/cli`](https://www.npmjs.com/package/@artemiskit/cli) - Command-line interface
|
|
90
|
+
- [`@artemiskit/core`](https://www.npmjs.com/package/@artemiskit/core) - Core runtime
|
|
91
|
+
- [`@artemiskit/adapter-openai`](https://www.npmjs.com/package/@artemiskit/adapter-openai) - OpenAI adapter
|
|
92
|
+
- [`@artemiskit/adapter-vercel-ai`](https://www.npmjs.com/package/@artemiskit/adapter-vercel-ai) - Vercel AI SDK adapter
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
Apache-2.0
|