@ai-sdk/huggingface 1.0.0-beta.4 → 1.0.0-beta.41

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 CHANGED
@@ -1,5 +1,341 @@
1
1
  # @ai-sdk/huggingface
2
2
 
3
+ ## 1.0.0-beta.41
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [53f3368]
8
+ - @ai-sdk/provider@3.0.0-beta.25
9
+ - @ai-sdk/openai-compatible@2.0.0-beta.45
10
+ - @ai-sdk/provider-utils@4.0.0-beta.44
11
+
12
+ ## 1.0.0-beta.40
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [dce03c4]
17
+ - @ai-sdk/provider-utils@4.0.0-beta.43
18
+ - @ai-sdk/provider@3.0.0-beta.24
19
+ - @ai-sdk/openai-compatible@2.0.0-beta.44
20
+
21
+ ## 1.0.0-beta.39
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [3ed5519]
26
+ - @ai-sdk/provider-utils@4.0.0-beta.42
27
+ - @ai-sdk/openai-compatible@2.0.0-beta.43
28
+
29
+ ## 1.0.0-beta.38
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [1bd7d32]
34
+ - @ai-sdk/openai-compatible@2.0.0-beta.42
35
+ - @ai-sdk/provider-utils@4.0.0-beta.41
36
+ - @ai-sdk/provider@3.0.0-beta.23
37
+
38
+ ## 1.0.0-beta.37
39
+
40
+ ### Patch Changes
41
+
42
+ - 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
43
+ - Updated dependencies [544d4e8]
44
+ - @ai-sdk/openai-compatible@2.0.0-beta.41
45
+ - @ai-sdk/provider-utils@4.0.0-beta.40
46
+ - @ai-sdk/provider@3.0.0-beta.22
47
+
48
+ ## 1.0.0-beta.36
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [954c356]
53
+ - @ai-sdk/provider-utils@4.0.0-beta.39
54
+ - @ai-sdk/provider@3.0.0-beta.21
55
+ - @ai-sdk/openai-compatible@2.0.0-beta.40
56
+
57
+ ## 1.0.0-beta.35
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [03849b0]
62
+ - @ai-sdk/provider-utils@4.0.0-beta.38
63
+ - @ai-sdk/openai-compatible@2.0.0-beta.39
64
+
65
+ ## 1.0.0-beta.34
66
+
67
+ ### Patch Changes
68
+
69
+ - 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
70
+ - Updated dependencies [457318b]
71
+ - @ai-sdk/openai-compatible@2.0.0-beta.38
72
+ - @ai-sdk/provider@3.0.0-beta.20
73
+ - @ai-sdk/provider-utils@4.0.0-beta.37
74
+
75
+ ## 1.0.0-beta.33
76
+
77
+ ### Patch Changes
78
+
79
+ - 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
80
+
81
+ Before
82
+
83
+ ```ts
84
+ model.textEmbeddingModel('my-model-id');
85
+ ```
86
+
87
+ After
88
+
89
+ ```ts
90
+ model.embeddingModel('my-model-id');
91
+ ```
92
+
93
+ - Updated dependencies [8d9e8ad]
94
+ - @ai-sdk/openai-compatible@2.0.0-beta.37
95
+ - @ai-sdk/provider@3.0.0-beta.19
96
+ - @ai-sdk/provider-utils@4.0.0-beta.36
97
+
98
+ ## 1.0.0-beta.32
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [10d819b]
103
+ - @ai-sdk/provider@3.0.0-beta.18
104
+ - @ai-sdk/openai-compatible@2.0.0-beta.36
105
+ - @ai-sdk/provider-utils@4.0.0-beta.35
106
+
107
+ ## 1.0.0-beta.31
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies [db913bd]
112
+ - @ai-sdk/provider@3.0.0-beta.17
113
+ - @ai-sdk/openai-compatible@2.0.0-beta.35
114
+ - @ai-sdk/provider-utils@4.0.0-beta.34
115
+
116
+ ## 1.0.0-beta.30
117
+
118
+ ### Patch Changes
119
+
120
+ - 1bbce64: extract reasoning content
121
+
122
+ ## 1.0.0-beta.29
123
+
124
+ ### Patch Changes
125
+
126
+ - Updated dependencies [b681d7d]
127
+ - @ai-sdk/provider@3.0.0-beta.16
128
+ - @ai-sdk/openai-compatible@2.0.0-beta.34
129
+ - @ai-sdk/provider-utils@4.0.0-beta.33
130
+
131
+ ## 1.0.0-beta.28
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [32d8dbb]
136
+ - @ai-sdk/provider-utils@4.0.0-beta.32
137
+ - @ai-sdk/openai-compatible@2.0.0-beta.33
138
+
139
+ ## 1.0.0-beta.27
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies [bb36798]
144
+ - @ai-sdk/provider@3.0.0-beta.15
145
+ - @ai-sdk/openai-compatible@2.0.0-beta.32
146
+ - @ai-sdk/provider-utils@4.0.0-beta.31
147
+
148
+ ## 1.0.0-beta.26
149
+
150
+ ### Patch Changes
151
+
152
+ - Updated dependencies [4f16c37]
153
+ - @ai-sdk/provider-utils@4.0.0-beta.30
154
+ - @ai-sdk/openai-compatible@2.0.0-beta.31
155
+
156
+ ## 1.0.0-beta.25
157
+
158
+ ### Patch Changes
159
+
160
+ - Updated dependencies [af3780b]
161
+ - @ai-sdk/provider@3.0.0-beta.14
162
+ - @ai-sdk/openai-compatible@2.0.0-beta.30
163
+ - @ai-sdk/provider-utils@4.0.0-beta.29
164
+
165
+ ## 1.0.0-beta.24
166
+
167
+ ### Patch Changes
168
+
169
+ - Updated dependencies [016b111]
170
+ - @ai-sdk/provider-utils@4.0.0-beta.28
171
+ - @ai-sdk/openai-compatible@2.0.0-beta.29
172
+
173
+ ## 1.0.0-beta.23
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [37c58a0]
178
+ - @ai-sdk/provider@3.0.0-beta.13
179
+ - @ai-sdk/openai-compatible@2.0.0-beta.28
180
+ - @ai-sdk/provider-utils@4.0.0-beta.27
181
+
182
+ ## 1.0.0-beta.22
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [d1bdadb]
187
+ - @ai-sdk/provider@3.0.0-beta.12
188
+ - @ai-sdk/openai-compatible@2.0.0-beta.27
189
+ - @ai-sdk/provider-utils@4.0.0-beta.26
190
+
191
+ ## 1.0.0-beta.21
192
+
193
+ ### Patch Changes
194
+
195
+ - Updated dependencies [4c44a5b]
196
+ - @ai-sdk/provider@3.0.0-beta.11
197
+ - @ai-sdk/openai-compatible@2.0.0-beta.26
198
+ - @ai-sdk/provider-utils@4.0.0-beta.25
199
+
200
+ ## 1.0.0-beta.20
201
+
202
+ ### Patch Changes
203
+
204
+ - 0c3b58b: fix(provider): add specificationVersion to ProviderV3
205
+ - Updated dependencies [0c3b58b]
206
+ - @ai-sdk/openai-compatible@2.0.0-beta.25
207
+ - @ai-sdk/provider@3.0.0-beta.10
208
+ - @ai-sdk/provider-utils@4.0.0-beta.24
209
+
210
+ ## 1.0.0-beta.19
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [a755db5]
215
+ - @ai-sdk/provider@3.0.0-beta.9
216
+ - @ai-sdk/openai-compatible@2.0.0-beta.24
217
+ - @ai-sdk/provider-utils@4.0.0-beta.23
218
+
219
+ ## 1.0.0-beta.18
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [58920e0]
224
+ - @ai-sdk/provider-utils@4.0.0-beta.22
225
+ - @ai-sdk/openai-compatible@2.0.0-beta.23
226
+
227
+ ## 1.0.0-beta.17
228
+
229
+ ### Patch Changes
230
+
231
+ - Updated dependencies [293a6b7]
232
+ - @ai-sdk/provider-utils@4.0.0-beta.21
233
+ - @ai-sdk/openai-compatible@2.0.0-beta.22
234
+
235
+ ## 1.0.0-beta.16
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [fca786b]
240
+ - @ai-sdk/provider-utils@4.0.0-beta.20
241
+ - @ai-sdk/openai-compatible@2.0.0-beta.21
242
+
243
+ ## 1.0.0-beta.15
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [3794514]
248
+ - @ai-sdk/provider-utils@4.0.0-beta.19
249
+ - @ai-sdk/provider@3.0.0-beta.8
250
+ - @ai-sdk/openai-compatible@2.0.0-beta.20
251
+
252
+ ## 1.0.0-beta.14
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [81d4308]
257
+ - @ai-sdk/provider@3.0.0-beta.7
258
+ - @ai-sdk/openai-compatible@2.0.0-beta.19
259
+ - @ai-sdk/provider-utils@4.0.0-beta.18
260
+
261
+ ## 1.0.0-beta.13
262
+
263
+ ### Patch Changes
264
+
265
+ - Updated dependencies [703459a]
266
+ - @ai-sdk/provider-utils@4.0.0-beta.17
267
+ - @ai-sdk/openai-compatible@2.0.0-beta.18
268
+
269
+ ## 1.0.0-beta.12
270
+
271
+ ### Patch Changes
272
+
273
+ - Updated dependencies [b689220]
274
+ - @ai-sdk/openai-compatible@2.0.0-beta.17
275
+
276
+ ## 1.0.0-beta.11
277
+
278
+ ### Patch Changes
279
+
280
+ - Updated dependencies [6306603]
281
+ - @ai-sdk/provider-utils@4.0.0-beta.16
282
+ - @ai-sdk/openai-compatible@2.0.0-beta.16
283
+
284
+ ## 1.0.0-beta.10
285
+
286
+ ### Patch Changes
287
+
288
+ - Updated dependencies [f0b2157]
289
+ - @ai-sdk/provider-utils@4.0.0-beta.15
290
+ - @ai-sdk/openai-compatible@2.0.0-beta.15
291
+
292
+ ## 1.0.0-beta.9
293
+
294
+ ### Patch Changes
295
+
296
+ - Updated dependencies [3b1d015]
297
+ - @ai-sdk/provider-utils@4.0.0-beta.14
298
+ - @ai-sdk/openai-compatible@2.0.0-beta.14
299
+
300
+ ## 1.0.0-beta.8
301
+
302
+ ### Patch Changes
303
+
304
+ - Updated dependencies [d116b4b]
305
+ - @ai-sdk/provider-utils@4.0.0-beta.13
306
+ - @ai-sdk/openai-compatible@2.0.0-beta.13
307
+
308
+ ## 1.0.0-beta.7
309
+
310
+ ### Patch Changes
311
+
312
+ - Updated dependencies [7e32fea]
313
+ - @ai-sdk/provider-utils@4.0.0-beta.12
314
+ - @ai-sdk/openai-compatible@2.0.0-beta.12
315
+
316
+ ## 1.0.0-beta.6
317
+
318
+ ### Patch Changes
319
+
320
+ - 95f65c2: chore: use import \* from zod/v4
321
+ - Updated dependencies [95f65c2]
322
+ - Updated dependencies [95f65c2]
323
+ - @ai-sdk/openai-compatible@2.0.0-beta.11
324
+ - @ai-sdk/provider-utils@4.0.0-beta.11
325
+
326
+ ## 1.0.0-beta.5
327
+
328
+ ### Major Changes
329
+
330
+ - dee8b05: ai SDK 6 beta
331
+
332
+ ### Patch Changes
333
+
334
+ - Updated dependencies [dee8b05]
335
+ - @ai-sdk/openai-compatible@2.0.0-beta.10
336
+ - @ai-sdk/provider@3.0.0-beta.6
337
+ - @ai-sdk/provider-utils@4.0.0-beta.10
338
+
3
339
  ## 1.0.0-beta.4
