@ai-sdk/azure 1.3.23 → 2.0.0-alpha.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/CHANGELOG.md +231 -61
- package/dist/index.d.mts +12 -13
- package/dist/index.d.ts +12 -13
- package/dist/index.js +12 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,133 +1,303 @@
|
|
|
1
1
|
# @ai-sdk/azure
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 2.0.0-alpha.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- @ai-sdk/provider
|
|
9
|
-
- @ai-sdk/openai@
|
|
7
|
+
- Updated dependencies [3f2f00c]
|
|
8
|
+
- @ai-sdk/provider@2.0.0-alpha.1
|
|
9
|
+
- @ai-sdk/openai@2.0.0-alpha.1
|
|
10
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.1
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## 2.0.0-canary.21
|
|
12
13
|
|
|
13
14
|
### Patch Changes
|
|
14
15
|
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- @ai-sdk/
|
|
16
|
+
- Updated dependencies [faf8446]
|
|
17
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
|
18
|
+
- @ai-sdk/openai@2.0.0-canary.20
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## 2.0.0-canary.20
|
|
19
21
|
|
|
20
22
|
### Patch Changes
|
|
21
23
|
|
|
22
|
-
- Updated dependencies [
|
|
23
|
-
- @ai-sdk/
|
|
24
|
+
- Updated dependencies [40acf9b]
|
|
25
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
|
26
|
+
- @ai-sdk/openai@2.0.0-canary.19
|
|
24
27
|
|
|
25
|
-
##
|
|
28
|
+
## 2.0.0-canary.19
|
|
29
|
+
|
|
30
|
+
### Major Changes
|
|
31
|
+
|
|
32
|
+
- 516be5b: ### Move Image Model Settings into generate options
|
|
33
|
+
|
|
34
|
+
Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
|
|
35
|
+
|
|
36
|
+
Before
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
await generateImage({
|
|
40
|
+
model: luma.image('photon-flash-1', {
|
|
41
|
+
maxImagesPerCall: 5,
|
|
42
|
+
pollIntervalMillis: 500,
|
|
43
|
+
}),
|
|
44
|
+
prompt,
|
|
45
|
+
n: 10,
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
After
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
await generateImage({
|
|
53
|
+
model: luma.image('photon-flash-1'),
|
|
54
|
+
prompt,
|
|
55
|
+
n: 10,
|
|
56
|
+
maxImagesPerCall: 5,
|
|
57
|
+
providerOptions: {
|
|
58
|
+
luma: { pollIntervalMillis: 5 },
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Pull Request: https://github.com/vercel/ai/pull/6180
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [516be5b]
|
|
68
|
+
- Updated dependencies [ea7a7c9]
|
|
69
|
+
- @ai-sdk/openai@2.0.0-canary.18
|
|
70
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
|
71
|
+
|
|
72
|
+
## 2.0.0-canary.18
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 52ce942: chore(providers/openai): remove & enable strict compatibility by default
|
|
77
|
+
- Updated dependencies [52ce942]
|
|
78
|
+
- Updated dependencies [87b828f]
|
|
79
|
+
- @ai-sdk/openai@2.0.0-canary.17
|
|
80
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
|
81
|
+
|
|
82
|
+
## 2.0.0-canary.17
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies [a571d6e]
|
|
87
|
+
- Updated dependencies [a8c8bd5]
|
|
88
|
+
- Updated dependencies [7979f7f]
|
|
89
|
+
- Updated dependencies [928fadf]
|
|
90
|
+
- Updated dependencies [41fa418]
|
|
91
|
+
- Updated dependencies [6f231db]
|
|
92
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
93
|
+
- @ai-sdk/provider@2.0.0-canary.14
|
|
94
|
+
- @ai-sdk/openai@2.0.0-canary.16
|
|
95
|
+
|
|
96
|
+
## 2.0.0-canary.16
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- Updated dependencies [957b739]
|
|
101
|
+
- Updated dependencies [136819b]
|
|
102
|
+
- Updated dependencies [9bd5ab5]
|
|
103
|
+
- Updated dependencies [284353f]
|
|
104
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
|
105
|
+
- @ai-sdk/openai@2.0.0-canary.15
|
|
106
|
+
- @ai-sdk/provider@2.0.0-canary.13
|
|
107
|
+
|
|
108
|
+
## 2.0.0-canary.15
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [7b3ae3f]
|
|
113
|
+
- Updated dependencies [0ff02bb]
|
|
114
|
+
- Updated dependencies [fa758ea]
|
|
115
|
+
- @ai-sdk/provider@2.0.0-canary.12
|
|
116
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
|
117
|
+
- @ai-sdk/openai@2.0.0-canary.14
|
|
118
|
+
|
|
119
|
+
## 2.0.0-canary.14
|
|
26
120
|
|
|
27
121
|
### Patch Changes
|
|
28
122
|
|
|
29
|
-
-
|
|
30
|
-
|
|
123
|
+
- 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
|
|
124
|
+
- 4617fab: chore(embedding-models): remove remaining settings
|
|
125
|
+
- Updated dependencies [177526b]
|
|
126
|
+
- Updated dependencies [c15dfbf]
|
|
127
|
+
- Updated dependencies [9bf7291]
|
|
128
|
+
- Updated dependencies [4617fab]
|
|
129
|
+
- Updated dependencies [e030615]
|
|
130
|
+
- @ai-sdk/openai@2.0.0-canary.13
|
|
131
|
+
- @ai-sdk/provider@2.0.0-canary.11
|
|
132
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
|
31
133
|
|
|
32
|
-
##
|
|
134
|
+
## 2.0.0-canary.13
|
|
33
135
|
|
|
34
136
|
### Patch Changes
|
|
35
137
|
|
|
36
|
-
-
|
|
37
|
-
|
|
138
|
+
- db72adc: chore(providers/openai): update completion model to use providerOptions
|
|
139
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
140
|
+
- Updated dependencies [db72adc]
|
|
141
|
+
- Updated dependencies [66962ed]
|
|
142
|
+
- Updated dependencies [9301f86]
|
|
143
|
+
- Updated dependencies [a3f768e]
|
|
144
|
+
- Updated dependencies [7df7a25]
|
|
145
|
+
- @ai-sdk/openai@2.0.0-canary.12
|
|
146
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
|
147
|
+
- @ai-sdk/provider@2.0.0-canary.10
|
|
38
148
|
|
|
39
|
-
##
|
|
149
|
+
## 2.0.0-canary.12
|
|
40
150
|
|
|
41
151
|
### Patch Changes
|
|
42
152
|
|
|
43
|
-
- Updated dependencies [
|
|
44
|
-
|
|
153
|
+
- Updated dependencies [e86be6f]
|
|
154
|
+
- Updated dependencies [8493141]
|
|
155
|
+
- @ai-sdk/provider@2.0.0-canary.9
|
|
156
|
+
- @ai-sdk/openai@2.0.0-canary.11
|
|
157
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
|
45
158
|
|
|
46
|
-
##
|
|
159
|
+
## 2.0.0-canary.11
|
|
47
160
|
|
|
48
161
|
### Patch Changes
|
|
49
162
|
|
|
50
|
-
- Updated dependencies [
|
|
51
|
-
|
|
163
|
+
- Updated dependencies [95857aa]
|
|
164
|
+
- Updated dependencies [3bd3c0b]
|
|
165
|
+
- Updated dependencies [7ea4132]
|
|
166
|
+
- @ai-sdk/provider@2.0.0-canary.8
|
|
167
|
+
- @ai-sdk/openai@2.0.0-canary.10
|
|
168
|
+
- @ai-sdk/provider-utils@3.0.0-canary.9
|
|
52
169
|
|
|
53
|
-
##
|
|
170
|
+
## 2.0.0-canary.10
|
|
54
171
|
|
|
55
172
|
### Patch Changes
|
|
56
173
|
|
|
57
|
-
- Updated dependencies [
|
|
58
|
-
|
|
174
|
+
- Updated dependencies [d63bcbc]
|
|
175
|
+
- Updated dependencies [d2af019]
|
|
176
|
+
- Updated dependencies [870c5c0]
|
|
177
|
+
- Updated dependencies [06bac05]
|
|
178
|
+
- @ai-sdk/openai@2.0.0-canary.9
|
|
59
179
|
|
|
60
|
-
##
|
|
180
|
+
## 2.0.0-canary.9
|
|
61
181
|
|
|
62
182
|
### Patch Changes
|
|
63
183
|
|
|
64
|
-
-
|
|
65
|
-
|
|
184
|
+
- 3b13ccf: feat(providers/azure): add transcribe
|
|
185
|
+
- Updated dependencies [5d142ab]
|
|
186
|
+
- Updated dependencies [b6b43c7]
|
|
187
|
+
- Updated dependencies [8aa9e20]
|
|
188
|
+
- Updated dependencies [3795467]
|
|
189
|
+
- @ai-sdk/provider-utils@3.0.0-canary.8
|
|
190
|
+
- @ai-sdk/provider@2.0.0-canary.7
|
|
191
|
+
- @ai-sdk/openai@2.0.0-canary.8
|
|
66
192
|
|
|
67
|
-
##
|
|
193
|
+
## 2.0.0-canary.8
|
|
68
194
|
|
|
69
195
|
### Patch Changes
|
|
70
196
|
|
|
71
|
-
- Updated dependencies [
|
|
72
|
-
|
|
197
|
+
- Updated dependencies [26735b5]
|
|
198
|
+
- Updated dependencies [443d8ec]
|
|
199
|
+
- Updated dependencies [14c9410]
|
|
200
|
+
- Updated dependencies [d9c98f4]
|
|
201
|
+
- Updated dependencies [c4a2fec]
|
|
202
|
+
- Updated dependencies [0054544]
|
|
203
|
+
- Updated dependencies [9e9c809]
|
|
204
|
+
- Updated dependencies [32831c6]
|
|
205
|
+
- Updated dependencies [d0f9495]
|
|
206
|
+
- Updated dependencies [fd65bc6]
|
|
207
|
+
- Updated dependencies [393138b]
|
|
208
|
+
- Updated dependencies [7182d14]
|
|
209
|
+
- @ai-sdk/provider@2.0.0-canary.6
|
|
210
|
+
- @ai-sdk/openai@2.0.0-canary.7
|
|
211
|
+
- @ai-sdk/provider-utils@3.0.0-canary.7
|
|
73
212
|
|
|
74
|
-
##
|
|
213
|
+
## 2.0.0-canary.7
|
|
75
214
|
|
|
76
215
|
### Patch Changes
|
|
77
216
|
|
|
78
|
-
- Updated dependencies [
|
|
79
|
-
|
|
217
|
+
- Updated dependencies [948b755]
|
|
218
|
+
- Updated dependencies [3b1ea10]
|
|
219
|
+
- Updated dependencies [411e483]
|
|
220
|
+
- Updated dependencies [442be08]
|
|
221
|
+
- Updated dependencies [79457bd]
|
|
222
|
+
- Updated dependencies [ad80501]
|
|
223
|
+
- Updated dependencies [5147e6e]
|
|
224
|
+
- Updated dependencies [c2b92cc]
|
|
225
|
+
- Updated dependencies [1766ede]
|
|
226
|
+
- Updated dependencies [f10304b]
|
|
227
|
+
- @ai-sdk/openai@2.0.0-canary.6
|
|
228
|
+
- @ai-sdk/provider@2.0.0-canary.5
|
|
229
|
+
- @ai-sdk/provider-utils@3.0.0-canary.6
|
|
80
230
|
|
|
81
|
-
##
|
|
231
|
+
## 2.0.0-canary.6
|
|
82
232
|
|
|
83
233
|
### Patch Changes
|
|
84
234
|
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
- @ai-sdk/
|
|
88
|
-
- @ai-sdk/
|
|
89
|
-
- @ai-sdk/provider-utils@2.2.7
|
|
235
|
+
- Updated dependencies [6f6bb89]
|
|
236
|
+
- @ai-sdk/provider@2.0.0-canary.4
|
|
237
|
+
- @ai-sdk/openai@2.0.0-canary.5
|
|
238
|
+
- @ai-sdk/provider-utils@3.0.0-canary.5
|
|
90
239
|
|
|
91
|
-
##
|
|
240
|
+
## 2.0.0-canary.5
|
|
92
241
|
|
|
93
242
|
### Patch Changes
|
|
94
243
|
|
|
95
|
-
- Updated dependencies [
|
|
96
|
-
-
|
|
97
|
-
- @ai-sdk/openai@
|
|
244
|
+
- Updated dependencies [d1a1aa1]
|
|
245
|
+
- @ai-sdk/provider@2.0.0-canary.3
|
|
246
|
+
- @ai-sdk/openai@2.0.0-canary.4
|
|
247
|
+
- @ai-sdk/provider-utils@3.0.0-canary.4
|
|
98
248
|
|
|
99
|
-
##
|
|
249
|
+
## 2.0.0-canary.4
|
|
100
250
|
|
|
101
251
|
### Patch Changes
|
|
102
252
|
|
|
103
|
-
- Updated dependencies [
|
|
104
|
-
- Updated dependencies [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
253
|
+
- Updated dependencies [a166433]
|
|
254
|
+
- Updated dependencies [abf9a79]
|
|
255
|
+
- Updated dependencies [9f95b35]
|
|
256
|
+
- Updated dependencies [0a87932]
|
|
257
|
+
- Updated dependencies [6dc848c]
|
|
258
|
+
- Updated dependencies [0a87932]
|
|
259
|
+
- @ai-sdk/provider-utils@3.0.0-canary.3
|
|
260
|
+
- @ai-sdk/provider@2.0.0-canary.2
|
|
261
|
+
- @ai-sdk/openai@2.0.0-canary.3
|
|
108
262
|
|
|
109
|
-
##
|
|
263
|
+
## 2.0.0-canary.3
|
|
110
264
|
|
|
111
265
|
### Patch Changes
|
|
112
266
|
|
|
113
|
-
- Updated dependencies [
|
|
114
|
-
|
|
115
|
-
- @ai-sdk/provider@
|
|
116
|
-
- @ai-sdk/openai@
|
|
267
|
+
- Updated dependencies [c57e248]
|
|
268
|
+
- Updated dependencies [33f4a6a]
|
|
269
|
+
- @ai-sdk/provider@2.0.0-canary.1
|
|
270
|
+
- @ai-sdk/openai@2.0.0-canary.2
|
|
271
|
+
- @ai-sdk/provider-utils@3.0.0-canary.2
|
|
117
272
|
|
|
118
|
-
##
|
|
273
|
+
## 2.0.0-canary.2
|
|
119
274
|
|
|
120
275
|
### Patch Changes
|
|
121
276
|
|
|
122
|
-
-
|
|
277
|
+
- c467b38: feat (provider/azure): add OpenAI responses API support
|
|
278
|
+
|
|
279
|
+
## 2.0.0-canary.1
|
|
280
|
+
|
|
281
|
+
### Patch Changes
|
|
282
|
+
|
|
283
|
+
- Updated dependencies [060370c]
|
|
284
|
+
- Updated dependencies [0c0c0b3]
|
|
285
|
+
- Updated dependencies [63d791d]
|
|
286
|
+
- @ai-sdk/provider-utils@3.0.0-canary.1
|
|
287
|
+
- @ai-sdk/openai@2.0.0-canary.1
|
|
288
|
+
|
|
289
|
+
## 2.0.0-canary.0
|
|
290
|
+
|
|
291
|
+
### Major Changes
|
|
123
292
|
|
|
124
|
-
|
|
293
|
+
- d5f588f: AI SDK 5
|
|
125
294
|
|
|
126
295
|
### Patch Changes
|
|
127
296
|
|
|
128
|
-
- Updated dependencies [
|
|
129
|
-
- @ai-sdk/provider-utils@
|
|
130
|
-
- @ai-sdk/openai@
|
|
297
|
+
- Updated dependencies [d5f588f]
|
|
298
|
+
- @ai-sdk/provider-utils@3.0.0-canary.0
|
|
299
|
+
- @ai-sdk/openai@2.0.0-canary.0
|
|
300
|
+
- @ai-sdk/provider@2.0.0-canary.0
|
|
131
301
|
|
|
132
302
|
## 1.3.6
|
|
133
303
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProviderV1, LanguageModelV1, EmbeddingModelV1, ImageModelV1, TranscriptionModelV1 } from '@ai-sdk/provider';
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV1 } from '@ai-sdk/provider';
|
|
3
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
3
|
|
|
5
|
-
interface AzureOpenAIProvider extends
|
|
6
|
-
(deploymentId: string
|
|
4
|
+
interface AzureOpenAIProvider extends ProviderV2 {
|
|
5
|
+
(deploymentId: string): LanguageModelV2;
|
|
7
6
|
/**
|
|
8
7
|
Creates an Azure OpenAI chat model for text generation.
|
|
9
8
|
*/
|
|
10
|
-
languageModel(deploymentId: string
|
|
9
|
+
languageModel(deploymentId: string): LanguageModelV2;
|
|
11
10
|
/**
|
|
12
11
|
Creates an Azure OpenAI chat model for text generation.
|
|
13
12
|
*/
|
|
14
|
-
chat(deploymentId: string
|
|
13
|
+
chat(deploymentId: string): LanguageModelV2;
|
|
15
14
|
/**
|
|
16
15
|
Creates an Azure OpenAI responses API model for text generation.
|
|
17
16
|
*/
|
|
18
|
-
responses(deploymentId: string):
|
|
17
|
+
responses(deploymentId: string): LanguageModelV2;
|
|
19
18
|
/**
|
|
20
19
|
Creates an Azure OpenAI completion model for text generation.
|
|
21
20
|
*/
|
|
22
|
-
completion(deploymentId: string
|
|
21
|
+
completion(deploymentId: string): LanguageModelV2;
|
|
23
22
|
/**
|
|
24
23
|
@deprecated Use `textEmbeddingModel` instead.
|
|
25
24
|
*/
|
|
26
|
-
embedding(deploymentId: string
|
|
25
|
+
embedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
27
26
|
/**
|
|
28
27
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
29
28
|
* @deprecated Use `imageModel` instead.
|
|
30
29
|
*/
|
|
31
|
-
image(deploymentId: string
|
|
30
|
+
image(deploymentId: string): ImageModelV2;
|
|
32
31
|
/**
|
|
33
32
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
34
33
|
*/
|
|
35
|
-
imageModel(deploymentId: string
|
|
34
|
+
imageModel(deploymentId: string): ImageModelV2;
|
|
36
35
|
/**
|
|
37
36
|
@deprecated Use `textEmbeddingModel` instead.
|
|
38
37
|
*/
|
|
39
|
-
textEmbedding(deploymentId: string
|
|
38
|
+
textEmbedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
40
39
|
/**
|
|
41
40
|
Creates an Azure OpenAI model for text embeddings.
|
|
42
41
|
*/
|
|
43
|
-
textEmbeddingModel(deploymentId: string
|
|
42
|
+
textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;
|
|
44
43
|
/**
|
|
45
44
|
* Creates an Azure OpenAI model for audio transcription.
|
|
46
45
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProviderV1, LanguageModelV1, EmbeddingModelV1, ImageModelV1, TranscriptionModelV1 } from '@ai-sdk/provider';
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV1 } from '@ai-sdk/provider';
|
|
3
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
3
|
|
|
5
|
-
interface AzureOpenAIProvider extends
|
|
6
|
-
(deploymentId: string
|
|
4
|
+
interface AzureOpenAIProvider extends ProviderV2 {
|
|
5
|
+
(deploymentId: string): LanguageModelV2;
|
|
7
6
|
/**
|
|
8
7
|
Creates an Azure OpenAI chat model for text generation.
|
|
9
8
|
*/
|
|
10
|
-
languageModel(deploymentId: string
|
|
9
|
+
languageModel(deploymentId: string): LanguageModelV2;
|
|
11
10
|
/**
|
|
12
11
|
Creates an Azure OpenAI chat model for text generation.
|
|
13
12
|
*/
|
|
14
|
-
chat(deploymentId: string
|
|
13
|
+
chat(deploymentId: string): LanguageModelV2;
|
|
15
14
|
/**
|
|
16
15
|
Creates an Azure OpenAI responses API model for text generation.
|
|
17
16
|
*/
|
|
18
|
-
responses(deploymentId: string):
|
|
17
|
+
responses(deploymentId: string): LanguageModelV2;
|
|
19
18
|
/**
|
|
20
19
|
Creates an Azure OpenAI completion model for text generation.
|
|
21
20
|
*/
|
|
22
|
-
completion(deploymentId: string
|
|
21
|
+
completion(deploymentId: string): LanguageModelV2;
|
|
23
22
|
/**
|
|
24
23
|
@deprecated Use `textEmbeddingModel` instead.
|
|
25
24
|
*/
|
|
26
|
-
embedding(deploymentId: string
|
|
25
|
+
embedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
27
26
|
/**
|
|
28
27
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
29
28
|
* @deprecated Use `imageModel` instead.
|
|
30
29
|
*/
|
|
31
|
-
image(deploymentId: string
|
|
30
|
+
image(deploymentId: string): ImageModelV2;
|
|
32
31
|
/**
|
|
33
32
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
34
33
|
*/
|
|
35
|
-
imageModel(deploymentId: string
|
|
34
|
+
imageModel(deploymentId: string): ImageModelV2;
|
|
36
35
|
/**
|
|
37
36
|
@deprecated Use `textEmbeddingModel` instead.
|
|
38
37
|
*/
|
|
39
|
-
textEmbedding(deploymentId: string
|
|
38
|
+
textEmbedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
40
39
|
/**
|
|
41
40
|
Creates an Azure OpenAI model for text embeddings.
|
|
42
41
|
*/
|
|
43
|
-
textEmbeddingModel(deploymentId: string
|
|
42
|
+
textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;
|
|
44
43
|
/**
|
|
45
44
|
* Creates an Azure OpenAI model for audio transcription.
|
|
46
45
|
*/
|
package/dist/index.js
CHANGED
|
@@ -51,51 +51,49 @@ function createAzure(options = {}) {
|
|
|
51
51
|
}
|
|
52
52
|
return options.baseURL ? `${options.baseURL}/${modelId}${path}?api-version=${apiVersion}` : `https://${getResourceName()}.openai.azure.com/openai/deployments/${modelId}${path}?api-version=${apiVersion}`;
|
|
53
53
|
};
|
|
54
|
-
const createChatModel = (deploymentName
|
|
55
|
-
provider: "azure
|
|
54
|
+
const createChatModel = (deploymentName) => new import_internal.OpenAIChatLanguageModel(deploymentName, {
|
|
55
|
+
provider: "azure.chat",
|
|
56
56
|
url,
|
|
57
57
|
headers: getHeaders,
|
|
58
|
-
compatibility: "strict",
|
|
59
58
|
fetch: options.fetch
|
|
60
59
|
});
|
|
61
|
-
const createCompletionModel = (modelId
|
|
62
|
-
provider: "azure
|
|
60
|
+
const createCompletionModel = (modelId) => new import_internal.OpenAICompletionLanguageModel(modelId, {
|
|
61
|
+
provider: "azure.completion",
|
|
63
62
|
url,
|
|
64
|
-
compatibility: "strict",
|
|
65
63
|
headers: getHeaders,
|
|
66
64
|
fetch: options.fetch
|
|
67
65
|
});
|
|
68
|
-
const createEmbeddingModel = (modelId
|
|
69
|
-
provider: "azure
|
|
66
|
+
const createEmbeddingModel = (modelId) => new import_internal.OpenAIEmbeddingModel(modelId, {
|
|
67
|
+
provider: "azure.embeddings",
|
|
70
68
|
headers: getHeaders,
|
|
71
69
|
url,
|
|
72
70
|
fetch: options.fetch
|
|
73
71
|
});
|
|
74
72
|
const createResponsesModel = (modelId) => new import_internal.OpenAIResponsesLanguageModel(modelId, {
|
|
75
|
-
provider: "azure
|
|
73
|
+
provider: "azure.responses",
|
|
76
74
|
url,
|
|
77
75
|
headers: getHeaders,
|
|
78
76
|
fetch: options.fetch
|
|
79
77
|
});
|
|
80
|
-
const createImageModel = (modelId
|
|
81
|
-
provider: "azure
|
|
78
|
+
const createImageModel = (modelId) => new import_internal.OpenAIImageModel(modelId, {
|
|
79
|
+
provider: "azure.image",
|
|
82
80
|
url,
|
|
83
81
|
headers: getHeaders,
|
|
84
82
|
fetch: options.fetch
|
|
85
83
|
});
|
|
86
84
|
const createTranscriptionModel = (modelId) => new import_internal.OpenAITranscriptionModel(modelId, {
|
|
87
|
-
provider: "azure
|
|
85
|
+
provider: "azure.transcription",
|
|
88
86
|
url,
|
|
89
87
|
headers: getHeaders,
|
|
90
88
|
fetch: options.fetch
|
|
91
89
|
});
|
|
92
|
-
const provider = function(deploymentId
|
|
90
|
+
const provider = function(deploymentId) {
|
|
93
91
|
if (new.target) {
|
|
94
92
|
throw new Error(
|
|
95
93
|
"The Azure OpenAI model function cannot be called with the new keyword."
|
|
96
94
|
);
|
|
97
95
|
}
|
|
98
|
-
return createChatModel(deploymentId
|
|
96
|
+
return createChatModel(deploymentId);
|
|
99
97
|
};
|
|
100
98
|
provider.languageModel = createChatModel;
|
|
101
99
|
provider.chat = createChatModel;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/azure-openai-provider.ts"],"sourcesContent":["export { azure, createAzure } from './azure-openai-provider';\nexport type {\n AzureOpenAIProvider,\n AzureOpenAIProviderSettings,\n} from './azure-openai-provider';\n","import {\n OpenAIChatLanguageModel,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/azure-openai-provider.ts"],"sourcesContent":["export { azure, createAzure } from './azure-openai-provider';\nexport type {\n AzureOpenAIProvider,\n AzureOpenAIProviderSettings,\n} from './azure-openai-provider';\n","import {\n OpenAIChatLanguageModel,\n OpenAICompletionLanguageModel,\n OpenAIEmbeddingModel,\n OpenAIImageModel,\n OpenAIResponsesLanguageModel,\n OpenAITranscriptionModel,\n} from '@ai-sdk/openai/internal';\nimport {\n EmbeddingModelV2,\n LanguageModelV2,\n ProviderV2,\n ImageModelV2,\n TranscriptionModelV1,\n} from '@ai-sdk/provider';\nimport { FetchFunction, loadApiKey, loadSetting } from '@ai-sdk/provider-utils';\n\nexport interface AzureOpenAIProvider extends ProviderV2 {\n (deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI chat model for text generation.\n */\n languageModel(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI chat model for text generation.\n */\n chat(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI responses API model for text generation.\n */\n responses(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI completion model for text generation.\n */\n completion(deploymentId: string): LanguageModelV2;\n\n /**\n@deprecated Use `textEmbeddingModel` instead.\n */\n embedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\n * @deprecated Use `imageModel` instead.\n */\n image(deploymentId: string): ImageModelV2;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\n */\n imageModel(deploymentId: string): ImageModelV2;\n\n /**\n@deprecated Use `textEmbeddingModel` instead.\n */\n textEmbedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\nCreates an Azure OpenAI model for text embeddings.\n */\n textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI model for audio transcription.\n */\n transcription(deploymentId: string): TranscriptionModelV1;\n}\n\nexport interface AzureOpenAIProviderSettings {\n /**\nName of the Azure OpenAI resource. Either this or `baseURL` can be used.\n\nThe resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/deployments/{modelId}{path}`.\n */\n resourceName?: string;\n\n /**\nUse a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.\nWhen a baseURL is provided, the resourceName is ignored.\n\nWith a baseURL, the resolved URL is `{baseURL}/{modelId}{path}`.\n */\n baseURL?: string;\n\n /**\nAPI key for authenticating requests.\n */\n apiKey?: string;\n\n /**\nCustom headers to include in the requests.\n */\n headers?: Record<string, string>;\n\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n */\n fetch?: FetchFunction;\n\n /**\nCustom api version to use. Defaults to `2024-10-01-preview`.\n */\n apiVersion?: string;\n}\n\n/**\nCreate an Azure OpenAI provider instance.\n */\nexport function createAzure(\n options: AzureOpenAIProviderSettings = {},\n): AzureOpenAIProvider {\n const getHeaders = () => ({\n 'api-key': loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'AZURE_API_KEY',\n description: 'Azure OpenAI',\n }),\n ...options.headers,\n });\n\n const getResourceName = () =>\n loadSetting({\n settingValue: options.resourceName,\n settingName: 'resourceName',\n environmentVariableName: 'AZURE_RESOURCE_NAME',\n description: 'Azure OpenAI resource name',\n });\n\n const apiVersion = options.apiVersion ?? '2025-03-01-preview';\n const url = ({ path, modelId }: { path: string; modelId: string }) => {\n if (path === '/responses') {\n return options.baseURL\n ? `${options.baseURL}${path}?api-version=${apiVersion}`\n : `https://${getResourceName()}.openai.azure.com/openai/responses?api-version=${apiVersion}`;\n }\n\n // Default URL format for other endpoints\n return options.baseURL\n ? `${options.baseURL}/${modelId}${path}?api-version=${apiVersion}`\n : `https://${getResourceName()}.openai.azure.com/openai/deployments/${modelId}${path}?api-version=${apiVersion}`;\n };\n\n const createChatModel = (deploymentName: string) =>\n new OpenAIChatLanguageModel(deploymentName, {\n provider: 'azure.chat',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createCompletionModel = (modelId: string) =>\n new OpenAICompletionLanguageModel(modelId, {\n provider: 'azure.completion',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createEmbeddingModel = (modelId: string) =>\n new OpenAIEmbeddingModel(modelId, {\n provider: 'azure.embeddings',\n headers: getHeaders,\n url,\n fetch: options.fetch,\n });\n\n const createResponsesModel = (modelId: string) =>\n new OpenAIResponsesLanguageModel(modelId, {\n provider: 'azure.responses',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createImageModel = (modelId: string) =>\n new OpenAIImageModel(modelId, {\n provider: 'azure.image',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createTranscriptionModel = (modelId: string) =>\n new OpenAITranscriptionModel(modelId, {\n provider: 'azure.transcription',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const provider = function (deploymentId: string) {\n if (new.target) {\n throw new Error(\n 'The Azure OpenAI model function cannot be called with the new keyword.',\n );\n }\n\n return createChatModel(deploymentId);\n };\n\n provider.languageModel = createChatModel;\n provider.chat = createChatModel;\n provider.completion = createCompletionModel;\n provider.embedding = createEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n provider.textEmbedding = createEmbeddingModel;\n provider.textEmbeddingModel = createEmbeddingModel;\n provider.responses = createResponsesModel;\n provider.transcription = createTranscriptionModel;\n return provider;\n}\n\n/**\nDefault Azure OpenAI provider instance.\n */\nexport const azure = createAzure();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAOO;AAQP,4BAAuD;AAkGhD,SAAS,YACd,UAAuC,CAAC,GACnB;AAnHvB;AAoHE,QAAM,aAAa,OAAO;AAAA,IACxB,eAAW,kCAAW;AAAA,MACpB,QAAQ,QAAQ;AAAA,MAChB,yBAAyB;AAAA,MACzB,aAAa;AAAA,IACf,CAAC;AAAA,IACD,GAAG,QAAQ;AAAA,EACb;AAEA,QAAM,kBAAkB,UACtB,mCAAY;AAAA,IACV,cAAc,QAAQ;AAAA,IACtB,aAAa;AAAA,IACb,yBAAyB;AAAA,IACzB,aAAa;AAAA,EACf,CAAC;AAEH,QAAM,cAAa,aAAQ,eAAR,YAAsB;AACzC,QAAM,MAAM,CAAC,EAAE,MAAM,QAAQ,MAAyC;AACpE,QAAI,SAAS,cAAc;AACzB,aAAO,QAAQ,UACX,GAAG,QAAQ,OAAO,GAAG,IAAI,gBAAgB,UAAU,KACnD,WAAW,gBAAgB,CAAC,kDAAkD,UAAU;AAAA,IAC9F;AAGA,WAAO,QAAQ,UACX,GAAG,QAAQ,OAAO,IAAI,OAAO,GAAG,IAAI,gBAAgB,UAAU,KAC9D,WAAW,gBAAgB,CAAC,wCAAwC,OAAO,GAAG,IAAI,gBAAgB,UAAU;AAAA,EAClH;AAEA,QAAM,kBAAkB,CAAC,mBACvB,IAAI,wCAAwB,gBAAgB;AAAA,IAC1C,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,wBAAwB,CAAC,YAC7B,IAAI,8CAA8B,SAAS;AAAA,IACzC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,uBAAuB,CAAC,YAC5B,IAAI,qCAAqB,SAAS;AAAA,IAChC,UAAU;AAAA,IACV,SAAS;AAAA,IACT;AAAA,IACA,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,uBAAuB,CAAC,YAC5B,IAAI,6CAA6B,SAAS;AAAA,IACxC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,mBAAmB,CAAC,YACxB,IAAI,iCAAiB,SAAS;AAAA,IAC5B,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,2BAA2B,CAAC,YAChC,IAAI,yCAAyB,SAAS;AAAA,IACpC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,WAAW,SAAU,cAAsB;AAC/C,QAAI,YAAY;AACd,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,gBAAgB,YAAY;AAAA,EACrC;AAEA,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAChB,WAAS,aAAa;AACtB,WAAS,YAAY;AACrB,WAAS,QAAQ;AACjB,WAAS,aAAa;AACtB,WAAS,gBAAgB;AACzB,WAAS,qBAAqB;AAC9B,WAAS,YAAY;AACrB,WAAS,gBAAgB;AACzB,SAAO;AACT;AAKO,IAAM,QAAQ,YAAY;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -31,51 +31,49 @@ function createAzure(options = {}) {
|
|
|
31
31
|
}
|
|
32
32
|
return options.baseURL ? `${options.baseURL}/${modelId}${path}?api-version=${apiVersion}` : `https://${getResourceName()}.openai.azure.com/openai/deployments/${modelId}${path}?api-version=${apiVersion}`;
|
|
33
33
|
};
|
|
34
|
-
const createChatModel = (deploymentName
|
|
35
|
-
provider: "azure
|
|
34
|
+
const createChatModel = (deploymentName) => new OpenAIChatLanguageModel(deploymentName, {
|
|
35
|
+
provider: "azure.chat",
|
|
36
36
|
url,
|
|
37
37
|
headers: getHeaders,
|
|
38
|
-
compatibility: "strict",
|
|
39
38
|
fetch: options.fetch
|
|
40
39
|
});
|
|
41
|
-
const createCompletionModel = (modelId
|
|
42
|
-
provider: "azure
|
|
40
|
+
const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
|
|
41
|
+
provider: "azure.completion",
|
|
43
42
|
url,
|
|
44
|
-
compatibility: "strict",
|
|
45
43
|
headers: getHeaders,
|
|
46
44
|
fetch: options.fetch
|
|
47
45
|
});
|
|
48
|
-
const createEmbeddingModel = (modelId
|
|
49
|
-
provider: "azure
|
|
46
|
+
const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
|
|
47
|
+
provider: "azure.embeddings",
|
|
50
48
|
headers: getHeaders,
|
|
51
49
|
url,
|
|
52
50
|
fetch: options.fetch
|
|
53
51
|
});
|
|
54
52
|
const createResponsesModel = (modelId) => new OpenAIResponsesLanguageModel(modelId, {
|
|
55
|
-
provider: "azure
|
|
53
|
+
provider: "azure.responses",
|
|
56
54
|
url,
|
|
57
55
|
headers: getHeaders,
|
|
58
56
|
fetch: options.fetch
|
|
59
57
|
});
|
|
60
|
-
const createImageModel = (modelId
|
|
61
|
-
provider: "azure
|
|
58
|
+
const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
|
|
59
|
+
provider: "azure.image",
|
|
62
60
|
url,
|
|
63
61
|
headers: getHeaders,
|
|
64
62
|
fetch: options.fetch
|
|
65
63
|
});
|
|
66
64
|
const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
|
|
67
|
-
provider: "azure
|
|
65
|
+
provider: "azure.transcription",
|
|
68
66
|
url,
|
|
69
67
|
headers: getHeaders,
|
|
70
68
|
fetch: options.fetch
|
|
71
69
|
});
|
|
72
|
-
const provider = function(deploymentId
|
|
70
|
+
const provider = function(deploymentId) {
|
|
73
71
|
if (new.target) {
|
|
74
72
|
throw new Error(
|
|
75
73
|
"The Azure OpenAI model function cannot be called with the new keyword."
|
|
76
74
|
);
|
|
77
75
|
}
|
|
78
|
-
return createChatModel(deploymentId
|
|
76
|
+
return createChatModel(deploymentId);
|
|
79
77
|
};
|
|
80
78
|
provider.languageModel = createChatModel;
|
|
81
79
|
provider.chat = createChatModel;
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/azure-openai-provider.ts"],"sourcesContent":["import {\n OpenAIChatLanguageModel,\n
|
|
1
|
+
{"version":3,"sources":["../src/azure-openai-provider.ts"],"sourcesContent":["import {\n OpenAIChatLanguageModel,\n OpenAICompletionLanguageModel,\n OpenAIEmbeddingModel,\n OpenAIImageModel,\n OpenAIResponsesLanguageModel,\n OpenAITranscriptionModel,\n} from '@ai-sdk/openai/internal';\nimport {\n EmbeddingModelV2,\n LanguageModelV2,\n ProviderV2,\n ImageModelV2,\n TranscriptionModelV1,\n} from '@ai-sdk/provider';\nimport { FetchFunction, loadApiKey, loadSetting } from '@ai-sdk/provider-utils';\n\nexport interface AzureOpenAIProvider extends ProviderV2 {\n (deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI chat model for text generation.\n */\n languageModel(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI chat model for text generation.\n */\n chat(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI responses API model for text generation.\n */\n responses(deploymentId: string): LanguageModelV2;\n\n /**\nCreates an Azure OpenAI completion model for text generation.\n */\n completion(deploymentId: string): LanguageModelV2;\n\n /**\n@deprecated Use `textEmbeddingModel` instead.\n */\n embedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\n * @deprecated Use `imageModel` instead.\n */\n image(deploymentId: string): ImageModelV2;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\n */\n imageModel(deploymentId: string): ImageModelV2;\n\n /**\n@deprecated Use `textEmbeddingModel` instead.\n */\n textEmbedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\nCreates an Azure OpenAI model for text embeddings.\n */\n textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI model for audio transcription.\n */\n transcription(deploymentId: string): TranscriptionModelV1;\n}\n\nexport interface AzureOpenAIProviderSettings {\n /**\nName of the Azure OpenAI resource. Either this or `baseURL` can be used.\n\nThe resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/deployments/{modelId}{path}`.\n */\n resourceName?: string;\n\n /**\nUse a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.\nWhen a baseURL is provided, the resourceName is ignored.\n\nWith a baseURL, the resolved URL is `{baseURL}/{modelId}{path}`.\n */\n baseURL?: string;\n\n /**\nAPI key for authenticating requests.\n */\n apiKey?: string;\n\n /**\nCustom headers to include in the requests.\n */\n headers?: Record<string, string>;\n\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n */\n fetch?: FetchFunction;\n\n /**\nCustom api version to use. Defaults to `2024-10-01-preview`.\n */\n apiVersion?: string;\n}\n\n/**\nCreate an Azure OpenAI provider instance.\n */\nexport function createAzure(\n options: AzureOpenAIProviderSettings = {},\n): AzureOpenAIProvider {\n const getHeaders = () => ({\n 'api-key': loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'AZURE_API_KEY',\n description: 'Azure OpenAI',\n }),\n ...options.headers,\n });\n\n const getResourceName = () =>\n loadSetting({\n settingValue: options.resourceName,\n settingName: 'resourceName',\n environmentVariableName: 'AZURE_RESOURCE_NAME',\n description: 'Azure OpenAI resource name',\n });\n\n const apiVersion = options.apiVersion ?? '2025-03-01-preview';\n const url = ({ path, modelId }: { path: string; modelId: string }) => {\n if (path === '/responses') {\n return options.baseURL\n ? `${options.baseURL}${path}?api-version=${apiVersion}`\n : `https://${getResourceName()}.openai.azure.com/openai/responses?api-version=${apiVersion}`;\n }\n\n // Default URL format for other endpoints\n return options.baseURL\n ? `${options.baseURL}/${modelId}${path}?api-version=${apiVersion}`\n : `https://${getResourceName()}.openai.azure.com/openai/deployments/${modelId}${path}?api-version=${apiVersion}`;\n };\n\n const createChatModel = (deploymentName: string) =>\n new OpenAIChatLanguageModel(deploymentName, {\n provider: 'azure.chat',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createCompletionModel = (modelId: string) =>\n new OpenAICompletionLanguageModel(modelId, {\n provider: 'azure.completion',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createEmbeddingModel = (modelId: string) =>\n new OpenAIEmbeddingModel(modelId, {\n provider: 'azure.embeddings',\n headers: getHeaders,\n url,\n fetch: options.fetch,\n });\n\n const createResponsesModel = (modelId: string) =>\n new OpenAIResponsesLanguageModel(modelId, {\n provider: 'azure.responses',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createImageModel = (modelId: string) =>\n new OpenAIImageModel(modelId, {\n provider: 'azure.image',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createTranscriptionModel = (modelId: string) =>\n new OpenAITranscriptionModel(modelId, {\n provider: 'azure.transcription',\n url,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const provider = function (deploymentId: string) {\n if (new.target) {\n throw new Error(\n 'The Azure OpenAI model function cannot be called with the new keyword.',\n );\n }\n\n return createChatModel(deploymentId);\n };\n\n provider.languageModel = createChatModel;\n provider.chat = createChatModel;\n provider.completion = createCompletionModel;\n provider.embedding = createEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n provider.textEmbedding = createEmbeddingModel;\n provider.textEmbeddingModel = createEmbeddingModel;\n provider.responses = createResponsesModel;\n provider.transcription = createTranscriptionModel;\n return provider;\n}\n\n/**\nDefault Azure OpenAI provider instance.\n */\nexport const azure = createAzure();\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAwB,YAAY,mBAAmB;AAkGhD,SAAS,YACd,UAAuC,CAAC,GACnB;AAnHvB;AAoHE,QAAM,aAAa,OAAO;AAAA,IACxB,WAAW,WAAW;AAAA,MACpB,QAAQ,QAAQ;AAAA,MAChB,yBAAyB;AAAA,MACzB,aAAa;AAAA,IACf,CAAC;AAAA,IACD,GAAG,QAAQ;AAAA,EACb;AAEA,QAAM,kBAAkB,MACtB,YAAY;AAAA,IACV,cAAc,QAAQ;AAAA,IACtB,aAAa;AAAA,IACb,yBAAyB;AAAA,IACzB,aAAa;AAAA,EACf,CAAC;AAEH,QAAM,cAAa,aAAQ,eAAR,YAAsB;AACzC,QAAM,MAAM,CAAC,EAAE,MAAM,QAAQ,MAAyC;AACpE,QAAI,SAAS,cAAc;AACzB,aAAO,QAAQ,UACX,GAAG,QAAQ,OAAO,GAAG,IAAI,gBAAgB,UAAU,KACnD,WAAW,gBAAgB,CAAC,kDAAkD,UAAU;AAAA,IAC9F;AAGA,WAAO,QAAQ,UACX,GAAG,QAAQ,OAAO,IAAI,OAAO,GAAG,IAAI,gBAAgB,UAAU,KAC9D,WAAW,gBAAgB,CAAC,wCAAwC,OAAO,GAAG,IAAI,gBAAgB,UAAU;AAAA,EAClH;AAEA,QAAM,kBAAkB,CAAC,mBACvB,IAAI,wBAAwB,gBAAgB;AAAA,IAC1C,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,wBAAwB,CAAC,YAC7B,IAAI,8BAA8B,SAAS;AAAA,IACzC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,uBAAuB,CAAC,YAC5B,IAAI,qBAAqB,SAAS;AAAA,IAChC,UAAU;AAAA,IACV,SAAS;AAAA,IACT;AAAA,IACA,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,uBAAuB,CAAC,YAC5B,IAAI,6BAA6B,SAAS;AAAA,IACxC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,mBAAmB,CAAC,YACxB,IAAI,iBAAiB,SAAS;AAAA,IAC5B,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,2BAA2B,CAAC,YAChC,IAAI,yBAAyB,SAAS;AAAA,IACpC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB,CAAC;AAEH,QAAM,WAAW,SAAU,cAAsB;AAC/C,QAAI,YAAY;AACd,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,gBAAgB,YAAY;AAAA,EACrC;AAEA,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAChB,WAAS,aAAa;AACtB,WAAS,YAAY;AACrB,WAAS,QAAQ;AACjB,WAAS,aAAa;AACtB,WAAS,gBAAgB;AACzB,WAAS,qBAAqB;AAC9B,WAAS,YAAY;AACrB,WAAS,gBAAgB;AACzB,SAAO;AACT;AAKO,IAAM,QAAQ,YAAY;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/azure",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ai-sdk/openai": "
|
|
23
|
-
"@ai-sdk/provider": "
|
|
24
|
-
"@ai-sdk/provider-utils": "
|
|
22
|
+
"@ai-sdk/openai": "2.0.0-alpha.1",
|
|
23
|
+
"@ai-sdk/provider": "2.0.0-alpha.1",
|
|
24
|
+
"@ai-sdk/provider-utils": "3.0.0-alpha.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "20.17.24",
|
|
28
28
|
"tsup": "^8",
|
|
29
|
-
"typescript": "5.
|
|
30
|
-
"zod": "3.
|
|
29
|
+
"typescript": "5.8.3",
|
|
30
|
+
"zod": "3.24.4",
|
|
31
31
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"zod": "^3.
|
|
34
|
+
"zod": "^3.24.0"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18"
|
|
@@ -51,15 +51,16 @@
|
|
|
51
51
|
"ai"
|
|
52
52
|
],
|
|
53
53
|
"scripts": {
|
|
54
|
-
"build": "tsup",
|
|
55
|
-
"build:watch": "tsup --watch",
|
|
56
|
-
"clean": "rm -rf dist",
|
|
54
|
+
"build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
|
|
55
|
+
"build:watch": "pnpm clean && tsup --watch",
|
|
56
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
57
57
|
"lint": "eslint \"./**/*.ts*\"",
|
|
58
|
-
"type-check": "tsc --
|
|
58
|
+
"type-check": "tsc --build",
|
|
59
59
|
"prettier-check": "prettier --check \"./**/*.ts*\"",
|
|
60
60
|
"test": "pnpm test:node && pnpm test:edge",
|
|
61
|
+
"test:update": "pnpm test:node -u",
|
|
62
|
+
"test:watch": "vitest --config vitest.node.config.js",
|
|
61
63
|
"test:edge": "vitest --config vitest.edge.config.js --run",
|
|
62
|
-
"test:node": "vitest --config vitest.node.config.js --run"
|
|
63
|
-
"test:node:watch": "vitest --config vitest.node.config.js"
|
|
64
|
+
"test:node": "vitest --config vitest.node.config.js --run"
|
|
64
65
|
}
|
|
65
66
|
}
|