@ai-sdk/gateway 4.0.106 → 4.0.108

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.
@@ -247,7 +247,7 @@ import {
247
247
  // The receiver uses this token to look up the expected batch and signing
248
248
  // secret before trusting anything in the webhook body.
249
249
  const token = randomUUID();
250
- const model = 'anthropic/claude-haiku-4.5' as const;
250
+ const model = 'anthropic/claude-haiku-5.5' as const;
251
251
 
252
252
  // Reserve the token before starting so an early delivery finds a retryable
253
253
  // pending record rather than an unknown callback.
@@ -1412,7 +1412,7 @@ import { gateway, streamText } from 'ai';
1412
1412
 
1413
1413
  // 1. Make requests with tags
1414
1414
  const result = streamText({
1415
- model: gateway('anthropic/claude-haiku-4.5'),
1415
+ model: gateway('anthropic/claude-haiku-5.5'),
1416
1416
  prompt: 'Summarize this quarter's results',
1417
1417
  providerOptions: {
1418
1418
  gateway: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-sdk/gateway",
3
3
  "private": false,
4
- "version": "4.0.106",
4
+ "version": "4.0.108",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "sideEffects": false,
@@ -30,8 +30,8 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@ai-sdk/provider": "4.0.24",
34
- "@ai-sdk/provider-utils": "5.0.56",
33
+ "@ai-sdk/provider": "4.0.25",
34
+ "@ai-sdk/provider-utils": "5.0.57",
35
35
  "@vercel/oidc": "3.2.0"
36
36
  },
37
37
  "devDependencies": {
@@ -2,5 +2,6 @@ export type GatewayDecisionModelId =
2
2
  | 'convaiinnovations/laya'
3
3
  | 'convaiinnovations/laya-free'
4
4
  | 'liquid/d1'
5
+ | 'openai/gpt-6-luna-decisions'
5
6
  | 'typesafe-ai/jev'
6
7
  | (string & {});
@@ -1,6 +1,7 @@
1
- import type {
2
- Experimental_DecisionModelV4 as DecisionModelV4,
3
- SharedV4ProviderMetadata,
1
+ import {
2
+ UnsupportedFunctionalityError,
3
+ type Experimental_DecisionModelV4 as DecisionModelV4,
4
+ type SharedV4ProviderMetadata,
4
5
  } from '@ai-sdk/provider';
5
6
  import {
6
7
  combineHeaders,
@@ -51,6 +52,21 @@ export class GatewayDecisionModel implements DecisionModelV4 {
51
52
  }: Parameters<DecisionModelV4['doDecide']>[0]): Promise<
52
53
  Awaited<ReturnType<DecisionModelV4['doDecide']>>
53
54
  > {
55
+ const values = state.map(part => {
56
+ if (part.type === 'file') {
57
+ throw new UnsupportedFunctionalityError({
58
+ functionality: 'Gateway decision file input',
59
+ });
60
+ }
61
+ return part.type === 'text' ? part.text : part.value;
62
+ });
63
+ // Keep the legacy Gateway state format: string, JSON object, or JSON array.
64
+ const requestState =
65
+ values.length === 1 &&
66
+ (typeof values[0] === 'string' ||
67
+ (typeof values[0] === 'object' && values[0] !== null))
68
+ ? values[0]
69
+ : values;
54
70
  const gatewayOptions = await parseProviderOptions({
55
71
  provider: 'gateway',
56
72
  providerOptions,
@@ -77,7 +93,7 @@ export class GatewayDecisionModel implements DecisionModelV4 {
77
93
  await resolve(this.config.o11yHeaders),
78
94
  ),
79
95
  body: {
80
- state,
96
+ state: requestState,
81
97
  questions,
82
98
  ...(validatedProviderOptions
83
99
  ? { providerOptions: validatedProviderOptions }
@@ -34,4 +34,5 @@ export type GatewayImageModelId =
34
34
  | 'recraft/recraft-v4.1-utility-pro'
35
35
  | 'spacexai/grok-imagine-image'
36
36
  | 'spacexai/grok-imagine-image-2.0'
37
+ | 'topaz/wonder-3.5'
37
38
  | (string & {});
@@ -39,6 +39,7 @@ export type GatewayModelId =
39
39
  | 'anthropic/claude-fable-5'
40
40
  | 'anthropic/claude-fable-5.1'
41
41
  | 'anthropic/claude-haiku-4.5'
42
+ | 'anthropic/claude-haiku-5.5'
42
43
  | 'anthropic/claude-opus-4'
43
44
  | 'anthropic/claude-opus-4.5'
44
45
  | 'anthropic/claude-opus-4.6'
@@ -2,7 +2,6 @@ export type GatewayTranscriptionModelId =
2
2
  | 'fish-audio/transcribe-1'
3
3
  | 'google/gemini-3.5-transcribe'
4
4
  | 'google/gemini-3.5-transcribe-live'
5
- | 'microsoft/mai-transcribe-1.5'
6
5
  | 'microsoft/mai-transcribe-2'
7
6
  | 'microsoft/mai-transcribe-2-streaming'
8
7
  | 'openai/gpt-4o-mini-transcribe'
@@ -35,4 +35,6 @@ export type GatewayVideoModelId =
35
35
  | 'spacexai/grok-imagine-video'
36
36
  | 'spacexai/grok-imagine-video-1.5'
37
37
  | 'spacexai/grok-imagine-video-1.5-lite'
38
+ | 'topaz/proteus'
39
+ | 'topaz/starlight-precise-2.6'
38
40
  | (string & {});