4
340
 
5
341
  ### Patch Changes
package/dist/index.js CHANGED
@@ -120,10 +120,7 @@ async function convertToHuggingFaceResponsesMessages({
120
120
  break;
121
121
  }
122
122
  case "tool": {
123
- warnings.push({
124
- type: "unsupported-setting",
125
- setting: "tool messages"
126
- });
123
+ warnings.push({ type: "unsupported", feature: "tool messages" });
127
124
  break;
128
125
  }
129
126
  default: {
@@ -174,10 +171,10 @@ function prepareResponsesTools({
174
171
  parameters: tool.inputSchema
175
172
  });
176
173
  break;
177
- case "provider-defined":
174
+ case "provider":
178
175
  toolWarnings.push({
179
- type: "unsupported-tool",
180
- tool
176
+ type: "unsupported",
177
+ feature: `provider-defined tool ${tool.id}`
181
178
  });
182
179
  break;
183
180
  default: {
@@ -247,25 +244,19 @@ var HuggingFaceResponsesLanguageModel = class {
247
244
  var _a, _b;
248
245
  const warnings = [];
249
246
  if (topK != null) {
250
- warnings.push({ type: "unsupported-setting", setting: "topK" });
247
+ warnings.push({ type: "unsupported", feature: "topK" });
251
248
  }
252
249
  if (seed != null) {
253
- warnings.push({ type: "unsupported-setting", setting: "seed" });
250
+ warnings.push({ type: "unsupported", feature: "seed" });
254
251
  }
255
252
  if (presencePenalty != null) {
256
- warnings.push({
257
- type: "unsupported-setting",
258
- setting: "presencePenalty"
259
- });
253
+ warnings.push({ type: "unsupported", feature: "presencePenalty" });
260
254
  }
261
255
  if (frequencyPenalty != null) {
262
- warnings.push({
263
- type: "unsupported-setting",
264
- setting: "frequencyPenalty"
265
- });
256
+ warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
266
257
  }
267
258
  if (stopSequences != null) {
268
- warnings.push({ type: "unsupported-setting", setting: "stopSequences" });
259
+ warnings.push({ type: "unsupported", feature: "stopSequences" });
269
260
  }
270
261
  const { input, warnings: messageWarnings } = await convertToHuggingFaceResponsesMessages({
271
262
  prompt
@@ -306,7 +297,14 @@ var HuggingFaceResponsesLanguageModel = class {
306
297
  metadata: huggingfaceOptions == null ? void 0 : huggingfaceOptions.metadata,
307
298
  instructions: huggingfaceOptions == null ? void 0 : huggingfaceOptions.instructions,
308
299
  ...preparedTools && { tools: preparedTools },
309
- ...preparedToolChoice && { tool_choice: preparedToolChoice }
300
+ ...preparedToolChoice && { tool_choice: preparedToolChoice },
301
+ ...(huggingfaceOptions == null ? void 0 : huggingfaceOptions.reasoningEffort) != null && {
302
+ reasoning: {
303
+ ...(huggingfaceOptions == null ? void 0 : huggingfaceOptions.reasoningEffort) != null && {
304
+ effort: huggingfaceOptions.reasoningEffort
305
+ }
306
+ }
307
+ }
310
308
  };
311
309
  return { args: baseArgs, warnings };
312
310
  }
@@ -375,6 +373,20 @@ var HuggingFaceResponsesLanguageModel = class {
375
373
  }
376
374
  break;
377
375
  }
376
+ case "reasoning": {
377
+ for (const contentPart of part.content) {
378
+ content.push({
379
+ type: "reasoning",
380
+ text: contentPart.text,
381
+ providerMetadata: {
382
+ huggingface: {
383
+ itemId: part.id
384
+ }
385
+ }
386
+ });
387
+ }
388
+ break;
389
+ }
378
390
  case "mcp_call": {
379
391
  content.push({
380
392
  type: "tool-call",
@@ -388,8 +400,7 @@ var HuggingFaceResponsesLanguageModel = class {
388
400
  type: "tool-result",
389
401
  toolCallId: part.id,
390
402
  toolName: part.name,
391
- result: part.output,
392
- providerExecuted: true
403
+ result: part.output
393
404
  });
394
405
  }
395
406
  break;
@@ -407,8 +418,7 @@ var HuggingFaceResponsesLanguageModel = class {
407
418
  type: "tool-result",
408
419
  toolCallId: part.id,
409
420
  toolName: "list_tools",
410
- result: { tools: part.tools },
411
- providerExecuted: true
421
+ result: { tools: part.tools }
412
422
  });
413
423
  }
414
424
  break;
@@ -529,6 +539,16 @@ var HuggingFaceResponsesLanguageModel = class {
529
539
  id: value.item.call_id,
530
540
  toolName: value.item.name
531
541
  });
542
+ } else if (value.item.type === "reasoning") {
543
+ controller.enqueue({
544
+ type: "reasoning-start",
545
+ id: value.item.id,
546
+ providerMetadata: {
547
+ huggingface: {
548
+ itemId: value.item.id
549
+ }
550
+ }
551
+ });
532
552
  }
533
553
  return;
534
554
  }
