Skip to content

Commit 930c9c3

Browse files
matthew29tangcopybara-github
authored andcommitted
feat: Add labels field to Veo configs
PiperOrigin-RevId: 889943189
1 parent 083a1e3 commit 930c9c3

5 files changed

Lines changed: 14 additions & 0 deletions

File tree

api-report/genai-node.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ export interface GenerateVideosConfig {
15491549
fps?: number;
15501550
generateAudio?: boolean;
15511551
httpOptions?: HttpOptions;
1552+
labels?: Record<string, string>;
15521553
lastFrame?: Image_2;
15531554
mask?: VideoGenerationMask;
15541555
negativePrompt?: string;

api-report/genai-web.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ export interface GenerateVideosConfig {
15491549
fps?: number;
15501550
generateAudio?: boolean;
15511551
httpOptions?: HttpOptions;
1552+
labels?: Record<string, string>;
15521553
lastFrame?: Image_2;
15531554
mask?: VideoGenerationMask;
15541555
negativePrompt?: string;

api-report/genai.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ export interface GenerateVideosConfig {
15491549
fps?: number;
15501550
generateAudio?: boolean;
15511551
httpOptions?: HttpOptions;
1552+
labels?: Record<string, string>;
15521553
lastFrame?: Image_2;
15531554
mask?: VideoGenerationMask;
15541555
negativePrompt?: string;

src/converters/_models_converters.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,6 +2697,10 @@ export function generateVideosConfigToMldev(
26972697
);
26982698
}
26992699

2700+
if (common.getValueByPath(fromObject, ['labels']) !== undefined) {
2701+
throw new Error('labels parameter is not supported in Gemini API.');
2702+
}
2703+
27002704
return toObject;
27012705
}
27022706

@@ -2865,6 +2869,11 @@ export function generateVideosConfigToVertex(
28652869
);
28662870
}
28672871

2872+
const fromLabels = common.getValueByPath(fromObject, ['labels']);
2873+
if (parentObject !== undefined && fromLabels != null) {
2874+
common.setValueByPath(parentObject, ['labels'], fromLabels);
2875+
}
2876+
28682877
return toObject;
28692878
}
28702879

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4398,6 +4398,8 @@ export declare interface GenerateVideosConfig {
43984398
mask?: VideoGenerationMask;
43994399
/** Compression quality of the generated videos. */
44004400
compressionQuality?: VideoCompressionQuality;
4401+
/** User specified labels to track billing usage. */
4402+
labels?: Record<string, string>;
44014403
}
44024404

44034405
/** Class that represents the parameters for generating videos. */

0 commit comments

Comments
 (0)