@ai-sdk/groq 4.0.0-beta.5 → 4.0.0-beta.54

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,407 @@
1
1
  # @ai-sdk/groq
2
2
 
3
+ ## 4.0.0-beta.54
4
+
5
+ ### Patch Changes
6
+
7
+ - b8396f0: trigger initial beta release
8
+ - Updated dependencies [b8396f0]
9
+ - @ai-sdk/provider-utils@5.0.0-beta.49
10
+ - @ai-sdk/provider@4.0.0-beta.19
11
+
12
+ ## 4.0.0-canary.53
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [aeda373]
17
+ - Updated dependencies [375fdd7]
18
+ - Updated dependencies [b4507d5]
19
+ - @ai-sdk/provider-utils@5.0.0-canary.48
20
+
21
+ ## 4.0.0-canary.52
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [bae5e2b]
26
+ - @ai-sdk/provider-utils@5.0.0-canary.47
27
+
28
+ ## 4.0.0-canary.51
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [ce769dd]
33
+ - @ai-sdk/provider@4.0.0-canary.18
34
+ - @ai-sdk/provider-utils@5.0.0-canary.46
35
+
36
+ ## 4.0.0-canary.50
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [ee798eb]
41
+ - Updated dependencies [daf6637]
42
+ - @ai-sdk/provider-utils@5.0.0-canary.45
43
+
44
+ ## 4.0.0-canary.49
45
+
46
+ ### Patch Changes
47
+
48
+ - 023550e: Deprecate `streamText` result `fullStream` in favor of `stream`.
49
+
50
+ ## 4.0.0-canary.48
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [6c93e36]
55
+ - Updated dependencies [f617ac2]
56
+ - @ai-sdk/provider-utils@5.0.0-canary.44
57
+
58
+ ## 4.0.0-canary.47
59
+
60
+ ### Patch Changes
61
+
62
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
63
+ - Updated dependencies [7fc6bd6]
64
+ - @ai-sdk/provider-utils@5.0.0-canary.43
65
+ - @ai-sdk/provider@4.0.0-canary.17
66
+
67
+ ## 4.0.0-canary.46
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [a6617c5]
72
+ - @ai-sdk/provider-utils@5.0.0-canary.42
73
+
74
+ ## 4.0.0-canary.45
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [28dfa06]
79
+ - Updated dependencies [e93fa91]
80
+ - @ai-sdk/provider-utils@5.0.0-canary.41
81
+
82
+ ## 4.0.0-canary.44
83
+
84
+ ### Patch Changes
85
+
86
+ - Updated dependencies [a7de9c9]
87
+ - @ai-sdk/provider-utils@5.0.0-canary.40
88
+
89
+ ## 4.0.0-canary.43
90
+
91
+ ### Patch Changes
92
+
93
+ - Updated dependencies [105f95b]
94
+ - @ai-sdk/provider-utils@5.0.0-canary.39
95
+
96
+ ## 4.0.0-canary.42
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [ca446f8]
101
+ - @ai-sdk/provider-utils@5.0.0-canary.38
102
+
103
+ ## 4.0.0-canary.41
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [d848405]
108
+ - @ai-sdk/provider-utils@5.0.0-canary.37
109
+
110
+ ## 4.0.0-canary.40
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [ca39020]
115
+ - @ai-sdk/provider-utils@5.0.0-canary.36
116
+
117
+ ## 4.0.0-canary.39
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [f634bac]
122
+ - @ai-sdk/provider-utils@5.0.0-canary.35
123
+
124
+ ## 4.0.0-canary.38
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [69254e0]
129
+ - Updated dependencies [3015fc3]
130
+ - @ai-sdk/provider-utils@5.0.0-canary.34
131
+
132
+ ## 4.0.0-canary.37
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [2427d88]
137
+ - @ai-sdk/provider-utils@5.0.0-canary.33
138
+
139
+ ## 4.0.0-canary.36
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies [5463d0d]
144
+ - @ai-sdk/provider-utils@5.0.0-canary.32
145
+ - @ai-sdk/provider@4.0.0-canary.16
146
+
147
+ ## 4.0.0-canary.35
148
+
149
+ ### Patch Changes
150
+
151
+ - 0c4c275: trigger initial canary release
152
+ - Updated dependencies [0c4c275]
153
+ - @ai-sdk/provider-utils@5.0.0-canary.31
154
+ - @ai-sdk/provider@4.0.0-canary.15
155
+
156
+ ## 4.0.0-beta.34
157
+
158
+ ### Major Changes
159
+
160
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
161
+
162
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
163
+
164
+ ### Patch Changes
165
+
166
+ - Updated dependencies [08d2129]
167
+ - @ai-sdk/provider-utils@5.0.0-beta.30
168
+
169
+ ## 4.0.0-beta.33
170
+
171
+ ### Patch Changes
172
+
173
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
174
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
175
+ - Updated dependencies [9bd6512]
176
+ - Updated dependencies [258c093]
177
+ - Updated dependencies [b6783da]
178
+ - @ai-sdk/provider-utils@5.0.0-beta.29
179
+ - @ai-sdk/provider@4.0.0-beta.14
180
+
181
+ ## 4.0.0-beta.32
182
+
183
+ ### Patch Changes
184
+
185
+ - 9f0e36c: trigger release for all packages after provenance setup
186
+ - Updated dependencies [9f0e36c]
187
+ - @ai-sdk/provider@4.0.0-beta.13
188
+ - @ai-sdk/provider-utils@5.0.0-beta.28
189
+
190
+ ## 4.0.0-beta.31
191
+
192
+ ### Patch Changes
193
+
194
+ - 58a2ad7: fix: more precise default message for tool execution denial
195
+ - Updated dependencies [785fe16]
196
+ - Updated dependencies [67df0a0]
197
+ - Updated dependencies [befb78c]
198
+ - Updated dependencies [0458559]
199
+ - Updated dependencies [5852c0a]
200
+ - Updated dependencies [fc92055]
201
+ - @ai-sdk/provider-utils@5.0.0-beta.27
202
+
203
+ ## 4.0.0-beta.30
204
+
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies [2e98477]
208
+ - @ai-sdk/provider-utils@5.0.0-beta.26
209
+
210
+ ## 4.0.0-beta.29
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [eea8d98]
215
+ - @ai-sdk/provider-utils@5.0.0-beta.25
216
+
217
+ ## 4.0.0-beta.28
218
+
219
+ ### Patch Changes
220
+
221
+ - f807e45: Extract shared `StreamingToolCallTracker` class into `@ai-sdk/provider-utils` to deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missing `generateId()` fallback for `toolCallId` in Alibaba's `doGenerate` path and ensures all providers finalize unfinished tool calls during stream flush.
222
+ - Updated dependencies [f807e45]
223
+ - @ai-sdk/provider-utils@5.0.0-beta.24
224
+
225
+ ## 4.0.0-beta.27
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies [350ea38]
230
+ - @ai-sdk/provider-utils@5.0.0-beta.23
231
+
232
+ ## 4.0.0-beta.26
233
+
234
+ ### Patch Changes
235
+
236
+ - Updated dependencies [083947b]
237
+ - @ai-sdk/provider-utils@5.0.0-beta.22
238
+
239
+ ## 4.0.0-beta.25
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [add1126]
244
+ - @ai-sdk/provider-utils@5.0.0-beta.21
245
+
246
+ ## 4.0.0-beta.24
247
+
248
+ ### Patch Changes
249
+
250
+ - b3976a2: Add workflow serialization support to all provider models.
251
+
252
+ **`@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.
253
+
254
+ **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.
255
+
256
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
257
+
258
+ - Updated dependencies [b3976a2]
259
+ - Updated dependencies [ff5eba1]
260
+ - @ai-sdk/provider-utils@5.0.0-beta.20
261
+ - @ai-sdk/provider@4.0.0-beta.12
262
+
263
+ ## 4.0.0-beta.23
264
+
265
+ ### Major Changes
266
+
267
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
268
+
269
+ ### Patch Changes
270
+
271
+ - Updated dependencies [ef992f8]
272
+ - @ai-sdk/provider@4.0.0-beta.11
273
+ - @ai-sdk/provider-utils@5.0.0-beta.19
274
+
275
+ ## 4.0.0-beta.22
276
+
277
+ ### Patch Changes
278
+
279
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
280
+ - Updated dependencies [90e2d8a]
281
+ - @ai-sdk/provider-utils@5.0.0-beta.18
282
+
283
+ ## 4.0.0-beta.21
284
+
285
+ ### Patch Changes
286
+
287
+ - Updated dependencies [3ae1786]
288
+ - @ai-sdk/provider-utils@5.0.0-beta.17
289
+
290
+ ## 4.0.0-beta.20
291
+
292
+ ### Patch Changes
293
+
294
+ - Updated dependencies [176466a]
295
+ - @ai-sdk/provider@4.0.0-beta.10
296
+ - @ai-sdk/provider-utils@5.0.0-beta.16
297
+
298
+ ## 4.0.0-beta.19
299
+
300
+ ### Patch Changes
301
+
302
+ - Updated dependencies [e311194]
303
+ - @ai-sdk/provider@4.0.0-beta.9
304
+ - @ai-sdk/provider-utils@5.0.0-beta.15
305
+
306
+ ## 4.0.0-beta.18
307
+
308
+ ### Patch Changes
309
+
310
+ - Updated dependencies [34bd95d]
311
+ - Updated dependencies [008271d]
312
+ - @ai-sdk/provider@4.0.0-beta.8
313
+ - @ai-sdk/provider-utils@5.0.0-beta.14
314
+
315
+ ## 4.0.0-beta.17
316
+
317
+ ### Patch Changes
318
+
319
+ - Updated dependencies [b0c2869]
320
+ - Updated dependencies [7e26e81]
321
+ - @ai-sdk/provider-utils@5.0.0-beta.13
322
+
323
+ ## 4.0.0-beta.16
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies [46d1149]
328
+ - @ai-sdk/provider-utils@5.0.0-beta.12
329
+
330
+ ## 4.0.0-beta.15
331
+
332
+ ### Patch Changes
333
+
334
+ - 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
335
+ - Updated dependencies [6fd51c0]
336
+ - @ai-sdk/provider-utils@5.0.0-beta.11
337
+ - @ai-sdk/provider@4.0.0-beta.7
338
+
339
+ ## 4.0.0-beta.14
340
+
341
+ ### Patch Changes
342
+
343
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
344
+ - Updated dependencies [c29a26f]
345
+ - @ai-sdk/provider-utils@5.0.0-beta.10
346
+ - @ai-sdk/provider@4.0.0-beta.6
347
+
348
+ ## 4.0.0-beta.13
349
+
350
+ ### Patch Changes
351
+
352
+ - 38fc777: Add AI Gateway hint to provider READMEs
353
+
354
+ ## 4.0.0-beta.12
355
+
356
+ ### Patch Changes
357
+
358
+ - Updated dependencies [2e17091]
359
+ - @ai-sdk/provider-utils@5.0.0-beta.9
360
+
361
+ ## 4.0.0-beta.11
362
+
363
+ ### Patch Changes
364
+
365
+ - Updated dependencies [986c6fd]
366
+ - Updated dependencies [493295c]
367
+ - @ai-sdk/provider-utils@5.0.0-beta.8
368
+
369
+ ## 4.0.0-beta.10
370
+
371
+ ### Patch Changes
372
+
373
+ - 7bf717f: feat: Groq support for performance service tier
374
+
375
+ ## 4.0.0-beta.9
376
+
377
+ ### Patch Changes
378
+
379
+ - Updated dependencies [1f509d4]
380
+ - @ai-sdk/provider-utils@5.0.0-beta.7
381
+ - @ai-sdk/provider@4.0.0-beta.5
382
+
383
+ ## 4.0.0-beta.8
384
+
385
+ ### Patch Changes
386
+
387
+ - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
388
+
389
+ ## 4.0.0-beta.7
390
+
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies [3887c70]
394
+ - @ai-sdk/provider-utils@5.0.0-beta.6
395
+ - @ai-sdk/provider@4.0.0-beta.4
396
+
397
+ ## 4.0.0-beta.6
398
+
399
+ ### Patch Changes
400
+
401
+ - Updated dependencies [776b617]
402
+ - @ai-sdk/provider-utils@5.0.0-beta.5
403
+ - @ai-sdk/provider@4.0.0-beta.3
404
+
3
405
  ## 4.0.0-beta.5
4
406
 
5
407
  ### Patch Changes
@@ -275,13 +677,13 @@
275
677
  Before
276
678
 
277
679
  ```ts
