2222
2323import { EmbedderReference , ModelReference , z } from 'genkit' ;
2424import { GenkitPluginV2 , genkitPluginV2 } from 'genkit/plugin' ;
25+ import { ActionType } from 'genkit/registry' ;
2526
2627import * as embedder from './embedder.js' ;
2728import * as gemini from './gemini.js' ;
2829import * as imagen from './imagen.js' ;
2930import * as lyria from './lyria.js' ;
3031import * as veo from './veo.js' ;
3132
32- import { ActionType } from 'genkit/registry' ;
3333import { listModels } from './client.js' ;
3434import { VertexPluginOptions } from './types.js' ;
3535import { getDerivedOptions } from './utils.js' ;
@@ -45,6 +45,8 @@ async function initializer(pluginOptions?: VertexPluginOptions) {
4545 const clientOptions = await getDerivedOptions ( pluginOptions ) ;
4646
4747 return [
48+ ...veo . defineKnownModels ( clientOptions , pluginOptions ) ,
49+ ...lyria . defineKnownModels ( clientOptions , pluginOptions ) ,
4850 ...imagen . defineKnownModels ( clientOptions , pluginOptions ) ,
4951 ...gemini . defineKnownModels ( clientOptions , pluginOptions ) ,
5052 ...embedder . defineKnownModels ( clientOptions , pluginOptions ) ,
@@ -59,25 +61,37 @@ async function resolver(
5961 const clientOptions = await getDerivedOptions ( pluginOptions ) ;
6062 switch ( actionType ) {
6163 case 'model' :
62- if ( imagen . isImagenModelName ( actionName ) ) {
64+ if ( lyria . isLyriaModelName ( actionName ) ) {
65+ return lyria . defineModel ( actionName , clientOptions , pluginOptions ) ;
66+ } else if ( imagen . isImagenModelName ( actionName ) ) {
6367 return imagen . defineModel ( actionName , clientOptions , pluginOptions ) ;
68+ } else if ( veo . isVeoModelName ( actionName ) ) {
69+ // no-op (not gemini)
6470 } else {
6571 return gemini . defineModel ( actionName , clientOptions , pluginOptions ) ;
6672 }
73+ break ;
74+ case 'background-model' :
75+ if ( veo . isVeoModelName ( actionName ) ) {
76+ return veo . defineModel ( actionName , clientOptions , pluginOptions ) ;
77+ }
78+ break ;
6779 case 'embedder' :
6880 return embedder . defineEmbedder ( actionName , clientOptions , pluginOptions ) ;
69- default :
70- return undefined ;
7181 }
82+
83+ return undefined ;
7284}
7385
7486async function listActions ( options ?: VertexPluginOptions ) {
75- const clientOptions = await getDerivedOptions ( options ) ;
7687 try {
88+ const clientOptions = await getDerivedOptions ( options ) ;
7789 const models = await listModels ( clientOptions ) ;
7890 return [
7991 ...gemini . listActions ( models ) ,
8092 ...imagen . listActions ( models ) ,
93+ ...lyria . listActions ( models ) ,
94+ ...veo . listActions ( models ) ,
8195 // We don't list embedders here
8296 ] ;
8397 } catch ( e : unknown ) {
0 commit comments