@@ -572,6 +592,21 @@ var HuggingFaceResponsesLanguageModel = class {
572
592
  }
573
593
  return;
574
594
  }
595
+ if (isReasoningDeltaChunk(value)) {
596
+ controller.enqueue({
597
+ type: "reasoning-delta",
598
+ id: value.item_id,
599
+ delta: value.delta
600
+ });
601
+ return;
602
+ }
603
+ if (isReasoningEndChunk(value)) {
604
+ controller.enqueue({
605
+ type: "reasoning-end",
606
+ id: value.item_id
607
+ });
608
+ return;
609
+ }
575
610
  if (isTextDeltaChunk(value)) {
576
611
  controller.enqueue({
577
612
  type: "text-delta",
@@ -603,8 +638,65 @@ var HuggingFaceResponsesLanguageModel = class {
603
638
  var huggingfaceResponsesProviderOptionsSchema = import_v42.z.object({
604
639
  metadata: import_v42.z.record(import_v42.z.string(), import_v42.z.string()).optional(),
605
640
  instructions: import_v42.z.string().optional(),
606
- strictJsonSchema: import_v42.z.boolean().optional()
641
+ strictJsonSchema: import_v42.z.boolean().optional(),
642
+ reasoningEffort: import_v42.z.string().optional()
607
643
  });
644
+ var huggingfaceResponsesOutputSchema = import_v42.z.discriminatedUnion("type", [
645
+ import_v42.z.object({
646
+ type: import_v42.z.literal("message"),
647
+ id: import_v42.z.string(),
648
+ role: import_v42.z.string().optional(),
649
+ status: import_v42.z.string().optional(),
650
+ content: import_v42.z.array(
651
+ import_v42.z.object({
652
+ type: import_v42.z.literal("output_text"),
653
+ text: import_v42.z.string(),
654
+ annotations: import_v42.z.array(import_v42.z.any()).optional()
655
+ })
656
+ )
657
+ }),
658
+ import_v42.z.object({
659
+ type: import_v42.z.literal("reasoning"),
660
+ id: import_v42.z.string(),
661
+ status: import_v42.z.string().optional(),
662
+ content: import_v42.z.array(
663
+ import_v42.z.object({
664
+ type: import_v42.z.literal("reasoning_text"),
665
+ text: import_v42.z.string()
666
+ })
667
+ ),
668
+ summary: import_v42.z.array(
669
+ import_v42.z.object({
670
+ type: import_v42.z.literal("reasoning_summary"),
671
+ text: import_v42.z.string()
672
+ }).optional()
673
+ ).optional()
674
+ }),
675
+ import_v42.z.object({
676
+ type: import_v42.z.literal("function_call"),
677
+ id: import_v42.z.string(),
678
+ call_id: import_v42.z.string(),
679
+ name: import_v42.z.string(),
680
+ arguments: import_v42.z.string(),
681
+ output: import_v42.z.string().optional(),
682
+ status: import_v42.z.string().optional()
683
+ }),
684
+ import_v42.z.object({
685
+ type: import_v42.z.literal("mcp_call"),
686
+ id: import_v42.z.string(),
687
+ name: import_v42.z.string(),
688
+ arguments: import_v42.z.string(),
689
+ output: import_v42.z.string().optional(),
690
+ status: import_v42.z.string().optional()
691
+ }),
692
+ import_v42.z.object({
693
+ type: import_v42.z.literal("mcp_list_tools"),
694
+ id: import_v42.z.string(),
695
+ server_label: import_v42.z.string(),
696
+ tools: import_v42.z.array(import_v42.z.any()).optional(),
697
+ status: import_v42.z.string().optional()
698
+ })
699
+ ]);
608
700
  var huggingfaceResponsesResponseSchema = import_v42.z.object({
609
701
  id: import_v42.z.string(),
610
702
  model: import_v42.z.string(),
@@ -633,7 +725,7 @@ var huggingfaceResponsesResponseSchema = import_v42.z.object({
633
725
  }).optional(),
634
726
  total_tokens: import_v42.z.number()
635
727
  }).nullable().optional(),
636
- output: import_v42.z.array(import_v42.z.any()),
728
+ output: import_v42.z.array(huggingfaceResponsesOutputSchema),
637
729
  output_text: import_v42.z.string().nullable().optional()
638
730
  });
639
731
  var responseOutputItemAddedSchema = import_v42.z.object({
@@ -647,6 +739,13 @@ var responseOutputItemAddedSchema = import_v42.z.object({
647
739
  status: import_v42.z.string().optional(),
648
740
  content: import_v42.z.array(import_v42.z.any()).optional()
649
741
  }),
742
+ import_v42.z.object({
743
+ type: import_v42.z.literal("reasoning"),
744
+ id: import_v42.z.string(),
745
+ status: import_v42.z.string().optional(),
746
+ content: import_v42.z.array(import_v42.z.any()).optional(),
747
+ summary: import_v42.z.array(import_v42.z.any()).optional()
748
+ }),
650
749
  import_v42.z.object({
651
750
  type: import_v42.z.literal("mcp_list_tools"),
652
751
  id: import_v42.z.string(),
@@ -710,6 +809,13 @@ var responseOutputItemDoneSchema = import_v42.z.object({
710
809
  arguments: import_v42.z.string(),
711
810
  output: import_v42.z.string().optional(),
712
811
  error: import_v42.z.string().optional()
812
+ }),
813
+ import_v42.z.object({
814
+ type: import_v42.z.literal("reasoning"),
815
+ id: import_v42.z.string(),
816
+ status: import_v42.z.string().optional(),
817
+ content: import_v42.z.array(import_v42.z.any()).optional(),
818
+ summary: import_v42.z.array(import_v42.z.any()).optional()
713
819
  })
714
820
  ]),
715
821
  sequence_number: import_v42.z.number()
@@ -722,6 +828,22 @@ var textDeltaChunkSchema = import_v42.z.object({
722
828
  delta: import_v42.z.string(),
723
829
  sequence_number: import_v42.z.number()
724
830
  });
831
+ var reasoningTextDeltaChunkSchema = import_v42.z.object({
832
+ type: import_v42.z.literal("response.reasoning_text.delta"),
833
+ item_id: import_v42.z.string(),
834
+ output_index: import_v42.z.number(),
835
+ content_index: import_v42.z.number(),
836
+ delta: import_v42.z.string(),
837
+ sequence_number: import_v42.z.number()
838
+ });
839
+ var reasoningTextEndChunkSchema = import_v42.z.object({
840
+ type: import_v42.z.literal("response.reasoning_text.done"),
841
+ item_id: import_v42.z.string(),
842
+ output_index: import_v42.z.number(),
843
+ content_index: import_v42.z.number(),
844
+ text: import_v42.z.string(),
845
+ sequence_number: import_v42.z.number()
846
+ });
725
847
  var responseCompletedChunkSchema = import_v42.z.object({
726
848
  type: import_v42.z.literal("response.completed"),
727
849
  response: huggingfaceResponsesResponseSchema,
@@ -740,6 +862,8 @@ var responseCreatedChunkSchema = import_v42.z.object({
740
862
  var huggingfaceResponsesChunkSchema = import_v42.z.union([
741
863
  responseOutputItemAddedSchema,
742
864
  responseOutputItemDoneSchema,
865
+ reasoningTextDeltaChunkSchema,
866
+ reasoningTextEndChunkSchema,
743
867
  textDeltaChunkSchema,
744
868
  responseCompletedChunkSchema,
745
869
  responseCreatedChunkSchema,
@@ -755,6 +879,12 @@ function isResponseOutputItemDoneChunk(chunk) {
755
879
  function isTextDeltaChunk(chunk) {
756
880
  return chunk.type === "response.output_text.delta";
757
881
  }
882
+ function isReasoningDeltaChunk(chunk) {
883
+ return chunk.type === "response.reasoning_text.delta";
884
+ }
885
+ function isReasoningEndChunk(chunk) {
886
+ return chunk.type === "response.reasoning_text.done";
887
+ }
758
888
  function isResponseCompletedChunk(chunk) {
759
889
  return chunk.type === "response.completed";
760
890
  }
@@ -785,12 +915,13 @@ function createHuggingFace(options = {}) {
785
915
  });
786
916
  };
787
917
  const provider = (modelId) => createResponsesModel(modelId);
918
+ provider.specificationVersion = "v3";
788
919
  provider.languageModel = createResponsesModel;
789
920
  provider.responses = createResponsesModel;
790
- provider.textEmbeddingModel = (modelId) => {
921
+ provider.embeddingModel = (modelId) => {
791
922
  throw new import_provider3.NoSuchModelError({
792
923
  modelId,
793
- modelType: "textEmbeddingModel",
924
+ modelType: "embeddingModel",
794
925
  message: "Hugging Face Responses API does not support text embeddings. Use the Hugging Face Inference API directly for embeddings."
795
926
  });
796
927
  };