@ai-sdk/azure 2.0.0-canary.8 → 2.0.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/CHANGELOG.md +678 -0
- package/README.md +2 -2
- package/dist/index.d.mts +21 -18
- package/dist/index.d.ts +21 -18
- package/dist/index.js +31 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,683 @@
|
|
|
1
1
|
# @ai-sdk/azure
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d5f588f: AI SDK 5
|
|
8
|
+
- 516be5b: ### Move Image Model Settings into generate options
|
|
9
|
+
|
|
10
|
+
Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
|
|
11
|
+
|
|
12
|
+
Before
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
await generateImage({
|
|
16
|
+
model: luma.image('photon-flash-1', {
|
|
17
|
+
maxImagesPerCall: 5,
|
|
18
|
+
pollIntervalMillis: 500,
|
|
19
|
+
}),
|
|
20
|
+
prompt,
|
|
21
|
+
n: 10,
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
After
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
await generateImage({
|
|
29
|
+
model: luma.image('photon-flash-1'),
|
|
30
|
+
prompt,
|
|
31
|
+
n: 10,
|
|
32
|
+
maxImagesPerCall: 5,
|
|
33
|
+
providerOptions: {
|
|
34
|
+
luma: { pollIntervalMillis: 5 },
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Pull Request: https://github.com/vercel/ai/pull/6180
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- c467b38: feat (provider/azure): add OpenAI responses API support
|
|
44
|
+
- 004fb17: feat(azure): add speech model support and fix transcription
|
|
45
|
+
- 3b13ccf: feat(providers/azure): add transcribe
|
|
46
|
+
- e2aceaf: feat: add raw chunk support
|
|
47
|
+
- eb173f1: chore (providers): remove model shorthand deprecation warnings
|
|
48
|
+
- db72adc: chore(providers/openai): update completion model to use providerOptions
|
|
49
|
+
- 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
|
|
50
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
51
|
+
- 3db5258: update: Azure OpenAI provider to v1 API format
|
|
52
|
+
- 4617fab: chore(embedding-models): remove remaining settings
|
|
53
|
+
- 52ce942: chore(providers/openai): remove & enable strict compatibility by default
|
|
54
|
+
- 205077b: fix: improve Zod compatibility
|
|
55
|
+
- Updated dependencies [a571d6e]
|
|
56
|
+
- Updated dependencies [742b7be]
|
|
57
|
+
- Updated dependencies [948b755]
|
|
58
|
+
- Updated dependencies [d63bcbc]
|
|
59
|
+
- Updated dependencies [e7fcc86]
|
|
60
|
+
- Updated dependencies [7cddb72]
|
|
61
|
+
- Updated dependencies [ccce59b]
|
|
62
|
+
- Updated dependencies [e2b9e4b]
|
|
63
|
+
- Updated dependencies [95857aa]
|
|
64
|
+
- Updated dependencies [45c1ea2]
|
|
65
|
+
- Updated dependencies [6f6bb89]
|
|
66
|
+
- Updated dependencies [060370c]
|
|
67
|
+
- Updated dependencies [dc714f3]
|
|
68
|
+
- Updated dependencies [b5da06a]
|
|
69
|
+
- Updated dependencies [d1a1aa1]
|
|
70
|
+
- Updated dependencies [63f9e9b]
|
|
71
|
+
- Updated dependencies [3bd3c0b]
|
|
72
|
+
- Updated dependencies [5d142ab]
|
|
73
|
+
- Updated dependencies [d5f588f]
|
|
74
|
+
- Updated dependencies [e025824]
|
|
75
|
+
- Updated dependencies [cc62234]
|
|
76
|
+
- Updated dependencies [0571b98]
|
|
77
|
+
- Updated dependencies [5d959e7]
|
|
78
|
+
- Updated dependencies [b6b43c7]
|
|
79
|
+
- Updated dependencies [4fef487]
|
|
80
|
+
- Updated dependencies [48d257a]
|
|
81
|
+
- Updated dependencies [0c0c0b3]
|
|
82
|
+
- Updated dependencies [0d2c085]
|
|
83
|
+
- Updated dependencies [0eee6a8]
|
|
84
|
+
- Updated dependencies [177526b]
|
|
85
|
+
- Updated dependencies [2f542fa]
|
|
86
|
+
- Updated dependencies [40acf9b]
|
|
87
|
+
- Updated dependencies [c15dfbf]
|
|
88
|
+
- Updated dependencies [9222aeb]
|
|
89
|
+
- Updated dependencies [3b1ea10]
|
|
90
|
+
- Updated dependencies [e2aceaf]
|
|
91
|
+
- Updated dependencies [d2af019]
|
|
92
|
+
- Updated dependencies [411e483]
|
|
93
|
+
- Updated dependencies [8ba77a7]
|
|
94
|
+
- Updated dependencies [eb173f1]
|
|
95
|
+
- Updated dependencies [209256d]
|
|
96
|
+
- Updated dependencies [faea29f]
|
|
97
|
+
- Updated dependencies [7032dc5]
|
|
98
|
+
- Updated dependencies [870c5c0]
|
|
99
|
+
- Updated dependencies [db72adc]
|
|
100
|
+
- Updated dependencies [7b3ae3f]
|
|
101
|
+
- Updated dependencies [a166433]
|
|
102
|
+
- Updated dependencies [26735b5]
|
|
103
|
+
- Updated dependencies [443d8ec]
|
|
104
|
+
- Updated dependencies [a8c8bd5]
|
|
105
|
+
- Updated dependencies [abf9a79]
|
|
106
|
+
- Updated dependencies [14c9410]
|
|
107
|
+
- Updated dependencies [e86be6f]
|
|
108
|
+
- Updated dependencies [8d12da5]
|
|
109
|
+
- Updated dependencies [9bf7291]
|
|
110
|
+
- Updated dependencies [2e13791]
|
|
111
|
+
- Updated dependencies [9f95b35]
|
|
112
|
+
- Updated dependencies [d521cda]
|
|
113
|
+
- Updated dependencies [66962ed]
|
|
114
|
+
- Updated dependencies [0d06df6]
|
|
115
|
+
- Updated dependencies [442be08]
|
|
116
|
+
- Updated dependencies [472524a]
|
|
117
|
+
- Updated dependencies [0059ee2]
|
|
118
|
+
- Updated dependencies [dd3ff01]
|
|
119
|
+
- Updated dependencies [8493141]
|
|
120
|
+
- Updated dependencies [d9c98f4]
|
|
121
|
+
- Updated dependencies [05d2819]
|
|
122
|
+
- Updated dependencies [9301f86]
|
|
123
|
+
- Updated dependencies [0a87932]
|
|
124
|
+
- Updated dependencies [c4a2fec]
|
|
125
|
+
- Updated dependencies [957b739]
|
|
126
|
+
- Updated dependencies [79457bd]
|
|
127
|
+
- Updated dependencies [a3f768e]
|
|
128
|
+
- Updated dependencies [7435eb5]
|
|
129
|
+
- Updated dependencies [8aa9e20]
|
|
130
|
+
- Updated dependencies [4617fab]
|
|
131
|
+
- Updated dependencies [b5a0e32]
|
|
132
|
+
- Updated dependencies [136819b]
|
|
133
|
+
- Updated dependencies [516be5b]
|
|
134
|
+
- Updated dependencies [ac34802]
|
|
135
|
+
- Updated dependencies [0054544]
|
|
136
|
+
- Updated dependencies [cb68df0]
|
|
137
|
+
- Updated dependencies [52ce942]
|
|
138
|
+
- Updated dependencies [db64cbe]
|
|
139
|
+
- Updated dependencies [ad80501]
|
|
140
|
+
- Updated dependencies [b3c3450]
|
|
141
|
+
- Updated dependencies [68ecf2f]
|
|
142
|
+
- Updated dependencies [9e9c809]
|
|
143
|
+
- Updated dependencies [32831c6]
|
|
144
|
+
- Updated dependencies [48249c4]
|
|
145
|
+
- Updated dependencies [c7d3b2e]
|
|
146
|
+
- Updated dependencies [6dc848c]
|
|
147
|
+
- Updated dependencies [6b98118]
|
|
148
|
+
- Updated dependencies [d0f9495]
|
|
149
|
+
- Updated dependencies [63d791d]
|
|
150
|
+
- Updated dependencies [87b828f]
|
|
151
|
+
- Updated dependencies [3f2f00c]
|
|
152
|
+
- Updated dependencies [bfdca8d]
|
|
153
|
+
- Updated dependencies [0ff02bb]
|
|
154
|
+
- Updated dependencies [7979f7f]
|
|
155
|
+
- Updated dependencies [ad2a3d5]
|
|
156
|
+
- Updated dependencies [9943464]
|
|
157
|
+
- Updated dependencies [39a4fab]
|
|
158
|
+
- Updated dependencies [44f4aba]
|
|
159
|
+
- Updated dependencies [0fa7414]
|
|
160
|
+
- Updated dependencies [9bd5ab5]
|
|
161
|
+
- Updated dependencies [57edfcb]
|
|
162
|
+
- Updated dependencies [faf8446]
|
|
163
|
+
- Updated dependencies [efc3a62]
|
|
164
|
+
- Updated dependencies [7ea4132]
|
|
165
|
+
- Updated dependencies [fa758ea]
|
|
166
|
+
- Updated dependencies [d1a034f]
|
|
167
|
+
- Updated dependencies [5c56081]
|
|
168
|
+
- Updated dependencies [fd65bc6]
|
|
169
|
+
- Updated dependencies [023ba40]
|
|
170
|
+
- Updated dependencies [e497698]
|
|
171
|
+
- Updated dependencies [ea7a7c9]
|
|
172
|
+
- Updated dependencies [26535e0]
|
|
173
|
+
- Updated dependencies [928fadf]
|
|
174
|
+
- Updated dependencies [e030615]
|
|
175
|
+
- Updated dependencies [5e57fae]
|
|
176
|
+
- Updated dependencies [0a87932]
|
|
177
|
+
- Updated dependencies [393138b]
|
|
178
|
+
- Updated dependencies [c57e248]
|
|
179
|
+
- Updated dependencies [5147e6e]
|
|
180
|
+
- Updated dependencies [88a8ee5]
|
|
181
|
+
- Updated dependencies [06bac05]
|
|
182
|
+
- Updated dependencies [41fa418]
|
|
183
|
+
- Updated dependencies [205077b]
|
|
184
|
+
- Updated dependencies [71f938d]
|
|
185
|
+
- Updated dependencies [3795467]
|
|
186
|
+
- Updated dependencies [28a5ed5]
|
|
187
|
+
- Updated dependencies [7182d14]
|
|
188
|
+
- Updated dependencies [c1e6647]
|
|
189
|
+
- Updated dependencies [c2b92cc]
|
|
190
|
+
- Updated dependencies [284353f]
|
|
191
|
+
- Updated dependencies [1766ede]
|
|
192
|
+
- Updated dependencies [6f231db]
|
|
193
|
+
- Updated dependencies [811dff3]
|
|
194
|
+
- Updated dependencies [f10304b]
|
|
195
|
+
- Updated dependencies [dd5fd43]
|
|
196
|
+
- Updated dependencies [4af5233]
|
|
197
|
+
- Updated dependencies [33f4a6a]
|
|
198
|
+
- Updated dependencies [383cbfa]
|
|
199
|
+
- Updated dependencies [27deb4d]
|
|
200
|
+
- Updated dependencies [7df7a25]
|
|
201
|
+
- Updated dependencies [c4df419]
|
|
202
|
+
- @ai-sdk/provider-utils@3.0.0
|
|
203
|
+
- @ai-sdk/provider@2.0.0
|
|
204
|
+
- @ai-sdk/openai@2.0.0
|
|
205
|
+
|
|
206
|
+
## 2.0.0-beta.16
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- Updated dependencies [88a8ee5]
|
|
211
|
+
- @ai-sdk/provider-utils@3.0.0-beta.10
|
|
212
|
+
- @ai-sdk/openai@2.0.0-beta.16
|
|
213
|
+
|
|
214
|
+
## 2.0.0-beta.15
|
|
215
|
+
|
|
216
|
+
### Patch Changes
|
|
217
|
+
|
|
218
|
+
- Updated dependencies [9943464]
|
|
219
|
+
- Updated dependencies [27deb4d]
|
|
220
|
+
- @ai-sdk/openai@2.0.0-beta.15
|
|
221
|
+
- @ai-sdk/provider@2.0.0-beta.2
|
|
222
|
+
- @ai-sdk/provider-utils@3.0.0-beta.9
|
|
223
|
+
|
|
224
|
+
## 2.0.0-beta.14
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- 004fb17: feat(azure): add speech model support and fix transcription
|
|
229
|
+
- eb173f1: chore (providers): remove model shorthand deprecation warnings
|
|
230
|
+
- Updated dependencies [eb173f1]
|
|
231
|
+
- Updated dependencies [7032dc5]
|
|
232
|
+
- Updated dependencies [dd5fd43]
|
|
233
|
+
- @ai-sdk/openai@2.0.0-beta.14
|
|
234
|
+
- @ai-sdk/provider-utils@3.0.0-beta.8
|
|
235
|
+
|
|
236
|
+
## 2.0.0-beta.13
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- Updated dependencies [e7fcc86]
|
|
241
|
+
- @ai-sdk/provider-utils@3.0.0-beta.7
|
|
242
|
+
- @ai-sdk/openai@2.0.0-beta.13
|
|
243
|
+
|
|
244
|
+
## 2.0.0-beta.12
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- Updated dependencies [d521cda]
|
|
249
|
+
- Updated dependencies [0059ee2]
|
|
250
|
+
- Updated dependencies [ac34802]
|
|
251
|
+
- @ai-sdk/openai@2.0.0-beta.12
|
|
252
|
+
- @ai-sdk/provider-utils@3.0.0-beta.6
|
|
253
|
+
|
|
254
|
+
## 2.0.0-beta.11
|
|
255
|
+
|
|
256
|
+
### Patch Changes
|
|
257
|
+
|
|
258
|
+
- 3db5258: update: Azure OpenAI provider to v1 API format
|
|
259
|
+
- Updated dependencies [57edfcb]
|
|
260
|
+
- Updated dependencies [383cbfa]
|
|
261
|
+
- @ai-sdk/provider-utils@3.0.0-beta.5
|
|
262
|
+
- @ai-sdk/openai@2.0.0-beta.11
|
|
263
|
+
|
|
264
|
+
## 2.0.0-beta.10
|
|
265
|
+
|
|
266
|
+
### Patch Changes
|
|
267
|
+
|
|
268
|
+
- 205077b: fix: improve Zod compatibility
|
|
269
|
+
- Updated dependencies [0fa7414]
|
|
270
|
+
- Updated dependencies [205077b]
|
|
271
|
+
- @ai-sdk/openai@2.0.0-beta.10
|
|
272
|
+
- @ai-sdk/provider-utils@3.0.0-beta.4
|
|
273
|
+
|
|
274
|
+
## 2.0.0-beta.9
|
|
275
|
+
|
|
276
|
+
### Patch Changes
|
|
277
|
+
|
|
278
|
+
- Updated dependencies [faea29f]
|
|
279
|
+
- @ai-sdk/openai@2.0.0-beta.9
|
|
280
|
+
|
|
281
|
+
## 2.0.0-beta.8
|
|
282
|
+
|
|
283
|
+
### Patch Changes
|
|
284
|
+
|
|
285
|
+
- Updated dependencies [05d2819]
|
|
286
|
+
- Updated dependencies [db64cbe]
|
|
287
|
+
- @ai-sdk/provider-utils@3.0.0-beta.3
|
|
288
|
+
- @ai-sdk/openai@2.0.0-beta.8
|
|
289
|
+
|
|
290
|
+
## 2.0.0-beta.7
|
|
291
|
+
|
|
292
|
+
### Patch Changes
|
|
293
|
+
|
|
294
|
+
- Updated dependencies [209256d]
|
|
295
|
+
- @ai-sdk/openai@2.0.0-beta.7
|
|
296
|
+
|
|
297
|
+
## 2.0.0-beta.6
|
|
298
|
+
|
|
299
|
+
### Patch Changes
|
|
300
|
+
|
|
301
|
+
- Updated dependencies [0eee6a8]
|
|
302
|
+
- Updated dependencies [b5a0e32]
|
|
303
|
+
- Updated dependencies [c7d3b2e]
|
|
304
|
+
- @ai-sdk/openai@2.0.0-beta.6
|
|
305
|
+
|
|
306
|
+
## 2.0.0-beta.5
|
|
307
|
+
|
|
308
|
+
### Patch Changes
|
|
309
|
+
|
|
310
|
+
- Updated dependencies [48249c4]
|
|
311
|
+
- Updated dependencies [e497698]
|
|
312
|
+
- @ai-sdk/openai@2.0.0-beta.5
|
|
313
|
+
|
|
314
|
+
## 2.0.0-beta.4
|
|
315
|
+
|
|
316
|
+
### Patch Changes
|
|
317
|
+
|
|
318
|
+
- Updated dependencies [b3c3450]
|
|
319
|
+
- Updated dependencies [ad2a3d5]
|
|
320
|
+
- @ai-sdk/openai@2.0.0-beta.4
|
|
321
|
+
|
|
322
|
+
## 2.0.0-beta.3
|
|
323
|
+
|
|
324
|
+
### Patch Changes
|
|
325
|
+
|
|
326
|
+
- Updated dependencies [efc3a62]
|
|
327
|
+
- @ai-sdk/openai@2.0.0-beta.3
|
|
328
|
+
|
|
329
|
+
## 2.0.0-beta.2
|
|
330
|
+
|
|
331
|
+
### Patch Changes
|
|
332
|
+
|
|
333
|
+
- Updated dependencies [0571b98]
|
|
334
|
+
- Updated dependencies [39a4fab]
|
|
335
|
+
- Updated dependencies [d1a034f]
|
|
336
|
+
- @ai-sdk/provider-utils@3.0.0-beta.2
|
|
337
|
+
- @ai-sdk/openai@2.0.0-beta.2
|
|
338
|
+
|
|
339
|
+
## 2.0.0-beta.1
|
|
340
|
+
|
|
341
|
+
### Patch Changes
|
|
342
|
+
|
|
343
|
+
- Updated dependencies [742b7be]
|
|
344
|
+
- Updated dependencies [7cddb72]
|
|
345
|
+
- Updated dependencies [ccce59b]
|
|
346
|
+
- Updated dependencies [e2b9e4b]
|
|
347
|
+
- Updated dependencies [45c1ea2]
|
|
348
|
+
- Updated dependencies [e025824]
|
|
349
|
+
- Updated dependencies [cc62234]
|
|
350
|
+
- Updated dependencies [5d959e7]
|
|
351
|
+
- Updated dependencies [0d06df6]
|
|
352
|
+
- Updated dependencies [472524a]
|
|
353
|
+
- Updated dependencies [dd3ff01]
|
|
354
|
+
- Updated dependencies [7435eb5]
|
|
355
|
+
- Updated dependencies [cb68df0]
|
|
356
|
+
- Updated dependencies [bfdca8d]
|
|
357
|
+
- Updated dependencies [44f4aba]
|
|
358
|
+
- Updated dependencies [023ba40]
|
|
359
|
+
- Updated dependencies [5e57fae]
|
|
360
|
+
- Updated dependencies [71f938d]
|
|
361
|
+
- Updated dependencies [28a5ed5]
|
|
362
|
+
- @ai-sdk/provider@2.0.0-beta.1
|
|
363
|
+
- @ai-sdk/provider-utils@3.0.0-beta.1
|
|
364
|
+
- @ai-sdk/openai@2.0.0-beta.1
|
|
365
|
+
|
|
366
|
+
## 2.0.0-alpha.15
|
|
367
|
+
|
|
368
|
+
### Patch Changes
|
|
369
|
+
|
|
370
|
+
- Updated dependencies [48d257a]
|
|
371
|
+
- Updated dependencies [8ba77a7]
|
|
372
|
+
- @ai-sdk/provider@2.0.0-alpha.15
|
|
373
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.15
|
|
374
|
+
- @ai-sdk/openai@2.0.0-alpha.15
|
|
375
|
+
|
|
376
|
+
## 2.0.0-alpha.14
|
|
377
|
+
|
|
378
|
+
### Patch Changes
|
|
379
|
+
|
|
380
|
+
- Updated dependencies [b5da06a]
|
|
381
|
+
- Updated dependencies [63f9e9b]
|
|
382
|
+
- Updated dependencies [2e13791]
|
|
383
|
+
- @ai-sdk/provider@2.0.0-alpha.14
|
|
384
|
+
- @ai-sdk/openai@2.0.0-alpha.14
|
|
385
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.14
|
|
386
|
+
|
|
387
|
+
## 2.0.0-alpha.13
|
|
388
|
+
|
|
389
|
+
### Patch Changes
|
|
390
|
+
|
|
391
|
+
- Updated dependencies [68ecf2f]
|
|
392
|
+
- @ai-sdk/provider@2.0.0-alpha.13
|
|
393
|
+
- @ai-sdk/openai@2.0.0-alpha.13
|
|
394
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.13
|
|
395
|
+
|
|
396
|
+
## 2.0.0-alpha.12
|
|
397
|
+
|
|
398
|
+
### Patch Changes
|
|
399
|
+
|
|
400
|
+
- e2aceaf: feat: add raw chunk support
|
|
401
|
+
- Updated dependencies [2f542fa]
|
|
402
|
+
- Updated dependencies [e2aceaf]
|
|
403
|
+
- @ai-sdk/openai@2.0.0-alpha.12
|
|
404
|
+
- @ai-sdk/provider@2.0.0-alpha.12
|
|
405
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.12
|
|
406
|
+
|
|
407
|
+
## 2.0.0-alpha.11
|
|
408
|
+
|
|
409
|
+
### Patch Changes
|
|
410
|
+
|
|
411
|
+
- Updated dependencies [8d12da5]
|
|
412
|
+
- Updated dependencies [c1e6647]
|
|
413
|
+
- @ai-sdk/openai@2.0.0-alpha.11
|
|
414
|
+
- @ai-sdk/provider@2.0.0-alpha.11
|
|
415
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.11
|
|
416
|
+
|
|
417
|
+
## 2.0.0-alpha.10
|
|
418
|
+
|
|
419
|
+
### Patch Changes
|
|
420
|
+
|
|
421
|
+
- Updated dependencies [c4df419]
|
|
422
|
+
- @ai-sdk/provider@2.0.0-alpha.10
|
|
423
|
+
- @ai-sdk/openai@2.0.0-alpha.10
|
|
424
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.10
|
|
425
|
+
|
|
426
|
+
## 2.0.0-alpha.9
|
|
427
|
+
|
|
428
|
+
### Patch Changes
|
|
429
|
+
|
|
430
|
+
- Updated dependencies [811dff3]
|
|
431
|
+
- @ai-sdk/provider@2.0.0-alpha.9
|
|
432
|
+
- @ai-sdk/openai@2.0.0-alpha.9
|
|
433
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.9
|
|
434
|
+
|
|
435
|
+
## 2.0.0-alpha.8
|
|
436
|
+
|
|
437
|
+
### Patch Changes
|
|
438
|
+
|
|
439
|
+
- Updated dependencies [4fef487]
|
|
440
|
+
- Updated dependencies [9222aeb]
|
|
441
|
+
- Updated dependencies [4af5233]
|
|
442
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.8
|
|
443
|
+
- @ai-sdk/provider@2.0.0-alpha.8
|
|
444
|
+
- @ai-sdk/openai@2.0.0-alpha.8
|
|
445
|
+
|
|
446
|
+
## 2.0.0-alpha.7
|
|
447
|
+
|
|
448
|
+
### Patch Changes
|
|
449
|
+
|
|
450
|
+
- Updated dependencies [5c56081]
|
|
451
|
+
- @ai-sdk/provider@2.0.0-alpha.7
|
|
452
|
+
- @ai-sdk/openai@2.0.0-alpha.7
|
|
453
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.7
|
|
454
|
+
|
|
455
|
+
## 2.0.0-alpha.6
|
|
456
|
+
|
|
457
|
+
### Patch Changes
|
|
458
|
+
|
|
459
|
+
- Updated dependencies [0d2c085]
|
|
460
|
+
- @ai-sdk/provider@2.0.0-alpha.6
|
|
461
|
+
- @ai-sdk/openai@2.0.0-alpha.6
|
|
462
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.6
|
|
463
|
+
|
|
464
|
+
## 2.0.0-alpha.4
|
|
465
|
+
|
|
466
|
+
### Patch Changes
|
|
467
|
+
|
|
468
|
+
- Updated dependencies [dc714f3]
|
|
469
|
+
- @ai-sdk/provider@2.0.0-alpha.4
|
|
470
|
+
- @ai-sdk/openai@2.0.0-alpha.4
|
|
471
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.4
|
|
472
|
+
|
|
473
|
+
## 2.0.0-alpha.3
|
|
474
|
+
|
|
475
|
+
### Patch Changes
|
|
476
|
+
|
|
477
|
+
- Updated dependencies [6b98118]
|
|
478
|
+
- @ai-sdk/provider@2.0.0-alpha.3
|
|
479
|
+
- @ai-sdk/openai@2.0.0-alpha.3
|
|
480
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.3
|
|
481
|
+
|
|
482
|
+
## 2.0.0-alpha.2
|
|
483
|
+
|
|
484
|
+
### Patch Changes
|
|
485
|
+
|
|
486
|
+
- Updated dependencies [26535e0]
|
|
487
|
+
- @ai-sdk/provider@2.0.0-alpha.2
|
|
488
|
+
- @ai-sdk/openai@2.0.0-alpha.2
|
|
489
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.2
|
|
490
|
+
|
|
491
|
+
## 2.0.0-alpha.1
|
|
492
|
+
|
|
493
|
+
### Patch Changes
|
|
494
|
+
|
|
495
|
+
- Updated dependencies [3f2f00c]
|
|
496
|
+
- @ai-sdk/provider@2.0.0-alpha.1
|
|
497
|
+
- @ai-sdk/openai@2.0.0-alpha.1
|
|
498
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.1
|
|
499
|
+
|
|
500
|
+
## 2.0.0-canary.21
|
|
501
|
+
|
|
502
|
+
### Patch Changes
|
|
503
|
+
|
|
504
|
+
- Updated dependencies [faf8446]
|
|
505
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
|
506
|
+
- @ai-sdk/openai@2.0.0-canary.20
|
|
507
|
+
|
|
508
|
+
## 2.0.0-canary.20
|
|
509
|
+
|
|
510
|
+
### Patch Changes
|
|
511
|
+
|
|
512
|
+
- Updated dependencies [40acf9b]
|
|
513
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
|
514
|
+
- @ai-sdk/openai@2.0.0-canary.19
|
|
515
|
+
|
|
516
|
+
## 2.0.0-canary.19
|
|
517
|
+
|
|
518
|
+
### Major Changes
|
|
519
|
+
|
|
520
|
+
- 516be5b: ### Move Image Model Settings into generate options
|
|
521
|
+
|
|
522
|
+
Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
|
|
523
|
+
|
|
524
|
+
Before
|
|
525
|
+
|
|
526
|
+
```js
|
|
527
|
+
await generateImage({
|
|
528
|
+
model: luma.image('photon-flash-1', {
|
|
529
|
+
maxImagesPerCall: 5,
|
|
530
|
+
pollIntervalMillis: 500,
|
|
531
|
+
}),
|
|
532
|
+
prompt,
|
|
533
|
+
n: 10,
|
|
534
|
+
});
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
After
|
|
538
|
+
|
|
539
|
+
```js
|
|
540
|
+
await generateImage({
|
|
541
|
+
model: luma.image('photon-flash-1'),
|
|
542
|
+
prompt,
|
|
543
|
+
n: 10,
|
|
544
|
+
maxImagesPerCall: 5,
|
|
545
|
+
providerOptions: {
|
|
546
|
+
luma: { pollIntervalMillis: 5 },
|
|
547
|
+
},
|
|
548
|
+
});
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
Pull Request: https://github.com/vercel/ai/pull/6180
|
|
552
|
+
|
|
553
|
+
### Patch Changes
|
|
554
|
+
|
|
555
|
+
- Updated dependencies [516be5b]
|
|
556
|
+
- Updated dependencies [ea7a7c9]
|
|
557
|
+
- @ai-sdk/openai@2.0.0-canary.18
|
|
558
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
|
559
|
+
|
|
560
|
+
## 2.0.0-canary.18
|
|
561
|
+
|
|
562
|
+
### Patch Changes
|
|
563
|
+
|
|
564
|
+
- 52ce942: chore(providers/openai): remove & enable strict compatibility by default
|
|
565
|
+
- Updated dependencies [52ce942]
|
|
566
|
+
- Updated dependencies [87b828f]
|
|
567
|
+
- @ai-sdk/openai@2.0.0-canary.17
|
|
568
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
|
569
|
+
|
|
570
|
+
## 2.0.0-canary.17
|
|
571
|
+
|
|
572
|
+
### Patch Changes
|
|
573
|
+
|
|
574
|
+
- Updated dependencies [a571d6e]
|
|
575
|
+
- Updated dependencies [a8c8bd5]
|
|
576
|
+
- Updated dependencies [7979f7f]
|
|
577
|
+
- Updated dependencies [928fadf]
|
|
578
|
+
- Updated dependencies [41fa418]
|
|
579
|
+
- Updated dependencies [6f231db]
|
|
580
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
581
|
+
- @ai-sdk/provider@2.0.0-canary.14
|
|
582
|
+
- @ai-sdk/openai@2.0.0-canary.16
|
|
583
|
+
|
|
584
|
+
## 2.0.0-canary.16
|
|
585
|
+
|
|
586
|
+
### Patch Changes
|
|
587
|
+
|
|
588
|
+
- Updated dependencies [957b739]
|
|
589
|
+
- Updated dependencies [136819b]
|
|
590
|
+
- Updated dependencies [9bd5ab5]
|
|
591
|
+
- Updated dependencies [284353f]
|
|
592
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
|
593
|
+
- @ai-sdk/openai@2.0.0-canary.15
|
|
594
|
+
- @ai-sdk/provider@2.0.0-canary.13
|
|
595
|
+
|
|
596
|
+
## 2.0.0-canary.15
|
|
597
|
+
|
|
598
|
+
### Patch Changes
|
|
599
|
+
|
|
600
|
+
- Updated dependencies [7b3ae3f]
|
|
601
|
+
- Updated dependencies [0ff02bb]
|
|
602
|
+
- Updated dependencies [fa758ea]
|
|
603
|
+
- @ai-sdk/provider@2.0.0-canary.12
|
|
604
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
|
605
|
+
- @ai-sdk/openai@2.0.0-canary.14
|
|
606
|
+
|
|
607
|
+
## 2.0.0-canary.14
|
|
608
|
+
|
|
609
|
+
### Patch Changes
|
|
610
|
+
|
|
611
|
+
- 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
|
|
612
|
+
- 4617fab: chore(embedding-models): remove remaining settings
|
|
613
|
+
- Updated dependencies [177526b]
|
|
614
|
+
- Updated dependencies [c15dfbf]
|
|
615
|
+
- Updated dependencies [9bf7291]
|
|
616
|
+
- Updated dependencies [4617fab]
|
|
617
|
+
- Updated dependencies [e030615]
|
|
618
|
+
- @ai-sdk/openai@2.0.0-canary.13
|
|
619
|
+
- @ai-sdk/provider@2.0.0-canary.11
|
|
620
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
|
621
|
+
|
|
622
|
+
## 2.0.0-canary.13
|
|
623
|
+
|
|
624
|
+
### Patch Changes
|
|
625
|
+
|
|
626
|
+
- db72adc: chore(providers/openai): update completion model to use providerOptions
|
|
627
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
628
|
+
- Updated dependencies [db72adc]
|
|
629
|
+
- Updated dependencies [66962ed]
|
|
630
|
+
- Updated dependencies [9301f86]
|
|
631
|
+
- Updated dependencies [a3f768e]
|
|
632
|
+
- Updated dependencies [7df7a25]
|
|
633
|
+
- @ai-sdk/openai@2.0.0-canary.12
|
|
634
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
|
635
|
+
- @ai-sdk/provider@2.0.0-canary.10
|
|
636
|
+
|
|
637
|
+
## 2.0.0-canary.12
|
|
638
|
+
|
|
639
|
+
### Patch Changes
|
|
640
|
+
|
|
641
|
+
- Updated dependencies [e86be6f]
|
|
642
|
+
- Updated dependencies [8493141]
|
|
643
|
+
- @ai-sdk/provider@2.0.0-canary.9
|
|
644
|
+
- @ai-sdk/openai@2.0.0-canary.11
|
|
645
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
|
646
|
+
|
|
647
|
+
## 2.0.0-canary.11
|
|
648
|
+
|
|
649
|
+
### Patch Changes
|
|
650
|
+
|
|
651
|
+
- Updated dependencies [95857aa]
|
|
652
|
+
- Updated dependencies [3bd3c0b]
|
|
653
|
+
- Updated dependencies [7ea4132]
|
|
654
|
+
- @ai-sdk/provider@2.0.0-canary.8
|
|
655
|
+
- @ai-sdk/openai@2.0.0-canary.10
|
|
656
|
+
- @ai-sdk/provider-utils@3.0.0-canary.9
|
|
657
|
+
|
|
658
|
+
## 2.0.0-canary.10
|
|
659
|
+
|
|
660
|
+
### Patch Changes
|
|
661
|
+
|
|
662
|
+
- Updated dependencies [d63bcbc]
|
|
663
|
+
- Updated dependencies [d2af019]
|
|
664
|
+
- Updated dependencies [870c5c0]
|
|
665
|
+
- Updated dependencies [06bac05]
|
|
666
|
+
- @ai-sdk/openai@2.0.0-canary.9
|
|
667
|
+
|
|
668
|
+
## 2.0.0-canary.9
|
|
669
|
+
|
|
670
|
+
### Patch Changes
|
|
671
|
+
|
|
672
|
+
- 3b13ccf: feat(providers/azure): add transcribe
|
|
673
|
+
- Updated dependencies [5d142ab]
|
|
674
|
+
- Updated dependencies [b6b43c7]
|
|
675
|
+
- Updated dependencies [8aa9e20]
|
|
676
|
+
- Updated dependencies [3795467]
|
|
677
|
+
- @ai-sdk/provider-utils@3.0.0-canary.8
|
|
678
|
+
- @ai-sdk/provider@2.0.0-canary.7
|
|
679
|
+
- @ai-sdk/openai@2.0.0-canary.8
|
|
680
|
+
|
|
3
681
|
## 2.0.0-canary.8
|
|
4
682
|
|
|
5
683
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI SDK - Azure OpenAI Provider
|
|
2
2
|
|
|
3
|
-
The **[Azure provider](https://sdk.
|
|
3
|
+
The **[Azure provider](https://ai-sdk.dev/providers/ai-sdk-providers/azure)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the Azure OpenAI API.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
@@ -32,4 +32,4 @@ const { text } = await generateText({
|
|
|
32
32
|
|
|
33
33
|
## Documentation
|
|
34
34
|
|
|
35
|
-
Please check out the **[Azure provider](https://sdk.
|
|
35
|
+
Please check out the **[Azure provider](https://ai-sdk.dev/providers/ai-sdk-providers/azure)** for more information.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV1 } from '@ai-sdk/provider';
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
|
|
3
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
3
|
|
|
5
4
|
interface AzureOpenAIProvider extends ProviderV2 {
|
|
6
|
-
(deploymentId: string
|
|
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
|
*/
|
|
@@ -19,41 +18,45 @@ interface AzureOpenAIProvider extends ProviderV2 {
|
|
|
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
|
-
@deprecated Use `
|
|
23
|
+
@deprecated Use `textEmbedding` 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
|
-
* @deprecated Use `imageModel` instead.
|
|
30
28
|
*/
|
|
31
|
-
image(deploymentId: string
|
|
29
|
+
image(deploymentId: string): ImageModelV2;
|
|
32
30
|
/**
|
|
33
31
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
34
32
|
*/
|
|
35
|
-
imageModel(deploymentId: string
|
|
33
|
+
imageModel(deploymentId: string): ImageModelV2;
|
|
34
|
+
textEmbedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
36
35
|
/**
|
|
37
|
-
|
|
36
|
+
Creates an Azure OpenAI model for text embeddings.
|
|
38
37
|
*/
|
|
39
|
-
|
|
38
|
+
textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;
|
|
40
39
|
/**
|
|
41
|
-
|
|
40
|
+
* Creates an Azure OpenAI model for audio transcription.
|
|
41
|
+
*/
|
|
42
|
+
transcription(deploymentId: string): TranscriptionModelV2;
|
|
43
|
+
/**
|
|
44
|
+
* Creates an Azure OpenAI model for speech generation.
|
|
42
45
|
*/
|
|
43
|
-
|
|
46
|
+
speech(deploymentId: string): SpeechModelV2;
|
|
44
47
|
}
|
|
45
48
|
interface AzureOpenAIProviderSettings {
|
|
46
49
|
/**
|
|
47
50
|
Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
|
|
48
51
|
|
|
49
|
-
The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/
|
|
52
|
+
The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
|
|
50
53
|
*/
|
|
51
54
|
resourceName?: string;
|
|
52
55
|
/**
|
|
53
56
|
Use a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.
|
|
54
57
|
When a baseURL is provided, the resourceName is ignored.
|
|
55
58
|
|
|
56
|
-
With a baseURL, the resolved URL is `{baseURL}/{
|
|
59
|
+
With a baseURL, the resolved URL is `{baseURL}/v1{path}`.
|
|
57
60
|
*/
|
|
58
61
|
baseURL?: string;
|
|
59
62
|
/**
|
|
@@ -70,7 +73,7 @@ interface AzureOpenAIProviderSettings {
|
|
|
70
73
|
*/
|
|
71
74
|
fetch?: FetchFunction;
|
|
72
75
|
/**
|
|
73
|
-
Custom api version to use. Defaults to `
|
|
76
|
+
Custom api version to use. Defaults to `preview`.
|
|
74
77
|
*/
|
|
75
78
|
apiVersion?: string;
|
|
76
79
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV1 } from '@ai-sdk/provider';
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
|
|
3
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
3
|
|
|
5
4
|
interface AzureOpenAIProvider extends ProviderV2 {
|
|
6
|
-
(deploymentId: string
|
|
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
|
*/
|
|
@@ -19,41 +18,45 @@ interface AzureOpenAIProvider extends ProviderV2 {
|
|
|
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
|
-
@deprecated Use `
|
|
23
|
+
@deprecated Use `textEmbedding` 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
|
-
* @deprecated Use `imageModel` instead.
|
|
30
28
|
*/
|
|
31
|
-
image(deploymentId: string
|
|
29
|
+
image(deploymentId: string): ImageModelV2;
|
|
32
30
|
/**
|
|
33
31
|
* Creates an Azure OpenAI DALL-E model for image generation.
|
|
34
32
|
*/
|
|
35
|
-
imageModel(deploymentId: string
|
|
33
|
+
imageModel(deploymentId: string): ImageModelV2;
|
|
34
|
+
textEmbedding(deploymentId: string): EmbeddingModelV2<string>;
|
|
36
35
|
/**
|
|
37
|
-
|
|
36
|
+
Creates an Azure OpenAI model for text embeddings.
|
|
38
37
|
*/
|
|
39
|
-
|
|
38
|
+
textEmbeddingModel(deploymentId: string): EmbeddingModelV2<string>;
|
|
40
39
|
/**
|
|
41
|
-
|
|
40
|
+
* Creates an Azure OpenAI model for audio transcription.
|
|
41
|
+
*/
|
|
42
|
+
transcription(deploymentId: string): TranscriptionModelV2;
|
|
43
|
+
/**
|
|
44
|
+
* Creates an Azure OpenAI model for speech generation.
|
|
42
45
|
*/
|
|
43
|
-
|
|
46
|
+
speech(deploymentId: string): SpeechModelV2;
|
|
44
47
|
}
|
|
45
48
|
interface AzureOpenAIProviderSettings {
|
|
46
49
|
/**
|
|
47
50
|
Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
|
|
48
51
|
|
|
49
|
-
The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/
|
|
52
|
+
The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
|
|
50
53
|
*/
|
|
51
54
|
resourceName?: string;
|
|
52
55
|
/**
|
|
53
56
|
Use a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.
|
|
54
57
|
When a baseURL is provided, the resourceName is ignored.
|
|
55
58
|
|
|
56
|
-
With a baseURL, the resolved URL is `{baseURL}/{
|
|
59
|
+
With a baseURL, the resolved URL is `{baseURL}/v1{path}`.
|
|
57
60
|
*/
|
|
58
61
|
baseURL?: string;
|
|
59
62
|
/**
|
|
@@ -70,7 +73,7 @@ interface AzureOpenAIProviderSettings {
|
|
|
70
73
|
*/
|
|
71
74
|
fetch?: FetchFunction;
|
|
72
75
|
/**
|
|
73
|
-
Custom api version to use. Defaults to `
|
|
76
|
+
Custom api version to use. Defaults to `preview`.
|
|
74
77
|
*/
|
|
75
78
|
apiVersion?: string;
|
|
76
79
|
}
|
package/dist/index.js
CHANGED
|
@@ -44,52 +44,63 @@ function createAzure(options = {}) {
|
|
|
44
44
|
environmentVariableName: "AZURE_RESOURCE_NAME",
|
|
45
45
|
description: "Azure OpenAI resource name"
|
|
46
46
|
});
|
|
47
|
-
const apiVersion = (_a = options.apiVersion) != null ? _a : "
|
|
47
|
+
const apiVersion = (_a = options.apiVersion) != null ? _a : "preview";
|
|
48
48
|
const url = ({ path, modelId }) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
49
|
+
var _a2;
|
|
50
|
+
const baseUrlPrefix = (_a2 = options.baseURL) != null ? _a2 : `https://${getResourceName()}.openai.azure.com/openai`;
|
|
51
|
+
const fullUrl = new URL(`${baseUrlPrefix}/v1${path}`);
|
|
52
|
+
fullUrl.searchParams.set("api-version", apiVersion);
|
|
53
|
+
return fullUrl.toString();
|
|
53
54
|
};
|
|
54
|
-
const createChatModel = (deploymentName
|
|
55
|
-
provider: "azure
|
|
55
|
+
const createChatModel = (deploymentName) => new import_internal.OpenAIChatLanguageModel(deploymentName, {
|
|
56
|
+
provider: "azure.chat",
|
|
56
57
|
url,
|
|
57
58
|
headers: getHeaders,
|
|
58
|
-
compatibility: "strict",
|
|
59
59
|
fetch: options.fetch
|
|
60
60
|
});
|
|
61
|
-
const createCompletionModel = (modelId
|
|
62
|
-
provider: "azure
|
|
61
|
+
const createCompletionModel = (modelId) => new import_internal.OpenAICompletionLanguageModel(modelId, {
|
|
62
|
+
provider: "azure.completion",
|
|
63
63
|
url,
|
|
64
|
-
compatibility: "strict",
|
|
65
64
|
headers: getHeaders,
|
|
66
65
|
fetch: options.fetch
|
|
67
66
|
});
|
|
68
|
-
const createEmbeddingModel = (modelId
|
|
69
|
-
provider: "azure
|
|
67
|
+
const createEmbeddingModel = (modelId) => new import_internal.OpenAIEmbeddingModel(modelId, {
|
|
68
|
+
provider: "azure.embeddings",
|
|
70
69
|
headers: getHeaders,
|
|
71
70
|
url,
|
|
72
71
|
fetch: options.fetch
|
|
73
72
|
});
|
|
74
73
|
const createResponsesModel = (modelId) => new import_internal.OpenAIResponsesLanguageModel(modelId, {
|
|
75
|
-
provider: "azure
|
|
74
|
+
provider: "azure.responses",
|
|
75
|
+
url,
|
|
76
|
+
headers: getHeaders,
|
|
77
|
+
fetch: options.fetch
|
|
78
|
+
});
|
|
79
|
+
const createImageModel = (modelId) => new import_internal.OpenAIImageModel(modelId, {
|
|
80
|
+
provider: "azure.image",
|
|
81
|
+
url,
|
|
82
|
+
headers: getHeaders,
|
|
83
|
+
fetch: options.fetch
|
|
84
|
+
});
|
|
85
|
+
const createTranscriptionModel = (modelId) => new import_internal.OpenAITranscriptionModel(modelId, {
|
|
86
|
+
provider: "azure.transcription",
|
|
76
87
|
url,
|
|
77
88
|
headers: getHeaders,
|
|
78
89
|
fetch: options.fetch
|
|
79
90
|
});
|
|
80
|
-
const
|
|
81
|
-
provider: "azure
|
|
91
|
+
const createSpeechModel = (modelId) => new import_internal.OpenAISpeechModel(modelId, {
|
|
92
|
+
provider: "azure.speech",
|
|
82
93
|
url,
|
|
83
94
|
headers: getHeaders,
|
|
84
95
|
fetch: options.fetch
|
|
85
96
|
});
|
|
86
|
-
const provider = function(deploymentId
|
|
97
|
+
const provider = function(deploymentId) {
|
|
87
98
|
if (new.target) {
|
|
88
99
|
throw new Error(
|
|
89
100
|
"The Azure OpenAI model function cannot be called with the new keyword."
|
|
90
101
|
);
|
|
91
102
|
}
|
|
92
|
-
return createChatModel(deploymentId
|
|
103
|
+
return createChatModel(deploymentId);
|
|
93
104
|
};
|
|
94
105
|
provider.languageModel = createChatModel;
|
|
95
106
|
provider.chat = createChatModel;
|
|
@@ -100,6 +111,8 @@ function createAzure(options = {}) {
|
|
|
100
111
|
provider.textEmbedding = createEmbeddingModel;
|
|
101
112
|
provider.textEmbeddingModel = createEmbeddingModel;
|
|
102
113
|
provider.responses = createResponsesModel;
|
|
114
|
+
provider.transcription = createTranscriptionModel;
|
|
115
|
+
provider.speech = createSpeechModel;
|
|
103
116
|
return provider;
|
|
104
117
|
}
|
|
105
118
|
var azure = createAzure();
|
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 OpenAISpeechModel,\n OpenAITranscriptionModel,\n} from '@ai-sdk/openai/internal';\nimport {\n EmbeddingModelV2,\n LanguageModelV2,\n ProviderV2,\n ImageModelV2,\n SpeechModelV2,\n TranscriptionModelV2,\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 `textEmbedding` instead.\n */\n embedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\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 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): TranscriptionModelV2;\n\n /**\n * Creates an Azure OpenAI model for speech generation.\n */\n speech(deploymentId: string): SpeechModelV2;\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/v1{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}/v1{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 `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 ?? 'preview';\n\n const url = ({ path, modelId }: { path: string; modelId: string }) => {\n const baseUrlPrefix =\n options.baseURL ?? `https://${getResourceName()}.openai.azure.com/openai`;\n // Use v1 API format - no deployment ID in URL\n const fullUrl = new URL(`${baseUrlPrefix}/v1${path}`);\n fullUrl.searchParams.set('api-version', apiVersion);\n return fullUrl.toString();\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 createSpeechModel = (modelId: string) =>\n new OpenAISpeechModel(modelId, {\n provider: 'azure.speech',\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 provider.speech = createSpeechModel;\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,sBAQO;AASP,4BAAuD;AAmGhD,SAAS,YACd,UAAuC,CAAC,GACnB;AAtHvB;AAuHE,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;AAEzC,QAAM,MAAM,CAAC,EAAE,MAAM,QAAQ,MAAyC;AA1IxE,QAAAA;AA2II,UAAM,iBACJA,MAAA,QAAQ,YAAR,OAAAA,MAAmB,WAAW,gBAAgB,CAAC;AAEjD,UAAM,UAAU,IAAI,IAAI,GAAG,aAAa,MAAM,IAAI,EAAE;AACpD,YAAQ,aAAa,IAAI,eAAe,UAAU;AAClD,WAAO,QAAQ,SAAS;AAAA,EAC1B;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,oBAAoB,CAAC,YACzB,IAAI,kCAAkB,SAAS;AAAA,IAC7B,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,WAAS,SAAS;AAClB,SAAO;AACT;AAKO,IAAM,QAAQ,YAAY;","names":["_a"]}
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
OpenAICompletionLanguageModel,
|
|
5
5
|
OpenAIEmbeddingModel,
|
|
6
6
|
OpenAIImageModel,
|
|
7
|
-
OpenAIResponsesLanguageModel
|
|
7
|
+
OpenAIResponsesLanguageModel,
|
|
8
|
+
OpenAISpeechModel,
|
|
9
|
+
OpenAITranscriptionModel
|
|
8
10
|
} from "@ai-sdk/openai/internal";
|
|
9
11
|
import { loadApiKey, loadSetting } from "@ai-sdk/provider-utils";
|
|
10
12
|
function createAzure(options = {}) {
|
|
@@ -23,52 +25,63 @@ function createAzure(options = {}) {
|
|
|
23
25
|
environmentVariableName: "AZURE_RESOURCE_NAME",
|
|
24
26
|
description: "Azure OpenAI resource name"
|
|
25
27
|
});
|
|
26
|
-
const apiVersion = (_a = options.apiVersion) != null ? _a : "
|
|
28
|
+
const apiVersion = (_a = options.apiVersion) != null ? _a : "preview";
|
|
27
29
|
const url = ({ path, modelId }) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
30
|
+
var _a2;
|
|
31
|
+
const baseUrlPrefix = (_a2 = options.baseURL) != null ? _a2 : `https://${getResourceName()}.openai.azure.com/openai`;
|
|
32
|
+
const fullUrl = new URL(`${baseUrlPrefix}/v1${path}`);
|
|
33
|
+
fullUrl.searchParams.set("api-version", apiVersion);
|
|
34
|
+
return fullUrl.toString();
|
|
32
35
|
};
|
|
33
|
-
const createChatModel = (deploymentName
|
|
34
|
-
provider: "azure
|
|
36
|
+
const createChatModel = (deploymentName) => new OpenAIChatLanguageModel(deploymentName, {
|
|
37
|
+
provider: "azure.chat",
|
|
35
38
|
url,
|
|
36
39
|
headers: getHeaders,
|
|
37
|
-
compatibility: "strict",
|
|
38
40
|
fetch: options.fetch
|
|
39
41
|
});
|
|
40
|
-
const createCompletionModel = (modelId
|
|
41
|
-
provider: "azure
|
|
42
|
+
const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
|
|
43
|
+
provider: "azure.completion",
|
|
42
44
|
url,
|
|
43
|
-
compatibility: "strict",
|
|
44
45
|
headers: getHeaders,
|
|
45
46
|
fetch: options.fetch
|
|
46
47
|
});
|
|
47
|
-
const createEmbeddingModel = (modelId
|
|
48
|
-
provider: "azure
|
|
48
|
+
const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
|
|
49
|
+
provider: "azure.embeddings",
|
|
49
50
|
headers: getHeaders,
|
|
50
51
|
url,
|
|
51
52
|
fetch: options.fetch
|
|
52
53
|
});
|
|
53
54
|
const createResponsesModel = (modelId) => new OpenAIResponsesLanguageModel(modelId, {
|
|
54
|
-
provider: "azure
|
|
55
|
+
provider: "azure.responses",
|
|
56
|
+
url,
|
|
57
|
+
headers: getHeaders,
|
|
58
|
+
fetch: options.fetch
|
|
59
|
+
});
|
|
60
|
+
const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
|
|
61
|
+
provider: "azure.image",
|
|
62
|
+
url,
|
|
63
|
+
headers: getHeaders,
|
|
64
|
+
fetch: options.fetch
|
|
65
|
+
});
|
|
66
|
+
const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
|
|
67
|
+
provider: "azure.transcription",
|
|
55
68
|
url,
|
|
56
69
|
headers: getHeaders,
|
|
57
70
|
fetch: options.fetch
|
|
58
71
|
});
|
|
59
|
-
const
|
|
60
|
-
provider: "azure
|
|
72
|
+
const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
|
|
73
|
+
provider: "azure.speech",
|
|
61
74
|
url,
|
|
62
75
|
headers: getHeaders,
|
|
63
76
|
fetch: options.fetch
|
|
64
77
|
});
|
|
65
|
-
const provider = function(deploymentId
|
|
78
|
+
const provider = function(deploymentId) {
|
|
66
79
|
if (new.target) {
|
|
67
80
|
throw new Error(
|
|
68
81
|
"The Azure OpenAI model function cannot be called with the new keyword."
|
|
69
82
|
);
|
|
70
83
|
}
|
|
71
|
-
return createChatModel(deploymentId
|
|
84
|
+
return createChatModel(deploymentId);
|
|
72
85
|
};
|
|
73
86
|
provider.languageModel = createChatModel;
|
|
74
87
|
provider.chat = createChatModel;
|
|
@@ -79,6 +92,8 @@ function createAzure(options = {}) {
|
|
|
79
92
|
provider.textEmbedding = createEmbeddingModel;
|
|
80
93
|
provider.textEmbeddingModel = createEmbeddingModel;
|
|
81
94
|
provider.responses = createResponsesModel;
|
|
95
|
+
provider.transcription = createTranscriptionModel;
|
|
96
|
+
provider.speech = createSpeechModel;
|
|
82
97
|
return provider;
|
|
83
98
|
}
|
|
84
99
|
var azure = createAzure();
|
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 OpenAISpeechModel,\n OpenAITranscriptionModel,\n} from '@ai-sdk/openai/internal';\nimport {\n EmbeddingModelV2,\n LanguageModelV2,\n ProviderV2,\n ImageModelV2,\n SpeechModelV2,\n TranscriptionModelV2,\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 `textEmbedding` instead.\n */\n embedding(deploymentId: string): EmbeddingModelV2<string>;\n\n /**\n * Creates an Azure OpenAI DALL-E model for image generation.\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 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): TranscriptionModelV2;\n\n /**\n * Creates an Azure OpenAI model for speech generation.\n */\n speech(deploymentId: string): SpeechModelV2;\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/v1{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}/v1{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 `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 ?? 'preview';\n\n const url = ({ path, modelId }: { path: string; modelId: string }) => {\n const baseUrlPrefix =\n options.baseURL ?? `https://${getResourceName()}.openai.azure.com/openai`;\n // Use v1 API format - no deployment ID in URL\n const fullUrl = new URL(`${baseUrlPrefix}/v1${path}`);\n fullUrl.searchParams.set('api-version', apiVersion);\n return fullUrl.toString();\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 createSpeechModel = (modelId: string) =>\n new OpenAISpeechModel(modelId, {\n provider: 'azure.speech',\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 provider.speech = createSpeechModel;\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,EACA;AAAA,OACK;AASP,SAAwB,YAAY,mBAAmB;AAmGhD,SAAS,YACd,UAAuC,CAAC,GACnB;AAtHvB;AAuHE,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;AAEzC,QAAM,MAAM,CAAC,EAAE,MAAM,QAAQ,MAAyC;AA1IxE,QAAAA;AA2II,UAAM,iBACJA,MAAA,QAAQ,YAAR,OAAAA,MAAmB,WAAW,gBAAgB,CAAC;AAEjD,UAAM,UAAU,IAAI,IAAI,GAAG,aAAa,MAAM,IAAI,EAAE;AACpD,YAAQ,aAAa,IAAI,eAAe,UAAU;AAClD,WAAO,QAAQ,SAAS;AAAA,EAC1B;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,oBAAoB,CAAC,YACzB,IAAI,kBAAkB,SAAS;AAAA,IAC7B,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,WAAS,SAAS;AAClB,SAAO;AACT;AAKO,IAAM,QAAQ,YAAY;","names":["_a"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/azure",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
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": "2.0.0
|
|
23
|
-
"@ai-sdk/provider": "2.0.0
|
|
24
|
-
"@ai-sdk/provider-utils": "3.0.0
|
|
22
|
+
"@ai-sdk/openai": "2.0.0",
|
|
23
|
+
"@ai-sdk/provider": "2.0.0",
|
|
24
|
+
"@ai-sdk/provider-utils": "3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "20.17.24",
|
|
28
28
|
"tsup": "^8",
|
|
29
29
|
"typescript": "5.8.3",
|
|
30
|
-
"zod": "3.
|
|
30
|
+
"zod": "3.25.76",
|
|
31
31
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"zod": "^3.
|
|
34
|
+
"zod": "^3.25.76 || ^4"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"homepage": "https://sdk.
|
|
42
|
+
"homepage": "https://ai-sdk.dev/docs",
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "git+https://github.com/vercel/ai.git"
|
|
@@ -58,8 +58,9 @@
|
|
|
58
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
|
}
|