1717import { GenkitMetric , genkitEval } from '@genkit-ai/evaluator' ;
1818import { defineFirestoreRetriever } from '@genkit-ai/firebase' ;
1919import { enableGoogleCloudTelemetry } from '@genkit-ai/google-cloud' ;
20- import { googleAI } from '@genkit-ai/googleai' ;
21- import { vertexAI } from '@genkit-ai/vertexai' ;
20+ import { googleAI , vertexAI } from '@genkit-ai/google-genai' ;
2221import { GoogleAIFileManager } from '@google/generative-ai/server' ;
2322import { AlwaysOnSampler } from '@opentelemetry/sdk-trace-base' ;
2423import { initializeApp } from 'firebase-admin/app' ;
@@ -255,17 +254,14 @@ export const jokeWithToolsFlow = ai.defineFlow(
255254 {
256255 name : 'jokeWithToolsFlow' ,
257256 inputSchema : z . object ( {
258- modelName : z . enum ( [
259- googleAI . model ( 'gemini-2.5-flash' ) . name ,
260- googleAI . model ( 'gemini-2.5-pro' ) . name ,
261- ] ) ,
257+ modelName : z . enum ( [ 'gemini-2.5-flash' , 'gemini-2.5-pro' ] ) ,
262258 subject : z . string ( ) ,
263259 } ) ,
264260 outputSchema : z . object ( { model : z . string ( ) , joke : z . string ( ) } ) ,
265261 } ,
266262 async ( input ) => {
267263 const llmResponse = await ai . generate ( {
268- model : input . modelName as string ,
264+ model : googleAI . model ( input . modelName as string ) ,
269265 tools,
270266 output : { schema : z . object ( { joke : z . string ( ) } ) } ,
271267 prompt : `Tell a joke about ${ input . subject } .` ,
@@ -282,14 +278,14 @@ export const jokeWithOutputFlow = ai.defineFlow(
282278 {
283279 name : 'jokeWithOutputFlow' ,
284280 inputSchema : z . object ( {
285- modelName : z . enum ( [ googleAI . model ( 'gemini-2.5-flash' ) . name ] ) ,
281+ modelName : z . enum ( [ 'gemini-2.5-flash' ] ) ,
286282 subject : z . string ( ) ,
287283 } ) ,
288284 outputSchema,
289285 } ,
290286 async ( input , { sendChunk } ) => {
291287 const llmResponse = await ai . generate ( {
292- model : input . modelName ,
288+ model : googleAI . model ( input . modelName ) ,
293289 output : {
294290 format : 'json' ,
295291 schema : outputSchema ,
@@ -914,7 +910,7 @@ ai.defineFlow(
914910
915911ai . defineFlow ( 'geminiImages' , async ( _ , { sendChunk } ) => {
916912 const { response, stream } = ai . generateStream ( {
917- model : googleAI . model ( 'gemini-2.0 -flash-preview- image-generation ' ) ,
913+ model : googleAI . model ( 'gemini-2.5 -flash-image' ) ,
918914 prompt : `generate an image of a banana riding a bicycle` ,
919915 config : {
920916 responseModalities : [ 'TEXT' , 'IMAGE' ] ,
0 commit comments