@artemiskit/adapter-openai 0.1.2 → 0.1.4
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 +22 -0
- package/README.md +155 -0
- package/package.json +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @artemiskit/adapter-openai
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 367eb3b: fix: resolve npm install error caused by workspace:\* protocol
|
|
8
|
+
|
|
9
|
+
Fixed an issue where `npm i -g @artemiskit/cli` would fail with
|
|
10
|
+
"Unsupported URL Type workspace:_" error. The publish workflow now
|
|
11
|
+
automatically replaces workspace:_ dependencies with actual version
|
|
12
|
+
numbers before publishing to npm.
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [367eb3b]
|
|
15
|
+
- @artemiskit/core@0.1.4
|
|
16
|
+
|
|
17
|
+
## 0.1.3
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 11ac4a7: Updated Package Documentations
|
|
22
|
+
- Updated dependencies [11ac4a7]
|
|
23
|
+
- @artemiskit/core@0.1.3
|
|
24
|
+
|
|
3
25
|
## 0.1.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# @artemiskit/adapter-openai
|
|
2
|
+
|
|
3
|
+
OpenAI and Azure OpenAI adapter for ArtemisKit LLM evaluation toolkit.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @artemiskit/adapter-openai
|
|
9
|
+
# or
|
|
10
|
+
bun add @artemiskit/adapter-openai
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This adapter provides connectivity to:
|
|
16
|
+
|
|
17
|
+
- **OpenAI API** - GPT-5.2, GPT-4.1, GPT-4o, and more
|
|
18
|
+
- **Azure OpenAI Service** - Azure-hosted OpenAI models
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### With CLI
|
|
23
|
+
|
|
24
|
+
Configure in `artemis.config.yaml`:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
# OpenAI
|
|
28
|
+
provider: openai
|
|
29
|
+
model: gpt-4.1
|
|
30
|
+
|
|
31
|
+
providers:
|
|
32
|
+
openai:
|
|
33
|
+
apiKey: ${OPENAI_API_KEY}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
# Azure OpenAI
|
|
38
|
+
provider: azure-openai
|
|
39
|
+
model: gpt-4o
|
|
40
|
+
|
|
41
|
+
providers:
|
|
42
|
+
azure-openai:
|
|
43
|
+
apiKey: ${AZURE_OPENAI_API_KEY}
|
|
44
|
+
resourceName: my-openai-resource
|
|
45
|
+
deploymentName: gpt-4o-deployment
|
|
46
|
+
apiVersion: "2024-02-15-preview"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Programmatic - OpenAI
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { OpenAIAdapter } from '@artemiskit/adapter-openai';
|
|
53
|
+
|
|
54
|
+
const adapter = new OpenAIAdapter({
|
|
55
|
+
provider: 'openai',
|
|
56
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
57
|
+
defaultModel: 'gpt-4.1',
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const result = await adapter.generate({
|
|
61
|
+
prompt: 'Hello, how are you?',
|
|
62
|
+
model: 'gpt-4.1',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
console.log(result.text);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Programmatic - Azure OpenAI
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { OpenAIAdapter } from '@artemiskit/adapter-openai';
|
|
72
|
+
|
|
73
|
+
const azureAdapter = new OpenAIAdapter({
|
|
74
|
+
provider: 'azure-openai',
|
|
75
|
+
apiKey: process.env.AZURE_OPENAI_API_KEY,
|
|
76
|
+
resourceName: 'my-openai-resource',
|
|
77
|
+
deploymentName: 'gpt-4o-deployment',
|
|
78
|
+
apiVersion: '2024-02-15-preview',
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const result = await azureAdapter.generate({
|
|
82
|
+
prompt: 'Hello, how are you?',
|
|
83
|
+
model: 'gpt-4o-deployment', // Use your deployment name
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log(result.text);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Configuration Options
|
|
90
|
+
|
|
91
|
+
### OpenAI
|
|
92
|
+
|
|
93
|
+
| Option | Type | Required | Description |
|
|
94
|
+
|--------|------|----------|-------------|
|
|
95
|
+
| `provider` | `'openai'` | Yes | Provider identifier |
|
|
96
|
+
| `apiKey` | `string` | Yes | OpenAI API key |
|
|
97
|
+
| `defaultModel` | `string` | No | Default model to use |
|
|
98
|
+
| `baseUrl` | `string` | No | Custom API base URL |
|
|
99
|
+
| `organization` | `string` | No | OpenAI organization ID |
|
|
100
|
+
| `timeout` | `number` | No | Request timeout (ms) |
|
|
101
|
+
| `maxRetries` | `number` | No | Max retry attempts |
|
|
102
|
+
|
|
103
|
+
### Azure OpenAI
|
|
104
|
+
|
|
105
|
+
| Option | Type | Required | Description |
|
|
106
|
+
|--------|------|----------|-------------|
|
|
107
|
+
| `provider` | `'azure-openai'` | Yes | Provider identifier |
|
|
108
|
+
| `apiKey` | `string` | Yes | Azure OpenAI API key |
|
|
109
|
+
| `resourceName` | `string` | Yes | Azure resource name |
|
|
110
|
+
| `deploymentName` | `string` | Yes | Model deployment name |
|
|
111
|
+
| `apiVersion` | `string` | Yes | API version |
|
|
112
|
+
| `timeout` | `number` | No | Request timeout (ms) |
|
|
113
|
+
| `maxRetries` | `number` | No | Max retry attempts |
|
|
114
|
+
|
|
115
|
+
## Environment Variables
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# OpenAI
|
|
119
|
+
OPENAI_API_KEY=sk-...
|
|
120
|
+
|
|
121
|
+
# Azure OpenAI
|
|
122
|
+
AZURE_OPENAI_API_KEY=...
|
|
123
|
+
AZURE_OPENAI_RESOURCE=my-resource
|
|
124
|
+
AZURE_OPENAI_DEPLOYMENT=my-deployment
|
|
125
|
+
AZURE_OPENAI_API_VERSION=2024-02-15-preview
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Supported Models
|
|
129
|
+
|
|
130
|
+
### OpenAI
|
|
131
|
+
|
|
132
|
+
| Model | Description |
|
|
133
|
+
|-------|-------------|
|
|
134
|
+
| `gpt-5.2` | Latest flagship model for professional work |
|
|
135
|
+
| `gpt-5.1` | Previous flagship in GPT-5 series |
|
|
136
|
+
| `gpt-4.1` | High performance with 1M token context |
|
|
137
|
+
| `gpt-4.1-mini` | Smaller, faster version of GPT-4.1 |
|
|
138
|
+
| `gpt-4.1-nano` | Fastest, most cost-efficient |
|
|
139
|
+
| `gpt-4o` | Multimodal model (text + vision) |
|
|
140
|
+
| `gpt-4o-mini` | Smaller multimodal model |
|
|
141
|
+
|
|
142
|
+
### Azure OpenAI
|
|
143
|
+
|
|
144
|
+
Any model deployed to your Azure OpenAI resource. Common deployments include GPT-4o, GPT-4, and GPT-3.5-turbo.
|
|
145
|
+
|
|
146
|
+
## Related Packages
|
|
147
|
+
|
|
148
|
+
- [`@artemiskit/cli`](https://www.npmjs.com/package/@artemiskit/cli) - Command-line interface
|
|
149
|
+
- [`@artemiskit/core`](https://www.npmjs.com/package/@artemiskit/core) - Core runtime
|
|
150
|
+
- [`@artemiskit/adapter-anthropic`](https://www.npmjs.com/package/@artemiskit/adapter-anthropic) - Anthropic adapter
|
|
151
|
+
- [`@artemiskit/adapter-vercel-ai`](https://www.npmjs.com/package/@artemiskit/adapter-vercel-ai) - Vercel AI SDK adapter
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artemiskit/adapter-openai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "OpenAI and Azure OpenAI adapter for ArtemisKit LLM evaluation toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,14 +13,8 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/code-sensei/artemiskit/issues"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"openai",
|
|
19
|
-
"azure",
|
|
20
|
-
"gpt-4",
|
|
21
|
-
"adapter",
|
|
22
|
-
"artemiskit"
|
|
23
|
-
],
|
|
16
|
+
"homepage": "https://artemiskit.vercel.app",
|
|
17
|
+
"keywords": ["llm", "openai", "azure", "gpt-4", "adapter", "artemiskit"],
|
|
24
18
|
"main": "./dist/index.js",
|
|
25
19
|
"types": "./dist/index.d.ts",
|
|
26
20
|
"exports": {
|
|
@@ -36,7 +30,7 @@
|
|
|
36
30
|
"test": "bun test"
|
|
37
31
|
},
|
|
38
32
|
"dependencies": {
|
|
39
|
-
"@artemiskit/core": "
|
|
33
|
+
"@artemiskit/core": "0.1.4",
|
|
40
34
|
"openai": "^4.28.0",
|
|
41
35
|
"nanoid": "^5.0.0"
|
|
42
36
|
},
|