ai 6.0.78 → 6.0.80

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,19 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.80
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [99fbed8]
8
+ - @ai-sdk/gateway@3.0.41
9
+
10
+ ## 6.0.79
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [a2208a2]
15
+ - @ai-sdk/gateway@3.0.40
16
+
3
17
  ## 6.0.78
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1210,7 +1210,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1210
1210
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1211
1211
 
1212
1212
  // src/version.ts
1213
- var VERSION = true ? "6.0.78" : "0.0.0-test";
1213
+ var VERSION = true ? "6.0.80" : "0.0.0-test";
1214
1214
 
1215
1215
  // src/util/download/download.ts
1216
1216
  var download = async ({ url }) => {
package/dist/index.mjs CHANGED
@@ -1100,7 +1100,7 @@ import {
1100
1100
  } from "@ai-sdk/provider-utils";
1101
1101
 
1102
1102
  // src/version.ts
1103
- var VERSION = true ? "6.0.78" : "0.0.0-test";
1103
+ var VERSION = true ? "6.0.80" : "0.0.0-test";
1104
1104
 
1105
1105
  // src/util/download/download.ts
1106
1106
  var download = async ({ url }) => {
@@ -153,7 +153,7 @@ var import_provider_utils2 = require("@ai-sdk/provider-utils");
153
153
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
154
154
 
155
155
  // src/version.ts
156
- var VERSION = true ? "6.0.78" : "0.0.0-test";
156
+ var VERSION = true ? "6.0.80" : "0.0.0-test";
157
157
 
158
158
  // src/util/download/download.ts
159
159
  var download = async ({ url }) => {
@@ -128,7 +128,7 @@ import {
128
128
  } from "@ai-sdk/provider-utils";
129
129
 
130
130
  // src/version.ts
131
- var VERSION = true ? "6.0.78" : "0.0.0-test";
131
+ var VERSION = true ? "6.0.80" : "0.0.0-test";
132
132
 
133
133
  // src/util/download/download.ts
134
134
  var download = async ({ url }) => {
@@ -257,7 +257,7 @@ Let's enhance your chatbot by adding a simple weather tool.
257
257
 
258
258
  Modify your `app/api/chat/route.ts` file to include the new weather tool:
259
259
 
260
- ```tsx filename="app/api/chat/route.ts" highlight="2,11-25"
260
+ ```tsx filename="app/api/chat/route.ts" highlight="1,11-25"
261
261
  import { streamText, UIMessage, convertToModelMessages, tool } from 'ai';
262
262
  __PROVIDER_IMPORT__;
263
263
  import { z } from 'zod';
@@ -314,7 +314,7 @@ Notice the blank response in the UI? This is because instead of generating a tex
314
314
 
315
315
  To display the tool invocation in your UI, update your `app/page.tsx` file:
316
316
 
317
- ```tsx filename="app/page.tsx" highlight="16-21"
317
+ ```tsx filename="app/page.tsx" highlight="18-22"
318
318
  'use client';
319
319
 
320
320
  import { useChat } from '@ai-sdk/react';
@@ -376,7 +376,7 @@ To solve this, you can enable multi-step tool calls using `stopWhen`. By default
376
376
 
377
377
  Modify your `app/api/chat/route.ts` file to include the `stopWhen` condition:
378
378
 
379
- ```tsx filename="app/api/chat/route.ts"
379
+ ```tsx filename="app/api/chat/route.ts" highlight="16"
380
380
  import {
381
381
  streamText,
382
382
  UIMessage,
@@ -431,7 +431,7 @@ By setting `stopWhen: stepCountIs(5)`, you're allowing the model to use up to 5
431
431
 
432
432
  Update your `app/api/chat/route.ts` file to add a new tool to convert the temperature from Fahrenheit to Celsius:
433
433
 
434
- ```tsx filename="app/api/chat/route.ts" highlight="34-47"
434
+ ```tsx filename="app/api/chat/route.ts" highlight="31-46"
435
435
  import {
436
436
  streamText,
437
437
  UIMessage,
@@ -488,7 +488,7 @@ export async function POST(req: Request) {
488
488
 
489
489
  update your `app/page.tsx` file to render the new temperature conversion tool:
490
490
 
491
- ```tsx filename="app/page.tsx" highlight="21"
491
+ ```tsx filename="app/page.tsx" highlight="19"
492
492
  'use client';
493
493
 
494
494
  import { useChat } from '@ai-sdk/react';
@@ -252,7 +252,7 @@ For example, if a user asks about the current weather, without tools, the model
252
252
 
253
253
  Let's start by giving your chatbot a weather tool. Update your Route Handler (`app/api/chat/route.ts`):
254
254
 
255
- ```tsx filename="app/api/chat/route.ts"
255
+ ```tsx filename="app/api/chat/route.ts" highlight="1,11-25"
256
256
  import { streamText, UIMessage, convertToModelMessages, tool } from 'ai';
257
257
  __PROVIDER_IMPORT__;
258
258
  import { z } from 'zod';
@@ -369,7 +369,7 @@ To solve this, you can enable multi-step tool calls using `stopWhen`. By default
369
369
 
370
370
  Modify your `app/api/chat/route.ts` file to include the `stopWhen` condition:
371
371
 
372
- ```tsx filename="app/api/chat/route.ts"
372
+ ```tsx filename="app/api/chat/route.ts" highlight="16"
373
373
  import {
374
374
  streamText,
375
375
  UIMessage,
@@ -416,7 +416,7 @@ By setting `stopWhen: stepCountIs(5)`, you're allowing the model to use up to 5
416
416
 
417
417
  Update your `app/api/chat/route.ts` file to add a new tool to convert the temperature from Fahrenheit to Celsius:
418
418
 
419
- ```tsx filename="app/api/chat/route.ts" highlight="26-39"
419
+ ```tsx filename="app/api/chat/route.ts" highlight="31-46"
420
420
  import {
421
421
  streamText,
422
422
  UIMessage,
@@ -473,7 +473,7 @@ export async function POST(req: Request) {
473
473
 
474
474
  Update your `pages/index.tsx` file to render the new temperature conversion tool:
475
475
 
476
- ```tsx filename="pages/index.tsx" highlight="21"
476
+ ```tsx filename="pages/index.tsx" highlight="17"
477
477
  import { useChat } from '@ai-sdk/react';
478
478
  import { useState } from 'react';
479
479
 
@@ -153,7 +153,7 @@ await newsAgent.generate({
153
153
  Configure provider settings dynamically:
154
154
 
155
155
  ```ts
156
- import { openai, OpenAIProviderOptions } from '@ai-sdk/openai';
156
+ import { openai, OpenAILanguageModelResponsesOptions } from '@ai-sdk/openai';
157
157
  import { ToolLoopAgent } from 'ai';
158
158
  import { z } from 'zod';
159
159
 
@@ -167,7 +167,7 @@ const agent = new ToolLoopAgent({
167
167
  providerOptions: {
168
168
  openai: {
169
169
  reasoningEffort: options.taskDifficulty,
170
- } satisfies OpenAIProviderOptions,
170
+ } satisfies OpenAILanguageModelResponsesOptions,
171
171
  },
172
172
  }),
173
173
  });
@@ -284,7 +284,8 @@ for (const file of result.files) {
284
284
 
285
285
  | Provider | Model | Support sizes (`width x height`) or aspect ratios (`width : height`) |
286
286
  | ------------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
287
- | [xAI Grok](/providers/ai-sdk-providers/xai#image-models) | `grok-2-image` | 1024x768 (default) |
287
+ | [xAI Grok](/providers/ai-sdk-providers/xai#image-models) | `grok-2-image` | `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `2:1`, `1:2`, `19.5:9`, `9:19.5`, `20:9`, `9:20`, `auto` |
288
+ | [xAI Grok](/providers/ai-sdk-providers/xai#image-models) | `grok-imagine-image` | `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `2:1`, `1:2`, `19.5:9`, `9:19.5`, `20:9`, `9:20`, `auto` |
288
289
  | [OpenAI](/providers/ai-sdk-providers/openai#image-models) | `gpt-image-1` | 1024x1024, 1536x1024, 1024x1536 |
289
290
  | [OpenAI](/providers/ai-sdk-providers/openai#image-models) | `dall-e-3` | 1024x1024, 1792x1024, 1024x1792 |
290
291
  | [OpenAI](/providers/ai-sdk-providers/openai#image-models) | `dall-e-2` | 256x256, 512x512, 1024x1024 |
@@ -223,7 +223,7 @@ You can configure the polling timeout using provider-specific options. Each prov
223
223
 
224
224
  ```tsx highlight={"10-12"}
225
225
  import { experimental_generateVideo as generateVideo } from 'ai';
226
- import { fal, type FalVideoProviderOptions } from '@ai-sdk/fal';
226
+ import { fal, type FalVideoModelOptions } from '@ai-sdk/fal';
227
227
 
228
228
  const { video } = await generateVideo({
229
229
  model: fal.video('luma-dream-machine/ray-2'),
@@ -232,7 +232,7 @@ const { video } = await generateVideo({
232
232
  providerOptions: {
233
233
  fal: {
234
234
  pollTimeoutMs: 600000, // 10 minutes
235
- } satisfies FalVideoProviderOptions,
235
+ } satisfies FalVideoModelOptions,
236
236
  },
237
237
  });
238
238
  ```
@@ -233,13 +233,13 @@ Here is an example that implements the following concepts:
233
233
  - setup an OpenAI-compatible provider with custom api key and base URL (here: `custom > *`)
234
234
  - setup model name aliases (here: `anthropic > fast`, `anthropic > writing`, `anthropic > reasoning`)
235
235
  - pre-configure model settings (here: `anthropic > reasoning`)
236
- - validate the provider-specific options (here: `AnthropicProviderOptions`)
236
+ - validate the provider-specific options (here: `AnthropicLanguageModelOptions`)
237
237
  - use a fallback provider (here: `anthropic > *`)
238
238
  - limit a provider to certain models without a fallback (here: `groq > gemma2-9b-it`, `groq > qwen-qwq-32b`)
239
239
  - define a custom separator for the provider registry (here: `>`)
240
240
 
241
241
  ```ts
242
- import { anthropic, AnthropicProviderOptions } from '@ai-sdk/anthropic';
242
+ import { anthropic, AnthropicLanguageModelOptions } from '@ai-sdk/anthropic';
243
243
  import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
244
244
  import { xai } from '@ai-sdk/xai';
245
245
  import { groq } from '@ai-sdk/groq';
@@ -286,7 +286,7 @@ export const registry = createProviderRegistry(
286
286
  type: 'enabled',
287
287
  budgetTokens: 32000,
288
288
  },
289
- } satisfies AnthropicProviderOptions,
289
+ } satisfies AnthropicLanguageModelOptions,
290
290
  },
291
291
  },
292
292
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.78",
3
+ "version": "6.0.80",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/api": "1.9.0",
48
- "@ai-sdk/gateway": "3.0.39",
48
+ "@ai-sdk/gateway": "3.0.41",
49
49
  "@ai-sdk/provider": "3.0.8",
50
50
  "@ai-sdk/provider-utils": "4.0.14"
51
51
  },