diff --git a/js/ai/src/model/middleware.ts b/js/ai/src/model/middleware.ts index f7da057f78..e258d17f76 100644 --- a/js/ai/src/model/middleware.ts +++ b/js/ai/src/model/middleware.ts @@ -322,7 +322,7 @@ const DEFAULT_FALLBACK_STATUSES: StatusName[] = [ * * ```ts * const { text } = await ai.generate({ - * model: googleAI.model('gemini-2.5-pro'), + * model: googleAI.model('gemini-pro-latest'), * prompt: 'You are a helpful AI assistant named Walt, say hello', * use: [ * retry({ @@ -406,11 +406,11 @@ export interface FallbackOptions { * * ```ts * const { text } = await ai.generate({ - * model: googleAI.model('gemini-2.5-pro'), + * model: googleAI.model('gemini-pro-latest'), * prompt: 'You are a helpful AI assistant named Walt, say hello', * use: [ * fallback(ai, { - * models: [googleAI.model('gemini-2.5-flash')], + * models: [googleAI.model('gemini-flash-latest')], * statuses: ['RESOURCE_EXHAUSTED'], * }), * ], diff --git a/js/doc-snippets/src/dotprompt/index.ts b/js/doc-snippets/src/dotprompt/index.ts index 7854487b7f..ba9d058522 100644 --- a/js/doc-snippets/src/dotprompt/index.ts +++ b/js/doc-snippets/src/dotprompt/index.ts @@ -153,7 +153,7 @@ function fn09() { // [START definePromptTempl] const myPrompt = ai.definePrompt({ name: 'myPrompt', - model: 'googleai/gemini-2.5-flash', + model: 'googleai/gemini-flash-latest', input: { schema: z.object({ name: z.string(), @@ -168,7 +168,7 @@ function fn10() { // [START definePromptFn] const myPrompt = ai.definePrompt({ name: 'myPrompt', - model: 'googleai/gemini-2.5-flash', + model: 'googleai/gemini-flash-latest', input: { schema: z.object({ name: z.string(), diff --git a/js/doc-snippets/src/flows/index.ts b/js/doc-snippets/src/flows/index.ts index 9bd164df45..d0424e423f 100644 --- a/js/doc-snippets/src/flows/index.ts +++ b/js/doc-snippets/src/flows/index.ts @@ -29,7 +29,7 @@ export const menuSuggestionFlow = ai.defineFlow( }, async (restaurantTheme) => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Invent a menu item for a ${restaurantTheme} themed restaurant.`, }); return text; @@ -51,7 +51,7 @@ export const menuSuggestionFlowWithSchema = ai.defineFlow( }, async (restaurantTheme) => { const { output } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Invent a menu item for a ${restaurantTheme} themed restaurant.`, output: { schema: MenuItemSchema }, }); @@ -72,7 +72,7 @@ export const menuSuggestionFlowMarkdown = ai.defineFlow( }, async (restaurantTheme) => { const { output } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Invent a menu item for a ${restaurantTheme} themed restaurant.`, output: { schema: MenuItemSchema }, }); @@ -94,7 +94,7 @@ export const menuSuggestionStreamingFlow = ai.defineFlow( }, async (restaurantTheme, { sendChunk }) => { const response = await ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Invent a menu item for a ${restaurantTheme} themed restaurant.`, }); @@ -178,7 +178,7 @@ Today's menu } ); const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), system: "Help the user answer questions about today's menu.", prompt: input, docs: [{ content: [{ text: menu }] }], diff --git a/js/doc-snippets/src/index.ts b/js/doc-snippets/src/index.ts index 3e3ed4e8fd..94f5a734a8 100644 --- a/js/doc-snippets/src/index.ts +++ b/js/doc-snippets/src/index.ts @@ -19,7 +19,7 @@ import { genkit } from 'genkit'; const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); async function main() { diff --git a/js/doc-snippets/src/models/index.ts b/js/doc-snippets/src/models/index.ts index 816f6aab63..b77ea4830c 100644 --- a/js/doc-snippets/src/models/index.ts +++ b/js/doc-snippets/src/models/index.ts @@ -19,13 +19,13 @@ import { genkit } from 'genkit'; const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); async function fn01() { // [START ex01] const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: 'Invent a menu item for a pirate themed restaurant.', }); // [END ex01] diff --git a/js/doc-snippets/src/models/minimal.ts b/js/doc-snippets/src/models/minimal.ts index 7bc4905fc6..fbc4600b0c 100644 --- a/js/doc-snippets/src/models/minimal.ts +++ b/js/doc-snippets/src/models/minimal.ts @@ -20,7 +20,7 @@ import { genkit } from 'genkit'; const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); async function main() { diff --git a/js/doc-snippets/src/multi-agent/simple.ts b/js/doc-snippets/src/multi-agent/simple.ts index 6639f6699d..0330b23b07 100644 --- a/js/doc-snippets/src/multi-agent/simple.ts +++ b/js/doc-snippets/src/multi-agent/simple.ts @@ -64,7 +64,7 @@ const reservationTool = ai.defineTool( // [START chat] const chat = ai.chat({ - model: googleAI.model('gemini-2.5-pro'), + model: googleAI.model('gemini-pro-latest'), system: "You are an AI customer service agent for Pavel's Cafe. Use the tools " + 'available to you to help the customer. If you cannot help the ' + diff --git a/js/genkit/src/genkit.ts b/js/genkit/src/genkit.ts index 2f7d4ea005..01333ae7d9 100644 --- a/js/genkit/src/genkit.ts +++ b/js/genkit/src/genkit.ts @@ -681,7 +681,7 @@ export class Genkit implements HasRegistry { * ```ts * const ai = genkit({ * plugins: [googleAI()], - * model: googleAI.model('gemini-2.5-flash'), // default model + * model: googleAI.model('gemini-flash-latest'), // default model * }) * * const { text } = await ai.generate('hi'); @@ -697,7 +697,7 @@ export class Genkit implements HasRegistry { * ```ts * const ai = genkit({ * plugins: [googleAI()], - * model: googleAI.model('gemini-2.5-flash'), // default model + * model: googleAI.model('gemini-flash-latest'), // default model * }) * * const { text } = await ai.generate([ @@ -731,7 +731,7 @@ export class Genkit implements HasRegistry { * ], * messages: conversationHistory, * tools: [ userInfoLookup ], - * model: googleAI.model('gemini-2.5-flash'), + * model: googleAI.model('gemini-flash-latest'), * }); * ``` */ @@ -773,7 +773,7 @@ export class Genkit implements HasRegistry { * ```ts * const ai = genkit({ * plugins: [googleAI()], - * model: googleAI.model('gemini-2.5-flash'), // default model + * model: googleAI.model('gemini-flash-latest'), // default model * }) * * const { response, stream } = ai.generateStream('hi'); @@ -793,7 +793,7 @@ export class Genkit implements HasRegistry { * ```ts * const ai = genkit({ * plugins: [googleAI()], - * model: googleAI.model('gemini-2.5-flash'), // default model + * model: googleAI.model('gemini-flash-latest'), // default model * }) * * const { response, stream } = ai.generateStream([ @@ -831,7 +831,7 @@ export class Genkit implements HasRegistry { * ], * messages: conversationHistory, * tools: [ userInfoLookup ], - * model: googleAI.model('gemini-2.5-flash'), + * model: googleAI.model('gemini-flash-latest'), * }); * for await (const chunk of stream) { * console.log(chunk.text); diff --git a/js/plugins/google-genai/src/googleai/gemini.ts b/js/plugins/google-genai/src/googleai/gemini.ts index e12a6884ab..9ddd67d279 100644 --- a/js/plugins/google-genai/src/googleai/gemini.ts +++ b/js/plugins/google-genai/src/googleai/gemini.ts @@ -436,6 +436,9 @@ const GENERIC_GEMMA_MODEL = commonRef( ); const KNOWN_GEMINI_MODELS = { + 'gemini-pro-latest': commonRef('gemini-pro-latest'), + 'gemini-flash-latest': commonRef('gemini-flash-latest'), + 'gemini-flash-lite-latest': commonRef('gemini-flash-lite-latest'), 'gemini-3.1-pro-preview-customtools': commonRef( 'gemini-3.1-pro-preview-customtools' ), diff --git a/js/plugins/vertexai/src/modelgarden/v2/anthropic.ts b/js/plugins/vertexai/src/modelgarden/v2/anthropic.ts index 0911cae891..a218a7c641 100644 --- a/js/plugins/vertexai/src/modelgarden/v2/anthropic.ts +++ b/js/plugins/vertexai/src/modelgarden/v2/anthropic.ts @@ -91,7 +91,6 @@ export const KNOWN_MODELS = { 'claude-opus-4-5@20251101': commonRef('claude-opus-4-5@20251101'), 'claude-opus-4-1@20250805': commonRef('claude-opus-4-1@20250805'), 'claude-opus-4@20250514': commonRef('claude-opus-4@20250514'), - 'claude-3-haiku@20240307': commonRef('claude-3-haiku@20240307'), }; export type KnownModels = keyof typeof KNOWN_MODELS; export type AnthropicModelName = `claude-${string}`; diff --git a/js/plugins/vertexai/tests/modelgarden/v2/index_test.ts b/js/plugins/vertexai/tests/modelgarden/v2/index_test.ts index ac88d2c463..b0c7fa47a9 100644 --- a/js/plugins/vertexai/tests/modelgarden/v2/index_test.ts +++ b/js/plugins/vertexai/tests/modelgarden/v2/index_test.ts @@ -34,7 +34,7 @@ import { modelName as stripPrefix } from '../../../src/modelgarden/v2/utils'; describe('vertexModelGarden.model helper', () => { it('should return an Anthropic model reference', () => { - const modelName = 'claude-3-haiku@20240307'; + const modelName = 'claude-haiku-4-5@20251001'; const model = vertexModelGarden.model(modelName); assert.ok(isAnthropicModelName(stripPrefix(model.name))); assert.strictEqual(model.name, `vertex-model-garden/${modelName}`); @@ -42,7 +42,7 @@ describe('vertexModelGarden.model helper', () => { }); it('should return a Mistral model reference', () => { - const modelName = 'mistral-large-2411'; + const modelName = 'mistral-medium-3'; const model = vertexModelGarden.model(modelName); assert.ok(isMistralModelName(stripPrefix(model.name))); assert.strictEqual(model.name, `vertex-model-garden/${modelName}`); @@ -50,7 +50,7 @@ describe('vertexModelGarden.model helper', () => { }); it('should return a Llama model reference', () => { - const modelName = 'meta/llama-3.1-8b-instruct-maas'; + const modelName = 'meta/llama-4-maverick-17b-128e-instruct-maas'; const model = vertexModelGarden.model(modelName); assert.ok(isLlamaModelName(stripPrefix(model.name))); assert.strictEqual(model.name, `vertex-model-garden/${modelName}`); diff --git a/js/testapps/basic-gemini/src/index.ts b/js/testapps/basic-gemini/src/index.ts index 15df34f8a4..eaf19a100c 100644 --- a/js/testapps/basic-gemini/src/index.ts +++ b/js/testapps/basic-gemini/src/index.ts @@ -43,7 +43,7 @@ const ai = genkit({ ai.defineFlow('basic-hi', async () => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-lite-latest'), prompt: 'You are a helpful AI assistant named Walt, say hello', }); @@ -52,7 +52,7 @@ ai.defineFlow('basic-hi', async () => { ai.defineFlow('basic-hi-with-retry', async () => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-pro'), + model: googleAI.model('gemini-pro-latest'), prompt: 'You are a helpful AI assistant named Walt, say hello', use: [ retry({ @@ -71,7 +71,7 @@ ai.defineFlow('basic-hi-with-fallback', async () => { prompt: 'You are a helpful AI assistant named Walt, say hello', use: [ fallback(ai, { - models: [googleAI.model('gemini-2.5-flash')], + models: [googleAI.model('gemini-flash-latest')], statuses: ['UNKNOWN'], }), ], @@ -114,7 +114,7 @@ ai.defineFlow('multimodal-input', async () => { const photoBase64 = fs.readFileSync('photo.jpg', { encoding: 'base64' }); const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: [ { text: 'describe this photo' }, { @@ -132,7 +132,7 @@ ai.defineFlow('multimodal-input', async () => { // YouTube videos ai.defineFlow('youtube-videos', async (_, { sendChunk }) => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: [ { text: 'transcribe this video', @@ -152,7 +152,7 @@ ai.defineFlow('youtube-videos', async (_, { sendChunk }) => { // streaming ai.defineFlow('streaming', async (_, { sendChunk }) => { const { stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: 'Write a poem about AI.', }); @@ -168,7 +168,7 @@ ai.defineFlow('streaming', async (_, { sendChunk }) => { // Search grounding ai.defineFlow('search-grounding', async () => { const { text, raw } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: 'Who is Albert Einstein?', config: { tools: [{ googleSearch: {} }], @@ -184,7 +184,7 @@ ai.defineFlow('search-grounding', async () => { // Url context ai.defineFlow('url-context', async () => { const { text, raw } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: 'Compare the ingredients and cooking times from the recipes at ' + 'https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-1940592 ' + @@ -209,7 +209,7 @@ ai.defineFlow('file-search', async () => { // Use the file search store in your generate request const { text, raw } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: "What is the character's name in the story?", config: { fileSearch: { @@ -289,7 +289,7 @@ ai.defineFlow( }, async (location, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, @@ -314,7 +314,7 @@ ai.defineFlow( }, async (_, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-3.1-pro-preview'), + model: googleAI.model('gemini-pro-latest'), config: { temperature: 1, }, @@ -345,7 +345,7 @@ ai.defineFlow( }, async (location, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, @@ -376,7 +376,7 @@ ai.defineFlow( }, async (name, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 2, // we want creativity }, @@ -392,8 +392,8 @@ ai.defineFlow( } ); -// Gemini reasoning example. -ai.defineFlow('reasoning', async (_, { sendChunk }) => { +// Gemini reasoning example (legacy thinkingBudget) +ai.defineFlow('reasoning - thinkingBudget', async (_, { sendChunk }) => { const { message } = await ai.generate({ prompt: 'what is heavier, one kilo of steel or one kilo of feathers', model: googleAI.model('gemini-2.5-pro'), @@ -489,6 +489,11 @@ ai.defineFlow('nano-banana-2', async (_) => { google_search: { searchTypes: { webSearch: {}, imageSearch: {} }, }, + thinkingConfig: { + // Optional + thinkingLevel: 'HIGH', + includeThoughts: true, + }, }, }); diff --git a/js/testapps/dev-ui-gallery/src/genkit.ts b/js/testapps/dev-ui-gallery/src/genkit.ts index 35af895689..ffae066b4e 100644 --- a/js/testapps/dev-ui-gallery/src/genkit.ts +++ b/js/testapps/dev-ui-gallery/src/genkit.ts @@ -81,12 +81,12 @@ export const PERMISSIVE_SAFETY_SETTINGS: any = { // a second instance, just for fun export const ai2 = genkit({ name: 'Instance Two', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), plugins: [googleAI()], }); export const ai = genkit({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), // load at least one plugin representing each action type plugins: [ // model providers diff --git a/js/testapps/dev-ui-gallery/src/main/prompts.ts b/js/testapps/dev-ui-gallery/src/main/prompts.ts index 951812757a..70f30057d3 100644 --- a/js/testapps/dev-ui-gallery/src/main/prompts.ts +++ b/js/testapps/dev-ui-gallery/src/main/prompts.ts @@ -28,7 +28,7 @@ const template = 'Say hello to {{name}} in the voice of a {{persona}}.'; export const codeDefinedPrompt = ai.definePrompt({ name: promptName, - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: HelloSchema, }, @@ -66,7 +66,7 @@ export const codeDefinedPrompt = ai.definePrompt({ export const codeDefinedPromptVariant = ai.definePrompt({ name: promptName, variant: 'jsonOutput', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: HelloSchema, }, @@ -100,7 +100,7 @@ export const promptFn = ai.definePrompt({ input: { schema: HelloSchema, }, - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), messages: async (input) => [ { role: 'user', diff --git a/js/testapps/dev-ui-gallery/src/main/tools.ts b/js/testapps/dev-ui-gallery/src/main/tools.ts index cdac07dac7..058f4e51ca 100644 --- a/js/testapps/dev-ui-gallery/src/main/tools.ts +++ b/js/testapps/dev-ui-gallery/src/main/tools.ts @@ -93,7 +93,7 @@ const template = ` export const weatherPrompt = ai.definePrompt({ name: 'weatherPrompt', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: WeatherSchema, }, diff --git a/js/testapps/docs-menu-basic/src/index.ts b/js/testapps/docs-menu-basic/src/index.ts index 15b5475413..49601a8ff4 100644 --- a/js/testapps/docs-menu-basic/src/index.ts +++ b/js/testapps/docs-menu-basic/src/index.ts @@ -33,7 +33,7 @@ export const menuSuggestionFlow = ai.defineFlow( async (subject) => { const llmResponse = await ai.generate({ prompt: `Suggest an item for the menu of a ${subject} themed restaurant`, - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, diff --git a/js/testapps/evals/src/pdf-rag.ts b/js/testapps/evals/src/pdf-rag.ts index e2aeb45666..bf24220e98 100644 --- a/js/testapps/evals/src/pdf-rag.ts +++ b/js/testapps/evals/src/pdf-rag.ts @@ -70,7 +70,7 @@ export const pdfQA = ai.defineFlow( context: docs.map((d) => d.text).join('\n\n'), }); const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: augmentedPrompt, }); return llmResponse.text; @@ -86,7 +86,7 @@ export const simpleStructured = ai.defineFlow( }, async (i) => { const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: i.query, }); return { response: llmResponse.text }; @@ -102,7 +102,7 @@ export const simpleEcho = ai.defineFlow( }, async (i) => { const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: i, }); return llmResponse.text; diff --git a/js/testapps/express/src/index.ts b/js/testapps/express/src/index.ts index 7671e732db..76e4364364 100644 --- a/js/testapps/express/src/index.ts +++ b/js/testapps/express/src/index.ts @@ -47,7 +47,7 @@ export const jokeFlow = ai.defineFlow( return await ai.run('call-llm', async () => { const llmResponse = await ai.generate({ prompt: `tell me long joke about ${subject}`, - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, @@ -130,7 +130,7 @@ app.get('/jokeStream', async (req: Request, res: Response) => { }); await ai.generate({ prompt: `Tell me a long joke about ${subject}`, - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, diff --git a/js/testapps/flow-simple-ai/src/index.ts b/js/testapps/flow-simple-ai/src/index.ts index c201e0ba7a..99ac41ba4e 100644 --- a/js/testapps/flow-simple-ai/src/index.ts +++ b/js/testapps/flow-simple-ai/src/index.ts @@ -72,7 +72,7 @@ const ai = genkit({ ], }), ], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); const math: PluginProvider = { @@ -207,7 +207,7 @@ export const streamJsonFlow = ai.defineFlow( }, async (count, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), output: { schema: GameCharactersSchema, }, @@ -307,7 +307,7 @@ export const vertexStreamer = ai.defineFlow( async (input, { sendChunk }) => { return await ai.run('call-llm', async () => { const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Tell me a very long joke about ${input}.`, onChunk: (c) => sendChunk(c.text), }); @@ -358,7 +358,7 @@ export const searchDestinations = ai.defineFlow( }); const result = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `Give me a list of vacation options based on the provided context. Use only the options provided below, and describe how it fits with my query. Query: ${input} @@ -464,7 +464,7 @@ export const toolCaller = ai.defineFlow( }, async (_, { sendChunk }) => { const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, @@ -506,7 +506,7 @@ export const dynamicToolCaller = ai.defineFlow( ); const { response, stream } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { temperature: 1, }, @@ -595,7 +595,7 @@ export const invalidOutput = ai.defineFlow( }, async () => { const result = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), output: { schema: z.object({ name: z.string(), @@ -628,7 +628,7 @@ export const fileApi = ai.defineFlow( console.log(uploadResult.file); const result = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: [ { text: 'Describe this image:' }, { @@ -671,7 +671,7 @@ export const toolTester = ai.defineFlow( }, async (query) => { const result = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: query, tools: testTools, }); @@ -689,7 +689,7 @@ export const arrayStreamTester = ai.defineFlow( async (input, { sendChunk }) => { try { const { stream, response } = ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { safetySettings: [ { @@ -745,7 +745,7 @@ ai.defineFlow( }, async (query, { sendChunk }) => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: query, tools: ['math/add', 'math/subtract'], onChunk: sendChunk, @@ -784,7 +784,7 @@ ai.defineFlow('blockingMiddleware', async () => { ai.defineFlow('formatJson', async (input, { sendChunk }) => { const { output, text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `generate an RPG game character of type ${input || 'archer'}`, output: { constrained: true, @@ -803,7 +803,7 @@ ai.defineFlow('formatJson', async (input, { sendChunk }) => { ai.defineFlow('formatJsonManualSchema', async (input, { sendChunk }) => { const { output, text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `generate one RPG game character of type ${input || 'archer'} and generated JSON must match this interface \`\`\`typescript @@ -873,7 +873,7 @@ ai.defineFlow( }, async (input) => { const { output } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `extract data from:\n\n${input}`, output: { schema: z.object({ @@ -925,7 +925,7 @@ ai.defineFlow('geminiImages', async (_, { sendChunk }) => { ai.defineFlow('geminiEnum', async (thing, { sendChunk }) => { const { response, stream } = await ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `What type of thing is ${thing || 'a banana'}?`, output: { schema: z.object({ @@ -959,7 +959,7 @@ ai.defineFlow('embedders-tester', async () => { ai.defineFlow('reasoning', async (_, { sendChunk }) => { const { message } = await ai.generate({ prompt: 'whats heavier, one kilo of steel or or one kilo of feathers', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), config: { thinkingConfig: { thinkingBudget: 1024, @@ -1112,7 +1112,7 @@ async function saveWaveFile( ai.defineFlow('googleSearch', async (thing) => { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: `What is a banana?`, config: { tools: [{ googleSearch: {} }] }, }); @@ -1144,7 +1144,7 @@ ai.defineFlow('googleai-imagen', async (thing) => { ai.defineFlow('meme-of-the-day', async () => { const { text: script } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: 'Write a detailed script for a 8 second video. The video should be a meme of the day. ' + 'A Silly DIY FAIL situation like a: broken tools, or bad weather or crooked assembly, etc. Be creative. The FAIL should be very obvious. ' + @@ -1266,7 +1266,7 @@ ai.defineResource( ai.defineFlow('resource', async () => { return await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: [ { text: 'analyze this: ' }, { resource: { uri: 'my://resource/value' } }, @@ -1279,7 +1279,7 @@ ai.defineFlow('abort-signal', async (_, { sendChunk }) => { const signal = abort.signal; setTimeout(() => abort.abort(), 2000); return await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: [{ text: 'tell me a long joke' }], onChunk: sendChunk, abortSignal: signal, diff --git a/js/testapps/format-tester/src/tools.ts b/js/testapps/format-tester/src/tools.ts index cdeada0cbe..17cc15556e 100644 --- a/js/testapps/format-tester/src/tools.ts +++ b/js/testapps/format-tester/src/tools.ts @@ -19,7 +19,7 @@ import { genkit, z } from 'genkit'; const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); const lookupUsers = ai.defineTool( diff --git a/js/testapps/mcp/src/index.ts b/js/testapps/mcp/src/index.ts index 8bf2f4c99a..72f8699e18 100644 --- a/js/testapps/mcp/src/index.ts +++ b/js/testapps/mcp/src/index.ts @@ -45,7 +45,7 @@ export const PERMISSIVE_SAFETY_SETTINGS: any = { export const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); logger.setLogLevel('debug'); // Set the logging level to debug for detailed output diff --git a/js/testapps/menu/src/01/prompts.ts b/js/testapps/menu/src/01/prompts.ts index c6d14a6057..8d83e3f8c5 100644 --- a/js/testapps/menu/src/01/prompts.ts +++ b/js/testapps/menu/src/01/prompts.ts @@ -29,7 +29,7 @@ export const s01_vanillaPrompt = ai.definePrompt({ config: { temperature: 0.3 }, messages: async (input: MenuQuestionInput) => { const promptText = ` - You are acting as a helpful AI assistant named "Walt" that can answer + You are acting as a helpful AI assistant named "Walt" that can answer questions about the food available on the menu at Walt's Burgers. Customer says: ${input.question} `; @@ -44,17 +44,17 @@ export const s01_vanillaPrompt = ai.definePrompt({ export const s01_staticMenuDotPrompt = ai.definePrompt({ name: 's01_staticMenuDotPrompt', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: MenuQuestionInputSchema }, output: { format: 'text' }, messages: ` -You are acting as a helpful AI assistant named "Walt" that can answer -questions about the food available on the menu at Walt's Burgers. +You are acting as a helpful AI assistant named "Walt" that can answer +questions about the food available on the menu at Walt's Burgers. Here is today's menu: - The Regular Burger $12 The classic charbroiled to perfection with your choice of cheese - + - The Fancy Burger $13 Classic burger topped with bacon & Blue Cheese @@ -63,14 +63,14 @@ Here is today's menu: - Everything Burger $14 Heinz 57 sauce, American cheese, bacon, fried egg & crispy onion bits - + - Chicken Breast Sandwich $12 Tender juicy chicken breast on a brioche roll. Grilled, blackened, or fried Our fresh 1/2 lb. beef patties are made using choice cut brisket, short rib & sirloin. Served on a toasted -brioche roll with chips. Served with lettuce, tomato & pickles. +brioche roll with chips. Served with lettuce, tomato & pickles. Onions upon request. Substitute veggie patty $2 Answer this customer's question, in a concise and helpful manner, diff --git a/js/testapps/menu/src/02/prompts.ts b/js/testapps/menu/src/02/prompts.ts index b54c7d0f15..615451bf6b 100644 --- a/js/testapps/menu/src/02/prompts.ts +++ b/js/testapps/menu/src/02/prompts.ts @@ -24,7 +24,7 @@ import { menuTool } from './tools.js'; export const s02_dataMenuPrompt = ai.definePrompt({ name: 's02_dataMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: MenuQuestionInputSchema }, output: { format: 'text' }, tools: [menuTool], @@ -32,8 +32,8 @@ export const s02_dataMenuPrompt = ai.definePrompt({ temperature: 0.2, }, messages: ` -You are acting as a helpful AI assistant named Walt that can answer -questions about the food available on the menu at Walt's Burgers. +You are acting as a helpful AI assistant named Walt that can answer +questions about the food available on the menu at Walt's Burgers. Answer this customer's question, in a concise and helpful manner, as long as it is about food on the menu or something harmless like sports. diff --git a/js/testapps/menu/src/04/prompts.ts b/js/testapps/menu/src/04/prompts.ts index 53d062ee74..8046baef17 100644 --- a/js/testapps/menu/src/04/prompts.ts +++ b/js/testapps/menu/src/04/prompts.ts @@ -20,17 +20,17 @@ import { DataMenuQuestionInputSchema } from '../types.js'; export const s04_ragDataMenuPrompt = ai.definePrompt({ name: 's04_ragDataMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: DataMenuQuestionInputSchema }, output: { format: 'text' }, config: { temperature: 0.3 }, messages: ` You are acting as Walt, a helpful AI assistant here at the restaurant. You can answer questions about the food on the menu or any other questions -customers have about food in general. +customers have about food in general. Here are some items that are on today's menu that are relevant to -helping you answer the customer's question: +helping you answer the customer's question: {{#each menuData~}} - {{this.title}} \${{this.price}} {{this.description}} diff --git a/js/testapps/menu/src/05/prompts.ts b/js/testapps/menu/src/05/prompts.ts index 55162f8ab5..df01d4060a 100644 --- a/js/testapps/menu/src/05/prompts.ts +++ b/js/testapps/menu/src/05/prompts.ts @@ -21,7 +21,7 @@ import { TextMenuQuestionInputSchema } from '../types.js'; export const s05_readMenuPrompt = ai.definePrompt({ name: 's05_readMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: z.object({ imageUrl: z.string(), @@ -30,23 +30,23 @@ export const s05_readMenuPrompt = ai.definePrompt({ output: { format: 'text' }, config: { temperature: 0.1 }, messages: ` -Extract _all_ of the text, in order, +Extract _all_ of the text, in order, from the following image of a restaurant menu. -{{media url=imageUrl}} +{{media url=imageUrl}} `, }); export const s05_textMenuPrompt = ai.definePrompt({ name: 's05_textMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: TextMenuQuestionInputSchema }, output: { format: 'text' }, config: { temperature: 0.3 }, messages: ` You are acting as Walt, a helpful AI assistant here at the restaurant. You can answer questions about the food on the menu or any other questions -customers have about food in general. +customers have about food in general. Here is the text of today's menu to help you answer the customer's question: {{menuText}} diff --git a/js/testapps/model-armor/src/index.ts b/js/testapps/model-armor/src/index.ts index ff6a4445d5..912a291386 100644 --- a/js/testapps/model-armor/src/index.ts +++ b/js/testapps/model-armor/src/index.ts @@ -40,7 +40,7 @@ ai.defineFlow( } try { const { text } = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: input, use: [ modelArmor({ diff --git a/js/testapps/next/src/genkit/index.ts b/js/testapps/next/src/genkit/index.ts index 411b3877f6..31e51f5ae3 100644 --- a/js/testapps/next/src/genkit/index.ts +++ b/js/testapps/next/src/genkit/index.ts @@ -22,5 +22,5 @@ disableOTelRootSpanDetection(); export const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); diff --git a/js/testapps/rag/src/genkit.ts b/js/testapps/rag/src/genkit.ts index 4b445f7fdd..aa33a99111 100644 --- a/js/testapps/rag/src/genkit.ts +++ b/js/testapps/rag/src/genkit.ts @@ -111,5 +111,5 @@ export const ai = genkit({ metrics: [GenkitMetric.FAITHFULNESS, GenkitMetric.MALICIOUSNESS], }), ], - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), }); diff --git a/js/testapps/rag/src/pdf-rag-firebase.ts b/js/testapps/rag/src/pdf-rag-firebase.ts index fa4989a885..0282e7550a 100644 --- a/js/testapps/rag/src/pdf-rag-firebase.ts +++ b/js/testapps/rag/src/pdf-rag-firebase.ts @@ -124,7 +124,7 @@ export const pdfQAFirebase = ai.defineFlow( context: docs.map((d) => d.text).join('\n\n'), }); const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: augmentedPrompt, }); diff --git a/js/testapps/rag/src/pdf-rag.ts b/js/testapps/rag/src/pdf-rag.ts index 8f26df6430..de2e3fa110 100644 --- a/js/testapps/rag/src/pdf-rag.ts +++ b/js/testapps/rag/src/pdf-rag.ts @@ -117,7 +117,7 @@ export const synthesizeQuestions = ai.defineFlow( const questions: string[] = []; for (let i = 0; i < chunks.length; i++) { const qResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), prompt: { text: `Generate one question about the text below: ${chunks[i]}`, }, diff --git a/js/testapps/rag/src/prompt.ts b/js/testapps/rag/src/prompt.ts index c548548390..713f01cc2d 100644 --- a/js/testapps/rag/src/prompt.ts +++ b/js/testapps/rag/src/prompt.ts @@ -21,7 +21,7 @@ import { ai } from './genkit.js'; // Define a prompt that includes the retrieved context documents export const augmentedPrompt = ai.definePrompt({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), name: 'augmentedPrompt', input: { schema: z.object({ diff --git a/samples/js-angular/server/src/chatbot.ts b/samples/js-angular/server/src/chatbot.ts index 4a1ab2698d..879a3a54be 100644 --- a/samples/js-angular/server/src/chatbot.ts +++ b/samples/js-angular/server/src/chatbot.ts @@ -50,7 +50,7 @@ const datePicker = ai.defineTool( export const chatbotFlow = defineAgent(ai, { name: 'chatbotFlow', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), tools: [weatherTool, datePicker], returnToolRequests: true, systemPrompt: diff --git a/samples/js-angular/server/src/jsonStreaming.ts b/samples/js-angular/server/src/jsonStreaming.ts index 7aae662f46..2d59f2dadb 100644 --- a/samples/js-angular/server/src/jsonStreaming.ts +++ b/samples/js-angular/server/src/jsonStreaming.ts @@ -43,7 +43,7 @@ export const streamCharacters = ai.defineFlow( }, async (count, { sendChunk }) => { const { response, stream } = await ai.generateStream({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), output: { format: 'json', schema: GameCharactersSchema, diff --git a/samples/js-character-generator/index.ts b/samples/js-character-generator/index.ts index 08113e35eb..58827a11ce 100644 --- a/samples/js-character-generator/index.ts +++ b/samples/js-character-generator/index.ts @@ -23,7 +23,7 @@ const ai = genkit({ const prompt = ai.definePrompt({ name: 'Character Prompt', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: z.object({ inspiration: z.string(), diff --git a/samples/js-coffee-shop/src/index.ts b/samples/js-coffee-shop/src/index.ts index 1b36d25837..2c413b5130 100644 --- a/samples/js-coffee-shop/src/index.ts +++ b/samples/js-coffee-shop/src/index.ts @@ -33,7 +33,7 @@ const CustomerNameSchema = z.object({ const simpleGreetingPrompt = ai.definePrompt( { name: 'simpleGreeting', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: CustomerNameSchema }, output: { format: 'text', @@ -68,7 +68,7 @@ const CustomerTimeAndHistorySchema = z.object({ const greetingWithHistoryPrompt = ai.definePrompt( { name: 'greetingWithHistory', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: CustomerTimeAndHistorySchema }, output: { format: 'text', diff --git a/samples/js-gemini/package.json b/samples/js-gemini/package.json index 3b0955cda7..b8897a126b 100644 --- a/samples/js-gemini/package.json +++ b/samples/js-gemini/package.json @@ -14,14 +14,14 @@ "author": "", "license": "ISC", "dependencies": { - "@genkit-ai/google-genai": "^1.17.0", - "genkit": "^1.17.0", + "@genkit-ai/google-genai": "^1.28.0", + "genkit": "^1.28.0", "node-fetch": "3.3.2", "wav": "^1.0.2" }, "devDependencies": { "@types/wav": "^1.0.4", - "genkit-cli": "^1.17.0", + "genkit-cli": "^1.28.0", "tsx": "^4.20.3", "typescript": "^5.5.4" } diff --git a/samples/js-gemini/src/index.ts b/samples/js-gemini/src/index.ts index 36369afa89..1f48c9bfc2 100644 --- a/samples/js-gemini/src/index.ts +++ b/samples/js-gemini/src/index.ts @@ -201,8 +201,8 @@ ai.defineFlow( } ); -// Gemini reasoning example. -ai.defineFlow('reasoning', async (_, { sendChunk }) => { +// Legacy Gemini reasoning example. +ai.defineFlow('gemini 2.5 reasoning', async (_, { sendChunk }) => { const { message } = await ai.generate({ prompt: 'what is heavier, one kilo of steel or one kilo of feathers', model: googleAI.model('gemini-2.5-pro'), @@ -218,6 +218,23 @@ ai.defineFlow('reasoning', async (_, { sendChunk }) => { return message; }); +// Current Gemini reasoning example +ai.defineFlow('thinkingConfig', async (_, { sendChunk }) => { + const { text } = await ai.generate({ + prompt: 'what is heavier, one kilo of steel or one kilo of feathers', + model: googleAI.model('gemini-3.1-pro-preview'), + config: { + thinkingConfig: { + thinkingLevel: 'HIGH', + includeThoughts: true, + }, + }, + onChunk: sendChunk, + }); + + return text; +}); + // Gemini code execution. ai.defineFlow('code-execution', async (_, { sendChunk }) => { const { message } = await ai.generate({ diff --git a/samples/js-menu/src/01/prompts.ts b/samples/js-menu/src/01/prompts.ts index 3ebdec3e03..9b1f6f379f 100644 --- a/samples/js-menu/src/01/prompts.ts +++ b/samples/js-menu/src/01/prompts.ts @@ -29,7 +29,7 @@ export const s01_vanillaPrompt = ai.definePrompt( }, async (input: MenuQuestionInput): Promise => { const promptText = ` - You are acting as a helpful AI assistant named "Walt" that can answer + You are acting as a helpful AI assistant named "Walt" that can answer questions about the food available on the menu at Walt's Burgers. Customer says: ${input.question} `; @@ -48,18 +48,18 @@ export const s01_vanillaPrompt = ai.definePrompt( export const s01_staticMenuDotPrompt = ai.definePrompt( { name: 's01_staticMenuDotPrompt', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: MenuQuestionInputSchema }, output: { format: 'text' }, }, ` -You are acting as a helpful AI assistant named "Walt" that can answer -questions about the food available on the menu at Walt's Burgers. +You are acting as a helpful AI assistant named "Walt" that can answer +questions about the food available on the menu at Walt's Burgers. Here is today's menu: - The Regular Burger $12 The classic charbroiled to perfection with your choice of cheese - + - The Fancy Burger $13 Classic burger topped with bacon & Blue Cheese @@ -68,14 +68,14 @@ Here is today's menu: - Everything Burger $14 Heinz 57 sauce, American cheese, bacon, fried egg & crispy onion bits - + - Chicken Breast Sandwich $12 Tender juicy chicken breast on a brioche roll. Grilled, blackened, or fried Our fresh 1/2 lb. beef patties are made using choice cut brisket, short rib & sirloin. Served on a toasted -brioche roll with chips. Served with lettuce, tomato & pickles. +brioche roll with chips. Served with lettuce, tomato & pickles. Onions upon request. Substitute veggie patty $2 Answer this customer's question, in a concise and helpful manner, diff --git a/samples/js-menu/src/02/prompts.ts b/samples/js-menu/src/02/prompts.ts index 2d969481ec..0839b64704 100644 --- a/samples/js-menu/src/02/prompts.ts +++ b/samples/js-menu/src/02/prompts.ts @@ -25,14 +25,14 @@ import { menuTool } from './tools'; export const s02_dataMenuPrompt = ai.definePrompt( { name: 's02_dataMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: MenuQuestionInputSchema }, output: { format: 'text' }, tools: [menuTool], }, ` -You are acting as a helpful AI assistant named Walt that can answer -questions about the food available on the menu at Walt's Burgers. +You are acting as a helpful AI assistant named Walt that can answer +questions about the food available on the menu at Walt's Burgers. Answer this customer's question, in a concise and helpful manner, as long as it is about food on the menu or something harmless like sports. diff --git a/samples/js-menu/src/03/flows.ts b/samples/js-menu/src/03/flows.ts index 030681820c..6f7108e4d7 100644 --- a/samples/js-menu/src/03/flows.ts +++ b/samples/js-menu/src/03/flows.ts @@ -77,7 +77,7 @@ export const s03_multiTurnChatFlow = ai.defineFlow( // Generate the response const llmResponse = await ai.generate({ - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), messages: history, prompt: { text: input.question, diff --git a/samples/js-menu/src/03/prompts.ts b/samples/js-menu/src/03/prompts.ts index b36dc0f7c9..2a60a6652f 100644 --- a/samples/js-menu/src/03/prompts.ts +++ b/samples/js-menu/src/03/prompts.ts @@ -24,7 +24,7 @@ import { DataMenuQuestionInputSchema } from '../types'; export const s03_chatPreamblePrompt = ai.definePrompt( { name: 's03_chatPreamble', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: DataMenuQuestionInputSchema }, output: { format: 'text' }, config: { temperature: 0.3 }, @@ -32,12 +32,12 @@ export const s03_chatPreamblePrompt = ai.definePrompt( ` {{ role "user" }} Hi. What's on the menu today? - + {{ role "model" }} I am Walt, a helpful AI assistant here at the restaurant. I can answer questions about the food on the menu or any other questions you have about food in general. I probably can't help you with anything else. - Here is today's menu: + Here is today's menu: {{#each menuData~}} - {{this.title}} \${{this.price}} {{this.description}} diff --git a/samples/js-menu/src/04/prompts.ts b/samples/js-menu/src/04/prompts.ts index 454bf65179..194f721eed 100644 --- a/samples/js-menu/src/04/prompts.ts +++ b/samples/js-menu/src/04/prompts.ts @@ -21,7 +21,7 @@ import { DataMenuQuestionInputSchema } from '../types'; export const s04_ragDataMenuPrompt = ai.definePrompt( { name: 's04_ragDataMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: DataMenuQuestionInputSchema }, output: { format: 'text' }, config: { temperature: 0.3 }, @@ -29,10 +29,10 @@ export const s04_ragDataMenuPrompt = ai.definePrompt( ` You are acting as Walt, a helpful AI assistant here at the restaurant. You can answer questions about the food on the menu or any other questions -customers have about food in general. +customers have about food in general. Here are some items that are on today's menu that are relevant to -helping you answer the customer's question: +helping you answer the customer's question: {{#each menuData~}} - {{this.title}} \${{this.price}} {{this.description}} diff --git a/samples/js-menu/src/05/prompts.ts b/samples/js-menu/src/05/prompts.ts index e76a8e2fba..ed9309ce82 100644 --- a/samples/js-menu/src/05/prompts.ts +++ b/samples/js-menu/src/05/prompts.ts @@ -22,7 +22,7 @@ import { TextMenuQuestionInputSchema } from '../types'; export const s05_readMenuPrompt = ai.definePrompt( { name: 's05_readMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: z.object({ imageUrl: z.string(), @@ -32,17 +32,17 @@ export const s05_readMenuPrompt = ai.definePrompt( config: { temperature: 0.1 }, }, ` -Extract _all_ of the text, in order, +Extract _all_ of the text, in order, from the following image of a restaurant menu. -{{media url=imageUrl}} +{{media url=imageUrl}} ` ); export const s05_textMenuPrompt = ai.definePrompt( { name: 's05_textMenu', - model: googleAI.model('gemini-2.5-flash'), + model: googleAI.model('gemini-flash-latest'), input: { schema: TextMenuQuestionInputSchema }, output: { format: 'text' }, config: { temperature: 0.3 }, @@ -50,7 +50,7 @@ export const s05_textMenuPrompt = ai.definePrompt( ` You are acting as Walt, a helpful AI assistant here at the restaurant. You can answer questions about the food on the menu or any other questions -customers have about food in general. +customers have about food in general. Here is the text of today's menu to help you answer the customer's question: {{menuText}} diff --git a/samples/js-schoolAgent/src/genkit.ts b/samples/js-schoolAgent/src/genkit.ts index e6a128b85b..d2d4f20e27 100644 --- a/samples/js-schoolAgent/src/genkit.ts +++ b/samples/js-schoolAgent/src/genkit.ts @@ -20,7 +20,7 @@ import type { AgentState } from './types'; export const ai = genkit({ plugins: [googleAI()], - model: googleAI.model('gemini-2.5-pro'), + model: googleAI.model('gemini-pro-latest'), }); ai.defineHelper(