@@ -139,10 +139,10 @@ async function listActions(options?: PluginOptions): Promise<ActionMetadata[]> {
139
139
// Filter out deprecated
140
140
. filter ( ( m ) => ! m . description || ! m . description . includes ( 'deprecated' ) )
141
141
. map ( ( m ) => {
142
- const name = m . name . split ( '/' ) . at ( - 1 ) ! ;
142
+ const imagenModelName = m . name . split ( '/' ) . at ( - 1 ) ! ;
143
143
144
144
return modelActionMetadata ( {
145
- name : name ,
145
+ name : imagenModelName ,
146
146
info : { ...GENERIC_IMAGEN_INFO } ,
147
147
configSchema : ImagenConfigSchema ,
148
148
} ) ;
@@ -157,10 +157,10 @@ async function listActions(options?: PluginOptions): Promise<ActionMetadata[]> {
157
157
// Filter out deprecated
158
158
. filter ( ( m ) => ! m . description || ! m . description . includes ( 'deprecated' ) )
159
159
. map ( ( m ) => {
160
- const name = m . name . split ( '/' ) . at ( - 1 ) ! ;
160
+ const veoModelName = m . name . split ( '/' ) . at ( - 1 ) ! ;
161
161
162
162
return modelActionMetadata ( {
163
- name : name , // Return unprefixed name for v2
163
+ name : veoModelName ,
164
164
info : { ...GENERIC_VEO_INFO } ,
165
165
configSchema : VeoConfigSchema ,
166
166
background : true ,
@@ -172,13 +172,13 @@ async function listActions(options?: PluginOptions): Promise<ActionMetadata[]> {
172
172
// Filter out deprecated
173
173
. filter ( ( m ) => ! m . description || ! m . description . includes ( 'deprecated' ) )
174
174
. map ( ( m ) => {
175
- const bare = m . name . startsWith ( 'models/' )
175
+ const modelName = m . name . startsWith ( 'models/' )
176
176
? m . name . substring ( 'models/' . length )
177
177
: m . name ;
178
- const ref = gemini ( bare ) ;
178
+ const ref = gemini ( modelName ) ;
179
179
180
180
return modelActionMetadata ( {
181
- name : bare , // Return unprefixed name for v2
181
+ name : modelName ,
182
182
info : ref . info ,
183
183
configSchema : GeminiConfigSchema ,
184
184
} ) ;
@@ -189,16 +189,16 @@ async function listActions(options?: PluginOptions): Promise<ActionMetadata[]> {
189
189
// Filter out deprecated
190
190
. filter ( ( m ) => ! m . description || ! m . description . includes ( 'deprecated' ) )
191
191
. map ( ( m ) => {
192
- const bare = m . name . startsWith ( 'models/' )
192
+ const embedderName = m . name . startsWith ( 'models/' )
193
193
? m . name . substring ( 'models/' . length )
194
194
: m . name ;
195
195
196
196
return embedderActionMetadata ( {
197
- name : bare , // Return unprefixed name for v2
197
+ name : embedderName ,
198
198
configSchema : GeminiEmbeddingConfigSchema ,
199
199
info : {
200
200
dimensions : 768 ,
201
- label : `Google Gen AI - ${ bare } ` ,
201
+ label : `Google Gen AI - ${ embedderName } ` ,
202
202
supports : {
203
203
input : [ 'text' ] ,
204
204
} ,
@@ -216,7 +216,6 @@ export function googleAIPlugin(options?: PluginOptions): GenkitPluginV2 {
216
216
return genkitPluginV2 ( {
217
217
name : 'googleai' ,
218
218
async init ( ) {
219
- // Eagerly return actions to register.
220
219
const actions : any [ ] = [ ] ;
221
220
const apiVersions = Array . isArray ( options ?. apiVersion )
222
221
? options ! . apiVersion
@@ -300,7 +299,6 @@ export function googleAIPlugin(options?: PluginOptions): GenkitPluginV2 {
300
299
} ,
301
300
async list ( ) {
302
301
if ( listActionsCache ) return listActionsCache ;
303
- // Must return UNNAMESPACED names in v2. Genkit will prefix them.
304
302
listActionsCache = await listActions ( options ) ;
305
303
return listActionsCache ;
306
304
} ,
0 commit comments