278
- model.textEmbeddingModel('my-model-id');
680
+ model.textEmbeddingModel("my-model-id");
279
681
  ```
280
682
 
281
683
  After
282
684
 
283
685
  ```ts
284
- model.embeddingModel('my-model-id');
686
+ model.embeddingModel("my-model-id");
285
687
  ```
286
688
 
287
689
  - 2625a04: feat(openai); update spec for mcp approval
@@ -502,13 +904,13 @@
502
904
  Before
503
905
 
504
906
  ```ts
505
- model.textEmbeddingModel('my-model-id');
907
+ model.textEmbeddingModel("my-model-id");
506
908
  ```
507
909
 
508
910
  After
509
911
 
510
912
  ```ts
511
- model.embeddingModel('my-model-id');
913
+ model.embeddingModel("my-model-id");
512
914
  ```
513
915
 
514
916
  - Updated dependencies [8d9e8ad]
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  The **[Groq provider](https://ai-sdk.dev/providers/ai-sdk-providers/groq)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the Groq chat and completion APIs, transcription support, and browser search tool.
5
5
 
6
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Groq (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).
7
+
6
8
  ## Setup
7
9
 
8
10
  The Groq provider is available in the `@ai-sdk/groq` module. You can install it with
@@ -74,7 +76,7 @@ const result = streamText({
74
76
  toolChoice: 'required',
75
77
  });
76
78
 
77
- for await (const delta of result.fullStream) {
79
+ for await (const delta of result.stream) {
78
80
  if (delta.type === 'text-delta') {
79
81
  process.stdout.write(delta.text);
80
82
  }
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
4
4
  import { z } from 'zod/v4';
5
5
 
6
6
  type GroqChatModelId = 'gemma2-9b-it' | 'llama-3.1-8b-instant' | 'llama-3.3-70b-versatile' | 'meta-llama/llama-guard-4-12b' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'deepseek-r1-distill-llama-70b' | 'meta-llama/llama-4-maverick-17b-128e-instruct' | 'meta-llama/llama-4-scout-17b-16e-instruct' | 'meta-llama/llama-prompt-guard-2-22m' | 'meta-llama/llama-prompt-guard-2-86m' | 'moonshotai/kimi-k2-instruct-0905' | 'qwen/qwen3-32b' | 'llama-guard-3-8b' | 'llama3-70b-8192' | 'llama3-8b-8192' | 'mixtral-8x7b-32768' | 'qwen-qwq-32b' | 'qwen-2.5-32b' | 'deepseek-r1-distill-qwen-32b' | (string & {});
7
- declare const groqLanguageModelOptions: z.ZodObject<{
7
+ declare const groqLanguageModelChatOptions: z.ZodObject<{
8
8
  reasoningFormat: z.ZodOptional<z.ZodEnum<{
9
9
  parsed: "parsed";
10
10
  raw: "raw";
@@ -23,11 +23,12 @@ declare const groqLanguageModelOptions: z.ZodObject<{
23
23
  strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
24
24
  serviceTier: z.ZodOptional<z.ZodEnum<{
25
25
  on_demand: "on_demand";
26
+ performance: "performance";
26
27
  flex: "flex";
27
28
  auto: "auto";
28
29
  }>>;
29
30
  }, z.core.$strip>;
30
- type GroqLanguageModelOptions = z.infer<typeof groqLanguageModelOptions>;
31
+ type GroqLanguageModelChatOptions = z.infer<typeof groqLanguageModelChatOptions>;
31
32
 
32
33
  type GroqTranscriptionModelId = 'whisper-large-v3-turbo' | 'whisper-large-v3' | (string & {});
33
34
  declare const groqTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
@@ -40,7 +41,7 @@ declare const groqTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
40
41
  type GroqTranscriptionModelOptions = InferSchema<typeof groqTranscriptionModelOptions>;
41
42
 
42
43
  declare const groqTools: {
43
- browserSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
44
+ browserSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
44
45
  };
45
46
 
46
47
  interface GroqProvider extends ProviderV4 {
@@ -105,8 +106,8 @@ declare const groq: GroqProvider;
105
106
  *
106
107
  * @see https://console.groq.com/docs/browser-search
107
108
  */
108
- declare const browserSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
109
+ declare const browserSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
109
110
 
110
111
  declare const VERSION: string;
111
112
 
112
- export { type GroqLanguageModelOptions, type GroqProvider, type GroqLanguageModelOptions as GroqProviderOptions, type GroqProviderSettings, type GroqTranscriptionModelOptions, VERSION, browserSearch, createGroq, groq };
113
+ export { type GroqLanguageModelChatOptions, type GroqLanguageModelChatOptions as GroqLanguageModelOptions, type GroqProvider, type GroqLanguageModelChatOptions as GroqProviderOptions, type GroqProviderSettings, type GroqTranscriptionModelOptions, VERSION, browserSearch, createGroq, groq };