@ai-sdk/huggingface 2.0.0-beta.4 → 2.0.0-beta.57
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 +487 -4
- package/README.md +2 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +298 -267
- package/dist/index.js.map +1 -1
- package/docs/170-huggingface.mdx +22 -20
- package/package.json +15 -15
- package/src/huggingface-config.ts +2 -2
- package/src/huggingface-provider.ts +10 -10
- package/src/index.ts +7 -1
- package/src/responses/convert-huggingface-responses-usage.ts +2 -2
- package/src/responses/convert-to-huggingface-responses-messages.ts +36 -22
- package/src/responses/huggingface-responses-language-model-options.ts +12 -0
- package/src/responses/huggingface-responses-language-model.ts +47 -33
- package/src/responses/huggingface-responses-prepare-tools.ts +8 -5
- package/src/responses/map-huggingface-responses-finish-reason.ts +2 -2
- package/src/version.ts +6 -0
- package/dist/index.d.mts +0 -59
- package/dist/index.mjs +0 -974
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,488 @@
|
|
|
1
1
|
# @ai-sdk/huggingface
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.57
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b8396f0: trigger initial beta release
|
|
8
|
+
- Updated dependencies [b8396f0]
|
|
9
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.57
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.0-beta.49
|
|
11
|
+
- @ai-sdk/provider@4.0.0-beta.19
|
|
12
|
+
|
|
13
|
+
## 2.0.0-canary.56
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [aeda373]
|
|
18
|
+
- Updated dependencies [375fdd7]
|
|
19
|
+
- Updated dependencies [b4507d5]
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.0-canary.48
|
|
21
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.56
|
|
22
|
+
|
|
23
|
+
## 2.0.0-canary.55
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [bae5e2b]
|
|
28
|
+
- @ai-sdk/provider-utils@5.0.0-canary.47
|
|
29
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.55
|
|
30
|
+
|
|
31
|
+
## 2.0.0-canary.54
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [ce769dd]
|
|
36
|
+
- @ai-sdk/provider@4.0.0-canary.18
|
|
37
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.54
|
|
38
|
+
- @ai-sdk/provider-utils@5.0.0-canary.46
|
|
39
|
+
|
|
40
|
+
## 2.0.0-canary.53
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [ee798eb]
|
|
45
|
+
- Updated dependencies [daf6637]
|
|
46
|
+
- @ai-sdk/provider-utils@5.0.0-canary.45
|
|
47
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.53
|
|
48
|
+
|
|
49
|
+
## 2.0.0-canary.52
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [6c93e36]
|
|
54
|
+
- Updated dependencies [f617ac2]
|
|
55
|
+
- @ai-sdk/provider-utils@5.0.0-canary.44
|
|
56
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.52
|
|
57
|
+
|
|
58
|
+
## 2.0.0-canary.51
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- Updated dependencies [9f1e1ba]
|
|
63
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.51
|
|
64
|
+
|
|
65
|
+
## 2.0.0-canary.50
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
|
|
70
|
+
- Updated dependencies [7fc6bd6]
|
|
71
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.50
|
|
72
|
+
- @ai-sdk/provider-utils@5.0.0-canary.43
|
|
73
|
+
- @ai-sdk/provider@4.0.0-canary.17
|
|
74
|
+
|
|
75
|
+
## 2.0.0-canary.49
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- Updated dependencies [a6617c5]
|
|
80
|
+
- @ai-sdk/provider-utils@5.0.0-canary.42
|
|
81
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.49
|
|
82
|
+
|
|
83
|
+
## 2.0.0-canary.48
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies [28dfa06]
|
|
88
|
+
- Updated dependencies [e93fa91]
|
|
89
|
+
- @ai-sdk/provider-utils@5.0.0-canary.41
|
|
90
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.48
|
|
91
|
+
|
|
92
|
+
## 2.0.0-canary.47
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- Updated dependencies [a7de9c9]
|
|
97
|
+
- @ai-sdk/provider-utils@5.0.0-canary.40
|
|
98
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.47
|
|
99
|
+
|
|
100
|
+
## 2.0.0-canary.46
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [105f95b]
|
|
105
|
+
- @ai-sdk/provider-utils@5.0.0-canary.39
|
|
106
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.46
|
|
107
|
+
|
|
108
|
+
## 2.0.0-canary.45
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [ca446f8]
|
|
113
|
+
- @ai-sdk/provider-utils@5.0.0-canary.38
|
|
114
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.45
|
|
115
|
+
|
|
116
|
+
## 2.0.0-canary.44
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [d848405]
|
|
121
|
+
- @ai-sdk/provider-utils@5.0.0-canary.37
|
|
122
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.44
|
|
123
|
+
|
|
124
|
+
## 2.0.0-canary.43
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [ca39020]
|
|
129
|
+
- @ai-sdk/provider-utils@5.0.0-canary.36
|
|
130
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.43
|
|
131
|
+
|
|
132
|
+
## 2.0.0-canary.42
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Updated dependencies [f634bac]
|
|
137
|
+
- @ai-sdk/provider-utils@5.0.0-canary.35
|
|
138
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.42
|
|
139
|
+
|
|
140
|
+
## 2.0.0-canary.41
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- Updated dependencies [69254e0]
|
|
145
|
+
- Updated dependencies [3015fc3]
|
|
146
|
+
- @ai-sdk/provider-utils@5.0.0-canary.34
|
|
147
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.41
|
|
148
|
+
|
|
149
|
+
## 2.0.0-canary.40
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- Updated dependencies [2427d88]
|
|
154
|
+
- @ai-sdk/provider-utils@5.0.0-canary.33
|
|
155
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.40
|
|
156
|
+
|
|
157
|
+
## 2.0.0-canary.39
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- Updated dependencies [5463d0d]
|
|
162
|
+
- @ai-sdk/provider-utils@5.0.0-canary.32
|
|
163
|
+
- @ai-sdk/provider@4.0.0-canary.16
|
|
164
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.39
|
|
165
|
+
|
|
166
|
+
## 2.0.0-canary.38
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- Updated dependencies [cd9c311]
|
|
171
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.38
|
|
172
|
+
|
|
173
|
+
## 2.0.0-canary.37
|
|
174
|
+
|
|
175
|
+
### Patch Changes
|
|
176
|
+
|
|
177
|
+
- 0c4c275: trigger initial canary release
|
|
178
|
+
- Updated dependencies [0c4c275]
|
|
179
|
+
- @ai-sdk/openai-compatible@3.0.0-canary.37
|
|
180
|
+
- @ai-sdk/provider-utils@5.0.0-canary.31
|
|
181
|
+
- @ai-sdk/provider@4.0.0-canary.15
|
|
182
|
+
|
|
183
|
+
## 2.0.0-beta.36
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [e59c955]
|
|
188
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.36
|
|
189
|
+
|
|
190
|
+
## 2.0.0-beta.35
|
|
191
|
+
|
|
192
|
+
### Major Changes
|
|
193
|
+
|
|
194
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
195
|
+
|
|
196
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
197
|
+
|
|
198
|
+
### Patch Changes
|
|
199
|
+
|
|
200
|
+
- Updated dependencies [08d2129]
|
|
201
|
+
- Updated dependencies [04e9009]
|
|
202
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
203
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.35
|
|
204
|
+
|
|
205
|
+
## 2.0.0-beta.34
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
|
|
210
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
211
|
+
- Updated dependencies [9bd6512]
|
|
212
|
+
- Updated dependencies [258c093]
|
|
213
|
+
- Updated dependencies [b6783da]
|
|
214
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.34
|
|
215
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
216
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
217
|
+
|
|
218
|
+
## 2.0.0-beta.33
|
|
219
|
+
|
|
220
|
+
### Patch Changes
|
|
221
|
+
|
|
222
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
223
|
+
- Updated dependencies [9f0e36c]
|
|
224
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.33
|
|
225
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
226
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
227
|
+
|
|
228
|
+
## 2.0.0-beta.32
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- Updated dependencies [ab81968]
|
|
233
|
+
- Updated dependencies [785fe16]
|
|
234
|
+
- Updated dependencies [67df0a0]
|
|
235
|
+
- Updated dependencies [befb78c]
|
|
236
|
+
- Updated dependencies [0458559]
|
|
237
|
+
- Updated dependencies [58a2ad7]
|
|
238
|
+
- Updated dependencies [5852c0a]
|
|
239
|
+
- Updated dependencies [fc92055]
|
|
240
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.32
|
|
241
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
242
|
+
|
|
243
|
+
## 2.0.0-beta.31
|
|
244
|
+
|
|
245
|
+
### Patch Changes
|
|
246
|
+
|
|
247
|
+
- Updated dependencies [2e98477]
|
|
248
|
+
- Updated dependencies [bfb756d]
|
|
249
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
250
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.31
|
|
251
|
+
|
|
252
|
+
## 2.0.0-beta.30
|
|
253
|
+
|
|
254
|
+
### Patch Changes
|
|
255
|
+
|
|
256
|
+
- Updated dependencies [eea8d98]
|
|
257
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
258
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.30
|
|
259
|
+
|
|
260
|
+
## 2.0.0-beta.29
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- Updated dependencies [f807e45]
|
|
265
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
266
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.29
|
|
267
|
+
|
|
268
|
+
## 2.0.0-beta.28
|
|
269
|
+
|
|
270
|
+
### Patch Changes
|
|
271
|
+
|
|
272
|
+
- Updated dependencies [350ea38]
|
|
273
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
274
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.28
|
|
275
|
+
|
|
276
|
+
## 2.0.0-beta.27
|
|
277
|
+
|
|
278
|
+
### Patch Changes
|
|
279
|
+
|
|
280
|
+
- Updated dependencies [083947b]
|
|
281
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
282
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.27
|
|
283
|
+
|
|
284
|
+
## 2.0.0-beta.26
|
|
285
|
+
|
|
286
|
+
### Patch Changes
|
|
287
|
+
|
|
288
|
+
- Updated dependencies [add1126]
|
|
289
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
290
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.26
|
|
291
|
+
|
|
292
|
+
## 2.0.0-beta.25
|
|
293
|
+
|
|
294
|
+
### Patch Changes
|
|
295
|
+
|
|
296
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
297
|
+
|
|
298
|
+
**`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
|
|
299
|
+
|
|
300
|
+
**All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
|
|
301
|
+
|
|
302
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
303
|
+
|
|
304
|
+
- Updated dependencies [b3976a2]
|
|
305
|
+
- Updated dependencies [ff5eba1]
|
|
306
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
307
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.25
|
|
308
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
309
|
+
|
|
310
|
+
## 2.0.0-beta.24
|
|
311
|
+
|
|
312
|
+
### Major Changes
|
|
313
|
+
|
|
314
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
315
|
+
|
|
316
|
+
### Patch Changes
|
|
317
|
+
|
|
318
|
+
- Updated dependencies [ef992f8]
|
|
319
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.24
|
|
320
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
321
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
322
|
+
|
|
323
|
+
## 2.0.0-beta.23
|
|
324
|
+
|
|
325
|
+
### Patch Changes
|
|
326
|
+
|
|
327
|
+
- Updated dependencies [90e2d8a]
|
|
328
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.23
|
|
329
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
330
|
+
|
|
331
|
+
## 2.0.0-beta.22
|
|
332
|
+
|
|
333
|
+
### Patch Changes
|
|
334
|
+
|
|
335
|
+
- Updated dependencies [3ae1786]
|
|
336
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
337
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.22
|
|
338
|
+
|
|
339
|
+
## 2.0.0-beta.21
|
|
340
|
+
|
|
341
|
+
### Patch Changes
|
|
342
|
+
|
|
343
|
+
- Updated dependencies [176466a]
|
|
344
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
345
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.21
|
|
346
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
347
|
+
|
|
348
|
+
## 2.0.0-beta.20
|
|
349
|
+
|
|
350
|
+
### Patch Changes
|
|
351
|
+
|
|
352
|
+
- Updated dependencies [e311194]
|
|
353
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
354
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.20
|
|
355
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
356
|
+
|
|
357
|
+
## 2.0.0-beta.19
|
|
358
|
+
|
|
359
|
+
### Patch Changes
|
|
360
|
+
|
|
361
|
+
- Updated dependencies [34bd95d]
|
|
362
|
+
- Updated dependencies [008271d]
|
|
363
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
364
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.19
|
|
365
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
366
|
+
|
|
367
|
+
## 2.0.0-beta.18
|
|
368
|
+
|
|
369
|
+
### Patch Changes
|
|
370
|
+
|
|
371
|
+
- Updated dependencies [b0c2869]
|
|
372
|
+
- Updated dependencies [7e26e81]
|
|
373
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
374
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.18
|
|
375
|
+
|
|
376
|
+
## 2.0.0-beta.17
|
|
377
|
+
|
|
378
|
+
### Patch Changes
|
|
379
|
+
|
|
380
|
+
- Updated dependencies [816ff67]
|
|
381
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.17
|
|
382
|
+
|
|
383
|
+
## 2.0.0-beta.16
|
|
384
|
+
|
|
385
|
+
### Patch Changes
|
|
386
|
+
|
|
387
|
+
- Updated dependencies [46d1149]
|
|
388
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
389
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.16
|
|
390
|
+
|
|
391
|
+
## 2.0.0-beta.15
|
|
392
|
+
|
|
393
|
+
### Patch Changes
|
|
394
|
+
|
|
395
|
+
- Updated dependencies [6fd51c0]
|
|
396
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
397
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
398
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.15
|
|
399
|
+
|
|
400
|
+
## 2.0.0-beta.14
|
|
401
|
+
|
|
402
|
+
### Patch Changes
|
|
403
|
+
|
|
404
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
405
|
+
- Updated dependencies [c29a26f]
|
|
406
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.14
|
|
407
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
408
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
409
|
+
|
|
410
|
+
## 2.0.0-beta.13
|
|
411
|
+
|
|
412
|
+
### Patch Changes
|
|
413
|
+
|
|
414
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
415
|
+
- Updated dependencies [38fc777]
|
|
416
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.13
|
|
417
|
+
|
|
418
|
+
## 2.0.0-beta.12
|
|
419
|
+
|
|
420
|
+
### Patch Changes
|
|
421
|
+
|
|
422
|
+
- Updated dependencies [2e17091]
|
|
423
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
424
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.12
|
|
425
|
+
|
|
426
|
+
## 2.0.0-beta.11
|
|
427
|
+
|
|
428
|
+
### Patch Changes
|
|
429
|
+
|
|
430
|
+
- Updated dependencies [986c6fd]
|
|
431
|
+
- Updated dependencies [493295c]
|
|
432
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
433
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.11
|
|
434
|
+
|
|
435
|
+
## 2.0.0-beta.10
|
|
436
|
+
|
|
437
|
+
### Patch Changes
|
|
438
|
+
|
|
439
|
+
- Updated dependencies [1f509d4]
|
|
440
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
441
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
442
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.10
|
|
443
|
+
|
|
444
|
+
## 2.0.0-beta.9
|
|
445
|
+
|
|
446
|
+
### Patch Changes
|
|
447
|
+
|
|
448
|
+
- Updated dependencies [74d520f]
|
|
449
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.9
|
|
450
|
+
|
|
451
|
+
## 2.0.0-beta.8
|
|
452
|
+
|
|
453
|
+
### Patch Changes
|
|
454
|
+
|
|
455
|
+
- Updated dependencies [3887c70]
|
|
456
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
457
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
458
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.8
|
|
459
|
+
|
|
460
|
+
## 2.0.0-beta.7
|
|
461
|
+
|
|
462
|
+
### Patch Changes
|
|
463
|
+
|
|
464
|
+
- Updated dependencies [776b617]
|
|
465
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
466
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
467
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.7
|
|
468
|
+
|
|
469
|
+
## 2.0.0-beta.6
|
|
470
|
+
|
|
471
|
+
### Patch Changes
|
|
472
|
+
|
|
473
|
+
- Updated dependencies [61753c3]
|
|
474
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
475
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.6
|
|
476
|
+
|
|
477
|
+
## 2.0.0-beta.5
|
|
478
|
+
|
|
479
|
+
### Patch Changes
|
|
480
|
+
|
|
481
|
+
- Updated dependencies [f7d4f01]
|
|
482
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
483
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
484
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.5
|
|
485
|
+
|
|
3
486
|
## 2.0.0-beta.4
|
|
4
487
|
|
|
5
488
|
### Patch Changes
|
|
@@ -348,13 +831,13 @@
|
|
|
348
831
|
Before
|
|
349
832
|
|
|
350
833
|
```ts
|
|
351
|
-
model.textEmbeddingModel(
|
|
834
|
+
model.textEmbeddingModel("my-model-id");
|
|
352
835
|
```
|
|
353
836
|
|
|
354
837
|
After
|
|
355
838
|
|
|
356
839
|
```ts
|
|
357
|
-
model.embeddingModel(
|
|
840
|
+
model.embeddingModel("my-model-id");
|
|
358
841
|
```
|
|
359
842
|
|
|
360
843
|
- 95f65c2: chore: use import \* from zod/v4
|
|
@@ -580,13 +1063,13 @@
|
|
|
580
1063
|
Before
|
|
581
1064
|
|
|
582
1065
|
```ts
|
|
583
|
-
model.textEmbeddingModel(
|
|
1066
|
+
model.textEmbeddingModel("my-model-id");
|
|
584
1067
|
```
|
|
585
1068
|
|
|
586
1069
|
After
|
|
587
1070
|
|
|
588
1071
|
```ts
|
|
589
|
-
model.embeddingModel(
|
|
1072
|
+
model.embeddingModel("my-model-id");
|
|
590
1073
|
```
|
|
591
1074
|
|
|
592
1075
|
- Updated dependencies [8d9e8ad]
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The **[Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers/index)** for the [Vercel AI SDK](https://ai-sdk.dev/docs) contains language model support for thousands of models through multiple inference providers via the Hugging Face router API.
|
|
4
4
|
|
|
5
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access Hugging Face (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
|
|
6
|
+
|
|
5
7
|
## Setup
|
|
6
8
|
|
|
7
9
|
The Hugging Face provider is available in the `@ai-sdk/huggingface` module. You can install it with:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
export { OpenAICompatibleErrorData as HuggingFaceErrorData } from '@ai-sdk/openai-compatible';
|
|
4
4
|
|
|
@@ -29,19 +29,19 @@ interface HuggingFaceProviderSettings {
|
|
|
29
29
|
fetch?: FetchFunction;
|
|
30
30
|
generateId?: () => string;
|
|
31
31
|
}
|
|
32
|
-
interface HuggingFaceProvider extends
|
|
32
|
+
interface HuggingFaceProvider extends ProviderV4 {
|
|
33
33
|
/**
|
|
34
34
|
* Creates a Hugging Face responses model for text generation.
|
|
35
35
|
*/
|
|
36
|
-
(modelId: HuggingFaceResponsesModelId):
|
|
36
|
+
(modelId: HuggingFaceResponsesModelId): LanguageModelV4;
|
|
37
37
|
/**
|
|
38
38
|
* Creates a Hugging Face responses model for text generation.
|
|
39
39
|
*/
|
|
40
|
-
languageModel(modelId: HuggingFaceResponsesModelId):
|
|
40
|
+
languageModel(modelId: HuggingFaceResponsesModelId): LanguageModelV4;
|
|
41
41
|
/**
|
|
42
42
|
* Creates a Hugging Face responses model for text generation.
|
|
43
43
|
*/
|
|
44
|
-
responses(modelId: HuggingFaceResponsesModelId):
|
|
44
|
+
responses(modelId: HuggingFaceResponsesModelId): LanguageModelV4;
|
|
45
45
|
/**
|
|
46
46
|
* @deprecated Use `embeddingModel` instead.
|
|
47
47
|
*/
|
|
@@ -54,6 +54,8 @@ declare function createHuggingFace(options?: HuggingFaceProviderSettings): Huggi
|
|
|
54
54
|
/**
|
|
55
55
|
* Default Hugging Face provider instance.
|
|
56
56
|
*/
|
|
57
|
-
declare const
|
|
57
|
+
declare const huggingFace: HuggingFaceProvider;
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
declare const VERSION: string;
|
|
60
|
+
|
|
61
|
+
export { type HuggingFaceProvider, type HuggingFaceProviderSettings, type HuggingFaceResponsesModelId, type HuggingFaceResponsesSettings, VERSION, createHuggingFace, huggingFace, huggingFace as huggingface };
|