ویژگی‌های جدید Gemini 3.8 Flash

جدیدترین مدل مدل‌های دیگر

‫Gemini 3.8 Flash (gemini-3.8-flash) هوشمندترین مدل Flash ما است که برای مهندسی نرم‌افزار بلندمدت، عامل‌های خودکار، و گردش‌های کار پیچیده سازمانی طراحی شده است.

این راهنما ویژگی‌های جدید Gemini 3.8 Flash، تغییرات API، نمونه‌های کد، و راهنمای انتقال را توضیح می‌دهد.

مدل جدید

مدل شناسه مدل سطح پیش‌فرض «اندیشگر» قیمت‌گذاری شرح
Gemini 3.8 Flash gemini-3.8-flash medium ‫3.8 Flash تا پایان سال با قیمت آغازین ۰٫۷۵ دلار برای هر ۱ میلیون کد ورودی و ۳٫۷۵ دلار برای هر ۱ میلیون کد خروجی دردسترس است؛ برای جزئیات بیشتر، قیمت‌گذاری را ببینید. هوشمندترین مدل Flash ما که برای مهندسی نرم‌افزار بلندمدت، عامل‌های خودکار، و گردش‌های کار پیچیده سازمانی طراحی شده است.

‫Gemini 3.8 Flash از پنجره زمینه‌ای ۱ میلیون داده‌واحد (توکن)، حداکثر ۶۴ هزار داده‌واحد (توکن) خروجی، سطوح تفکر قابل‌تنظیم (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);

جاوا

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(""));

رفتن

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)
    }
}

استراحت

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 با نرخ مقدماتی ۰٫۷۵ دلار برای ۱ میلیون کد ورودی و ۳٫۷۵ دلار برای ۱ میلیون کد خروجی تا ۳۱ دسامبر ۲۰۲۶ دردسترس است. قیمت‌گذاری استاندارد ۱٫۵۰ دلار به‌ازای هر ۱ میلیون داده‌واحد ورودی و ۷٫۵۰ دلار به‌ازای هر ۱ میلیون داده‌واحد خروجی از ۱ ژانویه ۲۰۲۷ اعمال می‌شود.

‫Gemini 3.8 Flash به‌طور پیش‌فرض می‌تواند از نشانه‌های بیشتری برای کارهای طولانی‌تر و پیچیده‌تر استفاده کند. برای ارائه نتایج با کیفیت بالاتر در اهداف دشوار و چند مرحله‌ای، این مدل مراحل استدلال کوچک‌تری را طی می‌کند، ابزارها را به‌صورت تکراری فرا می‌خواند، و کار خود را درطول مسیر تأیید می‌کند. همه گردش‌های کاری به این سطح از درستی‌سنجی نیاز ندارند. برای تکالیف روزمره، می‌توانید تلاش استدلال را کاهش دهید تا مصرف نمانه کمتر شود. یا اینکه Gemini 3.6 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);

جاوا

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(""));

رفتن

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» اکنون به‌طور پیش‌فرض با 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);

جاوا

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(""));

رفتن

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 تغییر دهید.
  • پیکربندی سطح تفکر: thinking_budget را با رشته شمارشی thinking_level جایگزین کنید. توجه داشته باشید که minimal در Gemini 3.8 Flash پشتیبانی نمی‌شود؛ low، medium (پیش‌فرض)، یا high را انتخاب کنید.
  • اعمال تغییرات پارامتر Gemini 3 API: پارامترهای نمونه‌گیری منسوخ‌شده (temperature، top_p، top_k)، candidate_count (در Gemini 3 و نسخه‌های بعدی پشتیبانی نمی‌شود)، و نوبت‌های مدل ازپیش تکمیل‌شده را بردارید. تغییرات Gemini 3.6 API و به‌روزرسانی‌های پارامتر را ببینید.
  • اجرای قوانین اعتبارسنجی نوبت: مکالمه‌های چندنوبتی را در سمت سرور previous_interaction_id استاندارد کنید و نوبت‌های ازپیش تکمیل‌شده مدل را بردارید.
  • ممیزی فراخوانی تابع:
    • دارایی‌های چندوجهی را در محتوای پاسخ قرار دهید.
    • دستورالعمل‌های درون‌خطی را بااستفاده از \n\n قالب‌بندی کن.
    • اگر خطاهای Malformed_Function_Call مربوط به نوشتار پیش‌ابزار را می‌بینید، به راه‌حل‌های جایگزین برای الزامات نوشتار پیش‌ابزار مراجعه کنید.
    • فقط درصورت استفاده از API generateContent: مطمئن شوید همه FunctionResponse اشیا شامل call_id و name باشند.
  • الزامات پایه Gemini 3: برای به‌روزرسانی‌های «کیت توسعه نرم‌افزار» و حفظ امضای اندیشه، امضاهای اندیشه را ببینید.

قیمت‌گذاری

تا ۳۱ دسامبر ۲۰۲۶، از قیمت آغازین در Google AI Studio و Gemini Enterprise Agent Platform برای Gemini 3.8 Flash و Gemini 3.6 Flash بهره‌مند شوید. قیمت استاندارد از ۱ ژانویه ۲۰۲۷ اعمال می‌شود. برای مشاهده سطوح قیمت‌گذاری کامل، به صفحه قیمت‌گذاری مراجعه کنید.

مدل‌های دیگر

قدم بعدی چیست