@ai-sdk/provider 3.0.13 → 3.0.15

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,24 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 3.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 2171d15: feat(video): allow `aspectRatio: 'adaptive'` on `generateVideo`
8
+
9
+ Some video models derive the output ratio from the input and reject explicit
10
+ `{width}:{height}` values — BytePlus Seedance 2.5 does this for first-frame,
11
+ first-and-last-frame, editing, and extension tasks. `aspectRatio` on
12
+ `VideoModelV3CallOptions`, and
13
+ `experimental_generateVideo` is now `` `${number}:${number}` | 'adaptive' ``, so
14
+ those calls no longer need a type assertion. Support is provider-specific.
15
+
16
+ ## 3.0.14
17
+
18
+ ### Patch Changes
19
+
20
+ - e1af05f: feat (video): support video (not just image) reference inputs in `inputReferences` for reference-to-video generation
21
+
3
22
  ## 3.0.13
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3837,6 +3837,12 @@ type VideoModelV3File = {
3837
3837
  * The URL of the video or image file.
3838
3838
  */
3839
3839
  url: string;
3840
+ /**
3841
+ * The media type of the referenced file, when known.
3842
+ * Video types: 'video/mp4', 'video/webm', 'video/quicktime'
3843
+ * Image types: 'image/png', 'image/jpeg', 'image/webp'
3844
+ */
3845
+ mediaType?: string;
3840
3846
  /**
3841
3847
  * Optional provider-specific metadata for the file part.
3842
3848
  */
@@ -3876,11 +3882,12 @@ type VideoModelV3CallOptions = {
3876
3882
  n: number;
3877
3883
  /**
3878
3884
  * Aspect ratio of the videos to generate.
3879
- * Must have the format `{width}:{height}`.
3885
+ * Must have the format `{width}:{height}`, or `'adaptive'` to inherit the
3886
+ * ratio from the input media.
3880
3887
  * `undefined` will use the provider's default aspect ratio.
3881
3888
  * Common values: '16:9', '9:16', '1:1', '21:9', '4:3'
3882
3889
  */
3883
- aspectRatio: `${number}:${number}` | undefined;
3890
+ aspectRatio: `${number}:${number}` | 'adaptive' | undefined;
3884
3891
  /**
3885
3892
  * Resolution of the video to generate.
3886
3893
  * Format: `{width}x{height}` (e.g., '1280x720', '1920x1080')
@@ -3916,7 +3923,11 @@ type VideoModelV3CallOptions = {
3916
3923
  */
3917
3924
  frameImages: Array<VideoModelV3FrameImage> | undefined;
3918
3925
  /**
3919
- * Reference image inputs for reference-to-video generation.
3926
+ * Reference inputs for reference-to-video generation.
3927
+ *
3928
+ * Each entry is an image or video file. Providers route each reference by
3929
+ * its media type (image vs. video) and warn when a reference kind is
3930
+ * unsupported.
3920
3931
  */
3921
3932
  inputReferences: Array<VideoModelV3File> | undefined;
3922
3933
  /**
package/dist/index.d.ts CHANGED
@@ -3837,6 +3837,12 @@ type VideoModelV3File = {
3837
3837
  * The URL of the video or image file.
3838
3838
  */
3839
3839
  url: string;
3840
+ /**
3841
+ * The media type of the referenced file, when known.
3842
+ * Video types: 'video/mp4', 'video/webm', 'video/quicktime'
3843
+ * Image types: 'image/png', 'image/jpeg', 'image/webp'
3844
+ */
3845
+ mediaType?: string;
3840
3846
  /**
3841
3847
  * Optional provider-specific metadata for the file part.
3842
3848
  */
@@ -3876,11 +3882,12 @@ type VideoModelV3CallOptions = {
3876
3882
  n: number;
3877
3883
  /**
3878
3884
  * Aspect ratio of the videos to generate.
3879
- * Must have the format `{width}:{height}`.
3885
+ * Must have the format `{width}:{height}`, or `'adaptive'` to inherit the
3886
+ * ratio from the input media.
3880
3887
  * `undefined` will use the provider's default aspect ratio.
3881
3888
  * Common values: '16:9', '9:16', '1:1', '21:9', '4:3'
3882
3889
  */
3883
- aspectRatio: `${number}:${number}` | undefined;
3890
+ aspectRatio: `${number}:${number}` | 'adaptive' | undefined;
3884
3891
  /**
3885
3892
  * Resolution of the video to generate.
3886
3893
  * Format: `{width}x{height}` (e.g., '1280x720', '1920x1080')
@@ -3916,7 +3923,11 @@ type VideoModelV3CallOptions = {
3916
3923
  */
3917
3924
  frameImages: Array<VideoModelV3FrameImage> | undefined;
3918
3925
  /**
3919
- * Reference image inputs for reference-to-video generation.
3926
+ * Reference inputs for reference-to-video generation.
3927
+ *
3928
+ * Each entry is an image or video file. Providers route each reference by
3929
+ * its media type (image vs. video) and warn when a reference kind is
3930
+ * unsupported.
3920
3931
  */
3921
3932
  inputReferences: Array<VideoModelV3File> | undefined;
3922
3933
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "3.0.13",
3
+ "version": "3.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -16,11 +16,12 @@ export type VideoModelV3CallOptions = {
16
16
 
17
17
  /**
18
18
  * Aspect ratio of the videos to generate.
19
- * Must have the format `{width}:{height}`.
19
+ * Must have the format `{width}:{height}`, or `'adaptive'` to inherit the
20
+ * ratio from the input media.
20
21
  * `undefined` will use the provider's default aspect ratio.
21
22
  * Common values: '16:9', '9:16', '1:1', '21:9', '4:3'
22
23
  */
23
- aspectRatio: `${number}:${number}` | undefined;
24
+ aspectRatio: `${number}:${number}` | 'adaptive' | undefined;
24
25
 
25
26
  /**
26
27
  * Resolution of the video to generate.
@@ -63,7 +64,11 @@ export type VideoModelV3CallOptions = {
63
64
  frameImages: Array<VideoModelV3FrameImage> | undefined;
64
65
 
65
66
  /**
66
- * Reference image inputs for reference-to-video generation.
67
+ * Reference inputs for reference-to-video generation.
68
+ *
69
+ * Each entry is an image or video file. Providers route each reference by
70
+ * its media type (image vs. video) and warn when a reference kind is
71
+ * unsupported.
67
72
  */
68
73
  inputReferences: Array<VideoModelV3File> | undefined;
69
74
 
@@ -33,6 +33,13 @@ export type VideoModelV3File =
33
33
  */
34
34
  url: string;
35
35
 
36
+ /**
37
+ * The media type of the referenced file, when known.
38
+ * Video types: 'video/mp4', 'video/webm', 'video/quicktime'
39
+ * Image types: 'image/png', 'image/jpeg', 'image/webp'
40
+ */
41
+ mediaType?: string;
42
+
36
43
  /**
37
44
  * Optional provider-specific metadata for the file part.
38
45
  */