@@ -82,7 +82,7 @@ const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
8282
8383async function main() {
8484 const response = await ai.models.generateContent({
85- model: ' gemini-2.5- flash' ,
85+ model: ' gemini-flash-latest ' ,
8686 contents: ' Why is the sky blue?' ,
8787 });
8888 console.log(response.text);
@@ -229,7 +229,7 @@ const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
229229
230230async function main() {
231231 const response = await ai.models.generateContentStream({
232- model: ' gemini-2.5- flash' ,
232+ model: ' gemini-flash-latest ' ,
233233 contents: ' Write a 100-word poem.' ,
234234 });
235235 for await (const chunk of response) {
@@ -274,7 +274,7 @@ async function main() {
274274
275275 const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
276276 const response = await ai.models.generateContent({
277- model: ' gemini-2.5- flash' ,
277+ model: ' gemini-flash-latest ' ,
278278 contents: ' Dim the lights so the room feels cozy and warm.' ,
279279 config: {
280280 toolConfig: {
@@ -325,7 +325,7 @@ await client.connect(serverParams);
325325
326326// Send request to the model with MCP tools
327327const response = await ai.models.generateContent({
328- model: "gemini-2.5- flash",
328+ model: "gemini-flash-latest ",
329329 contents: `What is the weather in London in ${new Date().toLocaleDateString()}?`,
330330 config: {
331331 tools: [mcpToTool(client)], // uses the session, will automatically call the tool using automatic function calling
@@ -400,7 +400,7 @@ for more details.
400400
401401```typescript
402402const interaction = await ai.interactions.create({
403- model: 'gemini-2 . 5 - flash',
403+ model: 'gemini-flash-latest ',
404404 input: 'Hello, how are you?',
405405});
406406console.debug(interaction);
@@ -415,14 +415,14 @@ conversation by referencing the `previous_interaction_id`.
415415```typescript
416416// 1 . First turn
417417const interaction1 = await ai.interactions.create({
418- model: 'gemini-2 . 5 - flash',
418+ model: 'gemini-flash-latest ',
419419 input: 'Hi, my name is Amir.',
420420});
421421console.debug(interaction1 );
422422
423423// 2 . Second turn (passing previous_interaction_id)
424424const interaction2 = await ai.interactions.create({
425- model: 'gemini-2 . 5 - flash',
425+ model: 'gemini-flash-latest ',
426426 input: 'What is my name?',
427427 previous_interaction_id: interaction1 .id,
428428});
@@ -479,7 +479,7 @@ import base64
479479// const base64Image = ...;
480480
481481const interaction = await ai.interactions.create({
482- model: ' gemini-2.5- flash' ,
482+ model: ' gemini-flash-latest ' ,
483483 input: [
484484 { type: ' text' , text: ' Describe the image.' },
485485 { type: ' image' , data: base64Image, mime_type: ' image/png' },
@@ -505,7 +505,7 @@ const getWeather = (location: string) => {
505505
506506// 2. Send the request with tools
507507let interaction = await ai.interactions.create({
508- model: ' gemini-2.5- flash' ,
508+ model: ' gemini-flash-latest ' ,
509509 input: ' What is the weather in Mountain View, CA?' ,
510510 tools: [
511511 {
@@ -538,7 +538,7 @@ for (const output of interaction.outputs!) {
538538
539539 // Send result back to the model
540540 interaction = await ai.interactions.create({
541- model: ' gemini-2.5- flash' ,
541+ model: ' gemini-flash-latest ' ,
542542 previous_interaction_id: interaction.id,
543543 input: [
544544 {
@@ -564,7 +564,7 @@ Execution**.
564564
565565```typescript
566566const interaction = await ai.interactions.create({
567- model: ' gemini-2.5- flash' ,
567+ model: ' gemini-flash-latest ' ,
568568 input: ' Who won the last Super Bowl' ,
569569 tools: [{ type: ' google_search' }],
570570});
@@ -577,7 +577,7 @@ console.debug(interaction);
577577
578578```typescript
579579const interaction = await ai.interactions.create({
580- model: ' gemini-2.5- flash' ,
580+ model: ' gemini-flash-latest ' ,
581581 input: ' Calculate the 50th Fibonacci number.' ,
582582 tools: [{ type: ' code_execution' }],
583583});
0 commit comments