@apertis/ai-sdk-provider 0.1.1 → 1.1.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/README.md +78 -1
- package/dist/index.cjs +460 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -7
- package/dist/index.d.ts +68 -7
- package/dist/index.js +465 -50
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Apertis AI provider for the [Vercel AI SDK](https://sdk.vercel.ai/).
|
|
4
4
|
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
- **Requires AI SDK 6.0+** - This package implements the `LanguageModelV3` specification
|
|
8
|
+
- **Node.js 18+** - Minimum supported Node.js version
|
|
9
|
+
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
|
-
npm install @apertis/ai-sdk-provider
|
|
13
|
+
npm install @apertis/ai-sdk-provider ai
|
|
9
14
|
```
|
|
10
15
|
|
|
11
16
|
## Setup
|
|
@@ -74,15 +79,87 @@ const { text } = await generateText({
|
|
|
74
79
|
});
|
|
75
80
|
```
|
|
76
81
|
|
|
82
|
+
### Text Completions
|
|
83
|
+
|
|
84
|
+
For models that support the legacy completion API:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { apertis } from '@apertis/ai-sdk-provider';
|
|
88
|
+
import { generateText } from 'ai';
|
|
89
|
+
|
|
90
|
+
const { text } = await generateText({
|
|
91
|
+
model: apertis.completion('gpt-3.5-turbo-instruct'),
|
|
92
|
+
prompt: 'Complete this: The quick brown fox',
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Embeddings
|
|
97
|
+
|
|
98
|
+
Generate vector embeddings for semantic search and similarity:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { apertis } from '@apertis/ai-sdk-provider';
|
|
102
|
+
import { embed, embedMany } from 'ai';
|
|
103
|
+
|
|
104
|
+
// Single embedding
|
|
105
|
+
const { embedding } = await embed({
|
|
106
|
+
model: apertis.textEmbeddingModel('text-embedding-3-small'),
|
|
107
|
+
value: 'Hello world',
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Multiple embeddings
|
|
111
|
+
const { embeddings } = await embedMany({
|
|
112
|
+
model: apertis.textEmbeddingModel('text-embedding-3-large', {
|
|
113
|
+
dimensions: 1024, // Optional: reduce dimensions
|
|
114
|
+
}),
|
|
115
|
+
values: ['Hello', 'World'],
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
77
119
|
## Supported Models
|
|
78
120
|
|
|
79
121
|
Any model available on Apertis AI, including:
|
|
80
122
|
|
|
123
|
+
### Chat Models
|
|
81
124
|
- `gpt-5.2`, `gpt-5.2-codex`, `gpt-5.1`
|
|
82
125
|
- `claude-opus-4-5-20251101`, `claude-sonnet-4.5`, `claude-haiku-4.5`
|
|
83
126
|
- `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-flash-preview`
|
|
84
127
|
- And 470+ more models
|
|
85
128
|
|
|
129
|
+
### Completion Models
|
|
130
|
+
- `gpt-3.5-turbo-instruct`
|
|
131
|
+
- `davinci-002`, `babbage-002`
|
|
132
|
+
|
|
133
|
+
### Embedding Models
|
|
134
|
+
- `text-embedding-3-small`, `text-embedding-3-large`
|
|
135
|
+
- `text-embedding-ada-002`
|
|
136
|
+
|
|
137
|
+
## Provider Configuration
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { createApertis } from '@apertis/ai-sdk-provider';
|
|
141
|
+
|
|
142
|
+
const apertis = createApertis({
|
|
143
|
+
apiKey: 'sk-your-api-key', // Optional if APERTIS_API_KEY is set
|
|
144
|
+
baseURL: 'https://api.apertis.ai/v1', // Custom API endpoint
|
|
145
|
+
headers: { 'X-Custom': 'value' }, // Custom headers
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## What's New (v1.1.0)
|
|
150
|
+
|
|
151
|
+
- **ProviderV3 Interface** - Full implementation of `ProviderV3` specification
|
|
152
|
+
- **Completion Models** - Support for text completion via `apertis.completion()`
|
|
153
|
+
- **Embedding Models** - Support for embeddings via `apertis.textEmbeddingModel()`
|
|
154
|
+
|
|
155
|
+
## Breaking Changes (v1.0.0)
|
|
156
|
+
|
|
157
|
+
- **Requires AI SDK 6+** - No longer compatible with AI SDK 5.x
|
|
158
|
+
- **V3 Specification** - Implements `LanguageModelV3` interface
|
|
159
|
+
- **Content format** - Output uses `content` array instead of separate `text`/`toolCalls`
|
|
160
|
+
- **Usage format** - Token tracking uses new `inputTokens`/`outputTokens` structure
|
|
161
|
+
- **Supported URLs** - New `supportedUrls` property for image URL support
|
|
162
|
+
|
|
86
163
|
## License
|
|
87
164
|
|
|
88
165
|
Apache-2.0
|