@ai-sdk/google 4.0.32 → 4.0.34
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 +14 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/google-video-model.ts +9 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ai-sdk/provider": "4.0.5",
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.21"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "22.19.19",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AISDKError,
|
|
3
|
-
type Experimental_VideoModelV4,
|
|
3
|
+
type Experimental_VideoModelV4 as VideoModelV4,
|
|
4
4
|
type Experimental_VideoModelV4CallOptions as VideoModelV4CallOptions,
|
|
5
|
-
type Experimental_VideoModelV4File,
|
|
5
|
+
type Experimental_VideoModelV4File as VideoModelV4File,
|
|
6
6
|
type Experimental_VideoModelV4OperationStartResult as VideoModelV4OperationStartResult,
|
|
7
7
|
type Experimental_VideoModelV4OperationStatusResult as VideoModelV4OperationStatusResult,
|
|
8
8
|
type SharedV4ProviderMetadata,
|
|
@@ -28,8 +28,6 @@ import {
|
|
|
28
28
|
} from './google-video-model-options';
|
|
29
29
|
import type { GoogleVideoModelId } from './google-video-settings';
|
|
30
30
|
|
|
31
|
-
type VideoModelV4 = Experimental_VideoModelV4;
|
|
32
|
-
|
|
33
31
|
interface GoogleVideoModelConfig {
|
|
34
32
|
provider: string;
|
|
35
33
|
baseURL: string;
|
|
@@ -43,27 +41,27 @@ interface GoogleVideoModelConfig {
|
|
|
43
41
|
|
|
44
42
|
function getFirstFrameImage(
|
|
45
43
|
options: VideoModelV4CallOptions,
|
|
46
|
-
):
|
|
44
|
+
): VideoModelV4File | undefined {
|
|
47
45
|
return options.frameImages?.find(frame => frame.frameType === 'first_frame')
|
|
48
46
|
?.image;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
function resolveStartImage(
|
|
52
50
|
options: VideoModelV4CallOptions,
|
|
53
|
-
):
|
|
51
|
+
): VideoModelV4File | undefined {
|
|
54
52
|
return getFirstFrameImage(options) ?? options.image;
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
function getLastFrameImage(
|
|
58
56
|
options: VideoModelV4CallOptions,
|
|
59
|
-
):
|
|
57
|
+
): VideoModelV4File | undefined {
|
|
60
58
|
return options.frameImages?.find(frame => frame.frameType === 'last_frame')
|
|
61
59
|
?.image;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
function getInputReferences(
|
|
65
63
|
options: VideoModelV4CallOptions,
|
|
66
|
-
): Array<
|
|
64
|
+
): Array<VideoModelV4File> | undefined {
|
|
67
65
|
if (options.frameImages != null && options.frameImages.length > 0) {
|
|
68
66
|
return undefined;
|
|
69
67
|
}
|
|
@@ -74,7 +72,7 @@ function getInputReferences(
|
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
function convertFileToGoogleImage(
|
|
77
|
-
file:
|
|
75
|
+
file: VideoModelV4File,
|
|
78
76
|
warnings: SharedV4Warning[],
|
|
79
77
|
): Record<string, unknown> | undefined {
|
|
80
78
|
if (file.type === 'url') {
|
|
@@ -134,14 +132,14 @@ function convertProviderReferenceImage(
|
|
|
134
132
|
}
|
|
135
133
|
|
|
136
134
|
function convertInputReferenceImage(
|
|
137
|
-
file:
|
|
135
|
+
file: VideoModelV4File,
|
|
138
136
|
warnings: SharedV4Warning[],
|
|
139
137
|
): Record<string, unknown> | undefined {
|
|
140
138
|
const image = convertFileToGoogleImage(file, warnings);
|
|
141
139
|
return image != null ? { image, referenceType: 'asset' } : undefined;
|
|
142
140
|
}
|
|
143
141
|
|
|
144
|
-
export class GoogleVideoModel implements
|
|
142
|
+
export class GoogleVideoModel implements VideoModelV4 {
|
|
145
143
|
readonly specificationVersion = 'v4';
|
|
146
144
|
|
|
147
145
|
get provider(): string {
|