ai 6.0.246 → 6.0.248
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 +26 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/03-ai-sdk-core/38-video-generation.mdx +16 -0
- package/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +1 -1
- package/package.json +4 -4
- package/src/generate-video/generate-video.ts +4 -3
package/dist/internal/index.js
CHANGED
|
@@ -164,7 +164,7 @@ function detectMediaType({
|
|
|
164
164
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
165
165
|
|
|
166
166
|
// src/version.ts
|
|
167
|
-
var VERSION = true ? "6.0.
|
|
167
|
+
var VERSION = true ? "6.0.248" : "0.0.0-test";
|
|
168
168
|
|
|
169
169
|
// src/util/download/download.ts
|
|
170
170
|
var download = async ({
|
package/dist/internal/index.mjs
CHANGED
|
@@ -48,6 +48,22 @@ const { video } = await generateVideo({
|
|
|
48
48
|
});
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
Some models also accept `'adaptive'`, which lets the provider derive the output
|
|
52
|
+
ratio from the input media instead of a fixed value. This is typically required
|
|
53
|
+
for image-to-video, video editing, and video extension, where the output
|
|
54
|
+
inherits the ratio of the input and an explicit ratio is rejected.
|
|
55
|
+
|
|
56
|
+
```tsx highlight={"7"}
|
|
57
|
+
import { experimental_generateVideo as generateVideo } from 'ai';
|
|
58
|
+
__PROVIDER_IMPORT__;
|
|
59
|
+
|
|
60
|
+
const { video } = await generateVideo({
|
|
61
|
+
model: __VIDEO_MODEL__,
|
|
62
|
+
prompt: { image: firstFrame, text: 'A cat walking on a treadmill' },
|
|
63
|
+
aspectRatio: 'adaptive',
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
51
67
|
### Resolution
|
|
52
68
|
|
|
53
69
|
The resolution is specified as a string in the format `{width}x{height}`.
|
|
@@ -83,7 +83,7 @@ console.log(videos);
|
|
|
83
83
|
type: 'string',
|
|
84
84
|
isOptional: true,
|
|
85
85
|
description:
|
|
86
|
-
|
|
86
|
+
"Aspect ratio of the videos to generate. Format: `{width}:{height}`, or `'adaptive'` to inherit the ratio from the input media (e.g. a first-frame image or a source video). Support for `'adaptive'` is provider-specific.",
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
name: 'resolution',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.248",
|
|
4
4
|
"description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
|
-
"@ai-sdk/gateway": "3.0.
|
|
49
|
-
"@ai-sdk/provider": "3.0.
|
|
50
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
48
|
+
"@ai-sdk/gateway": "3.0.168",
|
|
49
|
+
"@ai-sdk/provider": "3.0.15",
|
|
50
|
+
"@ai-sdk/provider-utils": "4.0.44"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@edge-runtime/vm": "^5.0.0",
|
|
@@ -46,7 +46,7 @@ export type GenerateVideoPrompt =
|
|
|
46
46
|
* @param model - The video model to use.
|
|
47
47
|
* @param prompt - The prompt that should be used to generate the video.
|
|
48
48
|
* @param n - Number of videos to generate. Default: 1.
|
|
49
|
-
* @param aspectRatio - Aspect ratio of the videos to generate. Must have the format `{width}:{height}`.
|
|
49
|
+
* @param aspectRatio - Aspect ratio of the videos to generate. Must have the format `{width}:{height}`, or `'adaptive'`.
|
|
50
50
|
* @param resolution - Resolution of the videos to generate. Must have the format `{width}x{height}`.
|
|
51
51
|
* @param duration - Duration of the video in seconds.
|
|
52
52
|
* @param fps - Frames per second for the video.
|
|
@@ -104,9 +104,10 @@ export async function experimental_generateVideo({
|
|
|
104
104
|
maxVideosPerCall?: number;
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Aspect ratio of the videos to generate. Must have the format
|
|
107
|
+
* Aspect ratio of the videos to generate. Must have the format
|
|
108
|
+
* `{width}:{height}`, or `'adaptive'` to inherit the ratio from the input media.
|
|
108
109
|
*/
|
|
109
|
-
aspectRatio?: `${number}:${number}
|
|
110
|
+
aspectRatio?: `${number}:${number}` | 'adaptive';
|
|
110
111
|
|
|
111
112
|
/**
|
|
112
113
|
* Resolution of the videos to generate. Must have the format `{width}x{height}`.
|