@ai-sdk/xai 4.0.27 → 4.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "4.0.27",
3
+ "version": "4.0.29",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@ai-sdk/openai-compatible": "3.0.22",
32
+ "@ai-sdk/openai-compatible": "3.0.24",
33
33
  "@ai-sdk/provider": "4.0.5",
34
- "@ai-sdk/provider-utils": "5.0.20"
34
+ "@ai-sdk/provider-utils": "5.0.22"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "22.19.19",
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AISDKError,
3
3
  APICallError,
4
- type Experimental_VideoModelV4,
4
+ type Experimental_VideoModelV4 as VideoModelV4,
5
5
  type Experimental_VideoModelV4CallOptions as VideoModelV4CallOptions,
6
- type Experimental_VideoModelV4File,
6
+ type Experimental_VideoModelV4File as VideoModelV4File,
7
7
  type Experimental_VideoModelV4OperationStartResult as VideoModelV4OperationStartResult,
8
8
  type Experimental_VideoModelV4OperationStatusResult as VideoModelV4OperationStatusResult,
9
9
  type SharedV4Warning,
@@ -29,8 +29,6 @@ import {
29
29
  } from './xai-video-model-options';
30
30
  import type { XaiVideoModelId } from './xai-video-settings';
31
31
 
32
- type VideoModelV4 = Experimental_VideoModelV4;
33
-
34
32
  interface XaiVideoModelConfig {
35
33
  provider: string;
36
34
  baseURL: string | undefined;
@@ -51,28 +49,28 @@ type XaiVideoCallOptions = VideoModelV4CallOptions;
51
49
 
52
50
  function getFirstFrameImage(
53
51
  options: XaiVideoCallOptions,
54
- ): Experimental_VideoModelV4File | undefined {
52
+ ): VideoModelV4File | undefined {
55
53
  return options.frameImages?.find(frame => frame.frameType === 'first_frame')
56
54
  ?.image;
57
55
  }
58
56
 
59
57
  function getLastFrameImage(
60
58
  options: XaiVideoCallOptions,
61
- ): Experimental_VideoModelV4File | undefined {
59
+ ): VideoModelV4File | undefined {
62
60
  return options.frameImages?.find(frame => frame.frameType === 'last_frame')
63
61
  ?.image;
64
62
  }
65
63
 
66
64
  function resolveStartImage(
67
65
  options: XaiVideoCallOptions,
68
- ): Experimental_VideoModelV4File | undefined {
66
+ ): VideoModelV4File | undefined {
69
67
  return getFirstFrameImage(options) ?? options.image;
70
68
  }
71
69
 
72
- const isVideoFile = (file: Experimental_VideoModelV4File): boolean =>
70
+ const isVideoFile = (file: VideoModelV4File): boolean =>
73
71
  file.mediaType != null && getTopLevelMediaType(file.mediaType) === 'video';
74
72
 
75
- function fileToXaiImageUrl(file: Experimental_VideoModelV4File): string {
73
+ function fileToXaiImageUrl(file: VideoModelV4File): string {
76
74
  if (file.type === 'url') {
77
75
  return file.url;
78
76
  }
@@ -153,7 +151,7 @@ function resolveVideoMode(
153
151
  return undefined;
154
152
  }
155
153
 
156
- export class XaiVideoModel implements Experimental_VideoModelV4 {
154
+ export class XaiVideoModel implements VideoModelV4 {
157
155
  readonly specificationVersion = 'v4';
158
156
  readonly maxVideosPerCall = 1;
159
157