Gemini 3.8 Flash (gemini-3.8-flash) זמין לכלל המשתמשים (GA) ומוכן לשימוש בסביבת ייצור. זהו מודל ה-Flash הכי חכם שלנו, שנועד להנדסת תוכנה לטווח ארוך, לסוכנים אוטונומיים ולתהליכי עבודה מורכבים בארגונים.
במדריך הזה מוסבר מה חדש ב-Gemini 3.8 Flash, אילו שינויים בוצעו ב-API, מוצגות דוגמאות קוד ומופיעות הנחיות להעברה.
המודל החדש
| מודל | מזהה דגם | רמת ההעמקה שמוגדרת כברירת מחדל | תמחור | תיאור |
|---|---|---|---|---|
| Gemini 3.8 Flash | gemini-3.8-flash |
medium |
3.8 Flash זמין עד סוף השנה במחיר היכרות של 0.75 $למיליון טוקנים של קלט ו-3.75 $למיליון טוקנים של פלט. פרטים נוספים זמינים בדף תמחור. | מודל Flash הכי חכם שלנו, שפותח במיוחד להנדסת תוכנה לטווח ארוך, לסוכנים אוטונומיים ולתהליכי עבודה מורכבים בארגונים. |
Gemini 3.8 Flash תומך בחלון הקשר של מיליון טוקנים, ב-64, 000 טוקנים מקסימליים של פלט, ברמות חשיבה שניתנות להתאמה (low, medium, high) ובאותו חבילה מקיפה של כלים מובנים.
למפרט המלא, אפשר לעיין בדף המודל Gemini 3.8 Flash. לפרטים על מחירי מבצע, אפשר לעיין בקטע בנושא מחירים בהמשך או בדף המחירים.
מדריך למתחילים
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Write a three.js script that renders a realistic 3D black hole."
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
model: "gemini-3.8-flash",
input: "Write a three.js script that renders a realistic 3D black hole.",
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Write a three.js script that renders a realistic 3D black hole."))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Write a three.js script that renders a realistic 3D black hole."),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
REST
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"model": "gemini-3.8-flash",
"input": "Write a three.js script that renders a realistic 3D black hole."
}'
מה חדש ב-Gemini 3.8 Flash
- הנדסת תוכנה לטווח ארוך: מספק תוצאות טובות במבחני ביצועים של קידוד בעולם האמיתי, בשינוי מבנה מורכב של קובץ מרובה, ובהרצת כלי דטרמיניסטי. פרטים נוספים זמינים בקטע מתודולוגיית ההערכה.
- סוכנים אוטונומיים: מאפשרים ליצור תהליכי עבודה גמישים של תכנון מרובה שלבים ותזמור כלים, וכך לצמצם באופן משמעותי את מספר הלולאות שנכשלו והשגיאות.
- תהליכי עבודה מורכבים בארגונים: מספק דיוק גבוה, חשיבה רציונלית מעמיקה ורמת עובדות גבוהה במשימות מורכבות בתחום ובצינורות נתונים רחבי היקף.
- מודל ברירת המחדל לסוכנים מנוהלים: סוכן ברירת המחדל לסוכנים מנוהלים, סוכן Antigravity, משתמש עכשיו ב-Gemini 3.8 Flash. Antigravity SDK גם משתמש ב-Gemini 3.8 Flash כברירת מחדל.
- מחיר מבצע: Gemini 3.8 Flash זמין במחיר מבצע של 0.75 $למיליון טוקנים של קלט ו-3.75 $למיליון טוקנים של פלט עד 31 בדצמבר 2026. התמחור הרגיל של 1.50 $למיליון טוקנים של קלט ו-7.50 $למיליון טוקנים של פלט ייכנס לתוקף ב-1 בינואר 2027.
Gemini 3.8 Flash יכול להשתמש ביותר טוקנים במשימות מורכבות וארוכות, וזה נעשה בכוונה. כדי לספק תוצאות באיכות גבוהה יותר ביעדים מורכבים שכוללים כמה שלבים, המודל מבצע שלבי חשיבה רציונלית קטנים יותר, מפעיל כלים באופן איטרטיבי ומאמת את העבודה שלו לאורך הדרך. לא כל תהליך עבודה צריך את רמת האימות הזו. למשימות שוטפות, אפשר להפחית את מאמץ החשיבה הרציונלית כדי לצמצם את צריכת הטוקנים. אפשרות אחרת היא להמשיך להשתמש ב-Gemini 3.7 Flash, שעדיין נתמך באופן מלא.
הסבר על רמות החשיבה הרציונלית
Gemini 3.8 Flash מאפשר לכם לשלוט בגמישות בנתוני השהיה וברמת האינטליגנציה על ידי שינוי רמת החשיבה של המודל:
- מאמץ חשיבה נמוך: מקצר את הזמן עד לקבלת תשובה למשימות שבהן חביון הוא קריטי, כמו צינורות תגובה לאירועים, צ'אט בזמן אמת, טיוטות כתיבה וניתוח נתונים מהיר.
- בינונית (ברירת מחדל): האיכות הכי טובה לרוב המשימות. מומלץ לשימוש בקוד מורכב ובתרחישי שימוש שכוללים סוכנים, ומספק רמת דיוק גבוהה יותר במעבר הראשון.
- מאמץ חשיבה גבוה: ממקסם את יכולות החשיבה הרציונלית של המודל ואת יכולות התיאום בין הכלים. הכי מתאים להסקת מסקנות מעמיקה, למתמטיקה ולמשימות קשות שמורכבות מכמה שלבים.
בדוגמה הבאה, הערך של thinking_level מוגדר כ-medium עבור בקשה מורכבת לניתוח קוד:
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
generation_config={
"thinking_level": "medium" # Balanced reasoning effort for complex tasks
}
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
model: "gemini-3.8-flash",
input: "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
generation_config: {
thinking_level: "medium"
}
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GenerationConfig;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ThinkingLevel;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely."))
.generationConfig(
GenerationConfig.builder()
.thinkingLevel(ThinkingLevel.MEDIUM) // Balanced reasoning effort for complex tasks
.build())
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely."),
GenerationConfig: &interactions.GenerationConfig{
ThinkingLevel: interactions.ThinkingLevelMedium.ToPointer(), // Balanced reasoning effort for complex tasks
},
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
REST
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"model": "gemini-3.8-flash",
"input": "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
"generation_config": {
"thinking_level": "medium"
}
}'
סוכן Antigravity עודכן
בגלל הביצועים המשופרים ויכולות הניתוח המשופרות שלו, סוכן Antigravity ב-Gemini Managed Agents מבוסס עכשיו על Gemini 3.8 Flash כברירת מחדל.
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-2026",
input=(
"Audit https://web.dev for performance, Core Web Vitals, and SEO. "
"Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. "
"Check search indexing with Google Search for site:web.dev. "
"Format the output as a side-by-side scorecard table with prioritized fixes."
),
environment="remote",
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-09-2026",
input: "Audit https://web.dev for performance, Core Web Vitals, and SEO. Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. Check search indexing with Google Search for site:web.dev. Format the output as a side-by-side scorecard table with prioritized fixes.",
environment: "remote",
}, { timeout: 300000 });
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(
InteractionsInput.of(
"Audit https://web.dev for performance, Core Web Vitals, and SEO. "
+ "Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. "
+ "Check search indexing with Google Search for site:web.dev. "
+ "Format the output as a side-by-side scorecard table with prioritized fixes."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput(
"Audit https://web.dev for performance, Core Web Vitals, and SEO. " +
"Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. " +
"Check search indexing with Google Search for site:web.dev. " +
"Format the output as a side-by-side scorecard table with prioritized fixes.",
),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"agent": "antigravity-preview-09-2026",
"input": "Audit https://web.dev for performance, Core Web Vitals, and SEO. Query Google'\''s PageSpeed Insights API for both Mobile and Desktop strategies. Check search indexing with Google Search for site:web.dev. Format the output as a side-by-side scorecard table with prioritized fixes.",
"environment": "remote"
}'
אפשר להגדיר את מודל Gemini הבסיסי באמצעות agent_config.
רשימת משימות להעברה
`/gemini-api-dev migrate my app to Gemini 3.8 Flash`
מעבר ל-gemini-3.8-flash
- עדכון מזהה המודל: משנים את מחרוזת מודל היעד ל-
gemini-3.8-flash. - הסרת פרמטרים של דגימה שהוצאו משימוש:
- הסרת
temperature,top_pו-top_kמהגדרות היצירה. - מחליפים את
thinking_budgetבמחרוזת enumthinking_level. שימו לב:minimalלא נתמך ב-Flash 3.8. - הסרה של
candidate_count(לא נתמך ב-Gemini 3 ואילך).
- הסרת
- החלת כללי אימות של תור:
- הוספנו אפשרות לתקנן שיחות רב-שלביות בצד השרת
previous_interaction_id. - הסרת תפניות של מודל שמולאו מראש.
- הוספנו אפשרות לתקנן שיחות רב-שלביות בצד השרת
- ביקורת של הפעלת פונקציות:
- ממקמים נכסים מולטימודאליים בתוך מטען הייעודי (payload) של התגובה.
- מעצבים את ההוראות בתוך השורה באמצעות
\n\n. - אם מופיעות שגיאות
Malformed_Function_Callשקשורות לטקסט שמופיע לפני הכלי, אפשר לעיין במאמר פתרונות עקיפים לדרישות לגבי טקסט שמופיע לפני הכלי. - רק אם משתמשים ב-generateContent API: מוודאים שכל האובייקטים
FunctionResponseכוללים אתcall_idו-name.
- הדרישות הבסיסיות של Gemini 3: למידע על עדכוני SDK ועל שמירת חתימת המחשבה, אפשר לעיין ברשימת המשימות למיגרציה של Gemini 3.5.
תמחור
עד 31 בדצמבר 2026, תוכלו ליהנות ממחירי מבצע לשימוש ב-Gemini 3.8 Flash, Gemini 3.7 Flash ו-Gemini 3.6 Flash ב-Google AI Studio וב-Gemini Enterprise Agent Platform. המחירים הרגילים ייכנסו לתוקף ב-1 בינואר 2027. למידע על רמות התמחור המלאות, אפשר לעיין בדף המחירון.
השלבים הבאים
- אפשר לעיין במפרט ה-API בסקירה הכללית של המודלים.
- בסקירה הכללית על Interactions API מוסבר על תזמור של כמה סוכנים.
- בודקים ומעדנים את הפרומפטים ב-Google AI Studio.