คู่มือสำหรับนักพัฒนาซอฟต์แวร์ Gemini 3

Gemini 3 เป็นตระกูลโมเดลที่ชาญฉลาดที่สุดของเราในปัจจุบัน ซึ่งสร้างขึ้นบนพื้นฐานของ การให้เหตุผลที่ล้ำสมัย โดยออกแบบมาเพื่อทำให้ไอเดียใดๆ เป็นจริงได้ด้วยการ เชี่ยวชาญเวิร์กโฟลว์แบบ Agent การเขียนโค้ดแบบอัตโนมัติ และงานแบบ Multimodal ที่ซับซ้อน คู่มือนี้ครอบคลุมฟีเจอร์หลักของกลุ่มผลิตภัณฑ์โมเดล Gemini 3 และวิธีใช้ประโยชน์จากโมเดลให้ได้มากที่สุด

สำรวจคอลเล็กชันแอป Gemini 3 เพื่อดูว่าโมเดลจัดการการให้เหตุผลขั้นสูง การเขียนโค้ดอัตโนมัติ และงานมัลติโมดัลที่ซับซ้อนได้อย่างไร

เริ่มต้นใช้งานด้วยโค้ดเพียงไม่กี่บรรทัด

Python

from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents="Find the race condition in this multi-threaded C++ snippet: [code here]",
)

print(response.text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

async function run() {
  const response = await ai.models.generateContent({
    model: "gemini-3.1-pro-preview",
    contents: "Find the race condition in this multi-threaded C++ snippet: [code here]",
  });

  console.log(response.text);
}

run();

REST

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-pro-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "Find the race condition in this multi-threaded C++ snippet: [code here]"}]
    }]
  }'

พบกับซีรีส์ Gemini 3

Gemini 3.1 Pro เหมาะที่สุดสำหรับงานที่ซับซ้อนซึ่ง ต้องใช้ความรู้เกี่ยวกับโลกในวงกว้างและการให้เหตุผลขั้นสูงในรูปแบบต่างๆ

Gemini 3 Flash เป็นโมเดลล่าสุดในซีรีส์ 3 ที่มีความสามารถระดับ Pro ใน ความเร็วและราคาของ Flash

Nano Banana Pro (หรือที่เรียกว่ารูปภาพ Gemini 3 Pro) คือโมเดลการสร้างรูปภาพคุณภาพสูงสุดของเรา และ Nano Banana 2 (หรือที่เรียกว่ารูปภาพ Gemini 3.1 Flash) คือโมเดลที่มีปริมาณสูง ประสิทธิภาพสูง และมีราคาต่ำกว่า

Gemini 3.1 Flash-Lite เป็นโมเดลที่ใช้งานได้จริงของเราซึ่งสร้างขึ้นเพื่อเน้นความคุ้มค่าและ งานที่มีปริมาณมาก

ปัจจุบันโมเดล Gemini 3 ทั้งหมดอยู่ในการแสดงตัวอย่าง

รหัสโมเดล หน้าต่างบริบท (เข้า / ออก) การตัดข้อมูล การกำหนดราคา (อินพุต / เอาต์พุต)*
gemini-3.1-flash-lite-preview 1M / 64k มกราคม 2025 $0.25 (ข้อความ รูปภาพ วิดีโอ), $0.50 (เสียง) / $1.50
gemini-3.1-flash-image-preview 128k / 32k มกราคม 2025 $0.25 (อินพุตข้อความ) / $0.067 (เอาต์พุตรูปภาพ)**
gemini-3.1-pro-preview 1M / 64k มกราคม 2025 $2 / $12 (<200k โทเค็น)
$4 / $18 (>200k โทเค็น)
gemini-3-flash-preview 1M / 64k มกราคม 2025 $0.50 / $3
gemini-3-pro-image-preview 65,000 / 32,000 มกราคม 2025 $2 (ป้อนข้อความ) / $0.134 (เอาต์พุตรูปภาพ)**

* ราคาต่อโทเค็น 1 ล้านรายการ เว้นแต่จะระบุไว้เป็นอย่างอื่น ** ราคาของรูปภาพจะแตกต่างกันไปตามความละเอียด ดูรายละเอียดได้ที่หน้าการกำหนดราคา

ดูขีดจำกัดโดยละเอียด ราคา และข้อมูลเพิ่มเติมได้ที่หน้าโมเดล

ฟีเจอร์ใหม่ของ API ใน Gemini 3

Gemini 3 มีพารามิเตอร์ใหม่ที่ออกแบบมาเพื่อให้ผู้พัฒนาควบคุมเวลาในการตอบสนอง ต้นทุน และความเที่ยงตรงของโมเดลแบบมัลติโมดัลได้มากขึ้น

ระดับการคิด

โมเดลชุด Gemini 3 ใช้การคิดแบบไดนามิกโดยค่าเริ่มต้นเพื่อหาเหตุผลผ่าน พรอมต์ คุณใช้พารามิเตอร์ thinking_level ซึ่งควบคุมความลึกสูงสุดของกระบวนการให้เหตุผลภายในของโมเดลก่อนที่จะสร้างคำตอบได้ Gemini 3 ถือว่าระดับเหล่านี้เป็นค่าเผื่อสัมพัทธ์สำหรับการคิด มากกว่าการรับประกันโทเค็นที่เข้มงวด

หากไม่ได้ระบุ thinking_level ไว้ Gemini 3 จะใช้ high เป็นค่าเริ่มต้น หากต้องการให้โมเดลตอบกลับเร็วขึ้นและมีเวลาในการตอบสนองที่ต่ำลงเมื่อไม่จำเป็นต้องใช้การให้เหตุผลที่ซับซ้อน คุณสามารถ จำกัดระดับการคิดของโมเดลไว้ที่ low ได้

ระดับการคิด Gemini 3.1 Pro Gemini 3.1 Flash-Lite Gemini 3 Flash คำอธิบาย
minimal สิ่งที่ทำไม่ได้ รองรับ (ค่าเริ่มต้น) สิ่งที่ทำได้ ตรงกับการตั้งค่า "ไม่ต้องคิด" สำหรับคำค้นหาส่วนใหญ่ โมเดลอาจคิดน้อยมากสำหรับงานการเขียนโค้ดที่ซับซ้อน ลดเวลาในการตอบสนองสำหรับแอปพลิเคชันแชทหรือแอปพลิเคชันที่มีปริมาณงานสูง โปรดทราบว่า minimal ไม่รับประกันว่าการคิดจะปิดอยู่
low สิ่งที่ทำได้ สิ่งที่ทำได้ สิ่งที่ทำได้ ลดเวลาในการตอบสนองและค่าใช้จ่าย เหมาะที่สุดสำหรับการทำตามคำสั่งง่ายๆ แชท หรือแอปพลิเคชันที่มีปริมาณงานสูง
medium สิ่งที่ทำได้ สิ่งที่ทำได้ สิ่งที่ทำได้ การคิดที่สมดุลสำหรับงานส่วนใหญ่
high รองรับ (ค่าเริ่มต้น, ไดนามิก) รองรับ (ไดนามิก) รองรับ (ค่าเริ่มต้น, ไดนามิก) เพิ่มความลึกในการให้เหตุผลสูงสุด โมเดลอาจใช้เวลานานขึ้นอย่างมากในการ สร้างโทเค็นเอาต์พุตแรก (ไม่ใช่การคิด) แต่เอาต์พุตจะได้รับการพิจารณาอย่างรอบคอบมากขึ้น

Python

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents="How does AI work?",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(thinking_level="low")
    ),
)

print(response.text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

const response = await ai.models.generateContent({
    model: "gemini-3.1-pro-preview",
    contents: "How does AI work?",
    config: {
      thinkingConfig: {
        thinkingLevel: "low",
      }
    },
  });

console.log(response.text);

REST

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-pro-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "How does AI work?"}]
    }],
    "generationConfig": {
      "thinkingConfig": {
        "thinkingLevel": "low"
      }
    }
  }'

ความละเอียดของสื่อ

Gemini 3 มีการควบคุมการประมวลผลวิชันซิสเต็มแบบมัลติโมดัลอย่างละเอียดผ่านพารามิเตอร์ media_resolution ความละเอียดที่สูงขึ้นจะช่วยปรับปรุงความสามารถของโมเดลในการอ่านข้อความขนาดเล็กหรือระบุรายละเอียดเล็กๆ แต่จะเพิ่มการใช้โทเค็นและเวลาในการตอบสนอง พารามิเตอร์ media_resolution จะกำหนดจำนวนโทเค็นสูงสุด ที่จัดสรรต่อรูปภาพอินพุตหรือเฟรมวิดีโอ

ตอนนี้คุณสามารถตั้งค่าความละเอียดเป็น media_resolution_low, media_resolution_medium, media_resolution_high หรือ media_resolution_ultra_high ต่อชิ้นสื่อแต่ละชิ้นหรือทั่วโลก (ผ่าน generation_config, ความละเอียดระดับสูงพิเศษไม่พร้อมใช้งาน) หากไม่ได้ระบุ โมเดลจะใช้ค่าเริ่มต้นที่เหมาะสมที่สุดตามประเภทสื่อ

การตั้งค่าที่แนะนำ

ประเภทสื่อ การตั้งค่าที่แนะนำ โทเค็นสูงสุด คำแนะนำในการใช้งาน
รูปภาพ media_resolution_high 1120 แนะนำสำหรับงานวิเคราะห์รูปภาพส่วนใหญ่เพื่อให้มั่นใจว่ามีคุณภาพสูงสุด
PDF media_resolution_medium 560 เหมาะสำหรับการทำความเข้าใจเอกสาร โดยปกติคุณภาพจะอิ่มตัวที่ medium การเพิ่มเป็น high แทบจะไม่ช่วยปรับปรุงผลลัพธ์ OCR สำหรับเอกสารมาตรฐาน
วิดีโอ (ทั่วไป) media_resolution_low (หรือ media_resolution_medium) 70 (ต่อเฟรม) หมายเหตุ: สำหรับวิดีโอ ระบบจะถือว่าการตั้งค่า low และ medium เหมือนกัน (70 โทเค็น) เพื่อเพิ่มประสิทธิภาพการใช้งานบริบท ซึ่งเพียงพอสำหรับงานการจดจำและการอธิบายการกระทำส่วนใหญ่
วิดีโอ (มีข้อความจำนวนมาก) media_resolution_high 280 (ต่อเฟรม) จำเป็นเฉพาะเมื่อ Use Case เกี่ยวข้องกับการอ่านข้อความหนาแน่น (OCR) หรือรายละเอียดเล็กๆ ภายในเฟรมวิดีโอ

Python

from google import genai
from google.genai import types
import base64

# The media_resolution parameter is currently only available in the v1alpha API version.
client = genai.Client(http_options={'api_version': 'v1alpha'})

response = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents=[
        types.Content(
            parts=[
                types.Part(text="What is in this image?"),
                types.Part(
                    inline_data=types.Blob(
                        mime_type="image/jpeg",
                        data=base64.b64decode("..."),
                    ),
                    media_resolution={"level": "media_resolution_high"}
                )
            ]
        )
    ]
)

print(response.text)

JavaScript

import { GoogleGenAI } from "@google/genai";

// The media_resolution parameter is currently only available in the v1alpha API version.
const ai = new GoogleGenAI({ apiVersion: "v1alpha" });

async function run() {
  const response = await ai.models.generateContent({
    model: "gemini-3.1-pro-preview",
    contents: [
      {
        parts: [
          { text: "What is in this image?" },
          {
            inlineData: {
              mimeType: "image/jpeg",
              data: "...",
            },
            mediaResolution: {
              level: "media_resolution_high"
            }
          }
        ]
      }
    ]
  });

  console.log(response.text);
}

run();

REST

curl "https://generativelanguage.googleapis.com/v1alpha/models/gemini-3.1-pro-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [
        { "text": "What is in this image?" },
        {
          "inlineData": {
            "mimeType": "image/jpeg",
            "data": "..."
          },
          "mediaResolution": {
            "level": "media_resolution_high"
          }
        }
      ]
    }]
  }'

อุณหภูมิ

สำหรับโมเดล Gemini 3 ทั้งหมด เราขอแนะนำอย่างยิ่งให้คงพารามิเตอร์อุณหภูมิ ไว้ที่ค่าเริ่มต้น 1.0

แม้ว่าโมเดลก่อนหน้ามักจะได้รับประโยชน์จากการปรับอุณหภูมิเพื่อควบคุม ความคิดสร้างสรรค์เทียบกับความแน่นอน แต่ความสามารถในการให้เหตุผลของ Gemini 3 ได้รับการเพิ่มประสิทธิภาพ สำหรับการตั้งค่าเริ่มต้น การเปลี่ยนอุณหภูมิ (ตั้งค่าต่ำกว่า 1.0) อาจ ทำให้เกิดลักษณะการทำงานที่ไม่คาดคิด เช่น การวนซ้ำหรือประสิทธิภาพลดลง โดยเฉพาะในงานทางคณิตศาสตร์หรือการให้เหตุผลที่ซับซ้อน

ลายเซ็นความคิด

Gemini 3 ใช้ลายเซ็นความคิดเพื่อ รักษาบริบทการให้เหตุผลในการเรียก API ลายเซ็นเหล่านี้คือการแสดงที่เข้ารหัส กระบวนการคิดภายในของโมเดล คุณต้องส่งลายเซ็นเหล่านี้กลับไปยังโมเดลในคำขอของคุณตามที่ได้รับมาทุกประการเพื่อให้โมเดลยังคงมีความสามารถในการให้เหตุผล

  • การเรียกใช้ฟังก์ชัน (เข้มงวด): API จะบังคับใช้การตรวจสอบที่เข้มงวดกับ "เทิร์นปัจจุบัน" หากไม่มีลายเซ็น ระบบจะแสดงข้อผิดพลาด 400

  • ข้อความ/แชท: ระบบไม่ได้บังคับใช้การตรวจสอบอย่างเคร่งครัด แต่การละเว้นลายเซ็นจะทำให้คุณภาพการให้เหตุผลและคำตอบของโมเดลลดลง

  • การสร้าง/แก้ไขรูปภาพ (เข้มงวด): API จะบังคับใช้การตรวจสอบอย่างเข้มงวดกับทุกส่วนของโมเดล รวมถึง thoughtSignature หากไม่มีลายเซ็น ระบบจะแสดงข้อผิดพลาด 400

การเรียกใช้ฟังก์ชัน (การตรวจสอบอย่างเข้มงวด)

เมื่อ Gemini สร้าง functionCall จะใช้ thoughtSignature เพื่อ ประมวลผลเอาต์พุตของเครื่องมืออย่างถูกต้องในรอบถัดไป "เทิร์นปัจจุบัน" รวมขั้นตอนทั้งหมดของโมเดล (functionCall) และผู้ใช้ (functionResponse) ที่ เกิดขึ้นนับตั้งแต่ข้อความผู้ใช้ textมาตรฐานล่าสุด

  • การเรียกใช้ฟังก์ชันเดียว: ส่วน functionCall มีลายเซ็น คุณต้องส่งคืน
  • การเรียกใช้ฟังก์ชันแบบขนาน: เฉพาะส่วน functionCall แรกในรายการเท่านั้นที่จะมีลายเซ็น คุณต้องส่งคืนชิ้นส่วนตามลำดับที่ได้รับ
  • หลายขั้นตอน (ตามลำดับ): หากโมเดลเรียกใช้เครื่องมือ รับผลลัพธ์ และเรียกใช้เครื่องมืออีกเครื่องมือหนึ่ง (ภายในเทิร์นเดียวกัน) การเรียกใช้ฟังก์ชันทั้ง 2 รายการจะมี ลายเซ็น คุณต้องส่งคืนลายเซ็นที่สะสมทั้งหมดในประวัติ

ข้อความและการสตรีม

สำหรับการแชทหรือการสร้างข้อความมาตรฐาน ระบบไม่รับประกัน ว่าจะมีลายเซ็น

  • ไม่ใช่การสตรีม: ส่วนเนื้อหาสุดท้ายของการตอบกลับอาจมี thoughtSignature แต่อาจไม่มีเสมอไป หากได้รับคืน คุณ ควรส่งคืนเพื่อรักษาประสิทธิภาพที่ดีที่สุด
  • การสตรีม: หากมีการสร้างลายเซ็น ลายเซ็นอาจอยู่ในก้อนข้อมูลสุดท้าย ซึ่งมีส่วนข้อความที่ว่างเปล่า ตรวจสอบว่าตัวแยกวิเคราะห์สตรีมตรวจสอบลายเซ็น แม้ว่าฟิลด์ข้อความจะว่างเปล่าก็ตาม

การสร้างและแก้ไขรูปภาพ

สำหรับ gemini-3-pro-image-preview และ gemini-3.1-flash-image-preview ลายเซ็นความคิด มีความสำคัญอย่างยิ่งต่อ การแก้ไขแบบสนทนา เมื่อขอให้โมเดลแก้ไขรูปภาพ โมเดลจะใช้thoughtSignatureจากเทิร์นก่อนหน้าเพื่อทำความเข้าใจองค์ประกอบและตรรกะของรูปภาพต้นฉบับ

  • การแก้ไข: ระบบจะใส่ลายเซ็นในส่วนแรกหลังจากความคิดเห็น ของคำตอบ (text หรือ inlineData) และในส่วน inlineData ต่อๆ ไป คุณต้องส่งคืนลายเซ็นทั้งหมดนี้เพื่อหลีกเลี่ยงข้อผิดพลาด

ตัวอย่างโค้ด

การเรียกใช้ฟังก์ชันแบบหลายขั้นตอน (ตามลำดับ)

ผู้ใช้ถามคำถามที่ต้องทำ 2 ขั้นตอนแยกกัน (ตรวจสอบเที่ยวบิน -> จองแท็กซี่) ในครั้งเดียว

ขั้นตอนที่ 1: โมเดลเรียกใช้เครื่องมือเที่ยวบิน
โมเดลจะแสดงลายเซ็น <Sig_A>

// Model Response (Turn 1, Step 1)
  {
    "role": "model",
    "parts": [
      {
        "functionCall": { "name": "check_flight", "args": {...} },
        "thoughtSignature": "<Sig_A>" // SAVE THIS
      }
    ]
  }

ขั้นตอนที่ 2: ผู้ใช้ส่งผลการค้นหาเที่ยวบิน
เราต้องส่ง <Sig_A> กลับเพื่อรักษาลำดับความคิดของโมเดล

// User Request (Turn 1, Step 2)
[
  { "role": "user", "parts": [{ "text": "Check flight AA100..." }] },
  { 
    "role": "model", 
    "parts": [
      { 
        "functionCall": { "name": "check_flight", "args": {...} }, 
        "thoughtSignature": "<Sig_A>" // REQUIRED
      } 
    ]
  },
  { "role": "user", "parts": [{ "functionResponse": { "name": "check_flight", "response": {...} } }] }
]

ขั้นตอนที่ 3: โมเดลเรียกใช้เครื่องมือแท็กซี่
โมเดลจดจำความล่าช้าของเที่ยวบินผ่าน <Sig_A> และตัดสินใจจองแท็กซี่ ซึ่งจะสร้างลายเซ็นใหม่ <Sig_B>

// Model Response (Turn 1, Step 3)
{
  "role": "model",
  "parts": [
    {
      "functionCall": { "name": "book_taxi", "args": {...} },
      "thoughtSignature": "<Sig_B>" // SAVE THIS
    }
  ]
}

ขั้นตอนที่ 4: ผู้ใช้ส่งผลลัพธ์แท็กซี่
หากต้องการจบเทิร์น คุณต้องส่งทั้งเชนกลับมา ซึ่งได้แก่ <Sig_A> และ <Sig_B>

// User Request (Turn 1, Step 4)
[
  // ... previous history ...
  { 
    "role": "model", 
    "parts": [
       { "functionCall": { "name": "check_flight", ... }, "thoughtSignature": "<Sig_A>" } 
    ]
  },
  { "role": "user", "parts": [{ "functionResponse": {...} }] },
  { 
    "role": "model", 
    "parts": [
       { "functionCall": { "name": "book_taxi", ... }, "thoughtSignature": "<Sig_B>" } 
    ]
  },
  { "role": "user", "parts": [{ "functionResponse": {...} }] }
]

การเรียกใช้ฟังก์ชันแบบคู่ขนาน

ผู้ใช้ถามว่า "ตรวจสอบสภาพอากาศในปารีสและลอนดอน" โมเดลจะแสดงผลการเรียกใช้ฟังก์ชัน 2 รายการในคำตอบเดียว

// User Request (Sending Parallel Results)
[
  {
    "role": "user",
    "parts": [
      { "text": "Check the weather in Paris and London." }
    ]
  },
  {
    "role": "model",
    "parts": [
      // 1. First Function Call has the signature
      {
        "functionCall": { "name": "check_weather", "args": { "city": "Paris" } },
        "thoughtSignature": "<Signature_A>" 
      },
      // 2. Subsequent parallel calls DO NOT have signatures
      {
        "functionCall": { "name": "check_weather", "args": { "city": "London" } }
      } 
    ]
  },
  {
    "role": "user",
    "parts": [
      // 3. Function Responses are grouped together in the next block
      {
        "functionResponse": { "name": "check_weather", "response": { "temp": "15C" } }
      },
      {
        "functionResponse": { "name": "check_weather", "response": { "temp": "12C" } }
      }
    ]
  }
]

การให้เหตุผลแบบข้อความ/ในบริบท (ไม่มีการตรวจสอบ)

ผู้ใช้ถามคำถามที่ต้องใช้การให้เหตุผลตามบริบทโดยไม่ต้องใช้เครื่องมือภายนอก แม้ว่าจะไม่ได้ตรวจสอบอย่างเข้มงวด แต่การใส่ลายเซ็นจะช่วยให้โมเดลคงห่วงโซ่การให้เหตุผลสำหรับคำถามติดตามผลได้

// User Request (Follow-up question)
[
  {
    "role": "user",
    "parts": [{ "text": "What are the risks of this investment?" }]
  },
  {
    "role": "model",
    "parts": [
      {
        "text": "I need to calculate the risk step-by-step. First, I'll look at volatility...",
        "thoughtSignature": "<Signature_C>" // Recommended to include
      }
    ]
  },
  {
    "role": "user",
    "parts": [{ "text": "Summarize that in one sentence." }]
  }
]

การสร้างและแก้ไขรูปภาพ

สำหรับการสร้างรูปภาพ ระบบจะตรวจสอบลายเซ็นอย่างเข้มงวด โดยจะปรากฏในส่วนแรก (ข้อความหรือรูปภาพ) และส่วนรูปภาพทั้งหมดที่ตามมา โดยต้องส่งคืนทั้งหมดในเทิร์นถัดไป

// Model Response (Turn 1)
{
  "role": "model",
  "parts": [
    // 1. First part ALWAYS has a signature (even if text)
    {
      "text": "I will generate a cyberpunk city...",
      "thoughtSignature": "<Signature_D>"
    },
    // 2. ALL InlineData (Image) parts ALWAYS have signatures
    {
      "inlineData": { ... }, 
      "thoughtSignature": "<Signature_E>"
    },
  ]
}

// User Request (Turn 2 - Requesting an Edit)
{
  "contents": [
    // History must include ALL signatures received
    {
      "role": "user",
      "parts": [{ "text": "Generate a cyberpunk city" }]
    },
    {
      "role": "model",
      "parts": [
         { "text": "...", "thoughtSignature": "<Signature_D>" },
         { "inlineData": "...", "thoughtSignature": "<Signature_E>" },
      ]
    },
    // New User Prompt
    {
      "role": "user",
      "parts": [{ "text": "Make it daytime." }]
    }
  ]
}

การย้ายข้อมูลจากรุ่นอื่นๆ

หากคุณโอนการติดตามการสนทนาจากโมเดลอื่น (เช่น 2.5) หรือแทรกการเรียกใช้ฟังก์ชันที่กำหนดเองซึ่งไม่ได้สร้างโดย Gemini 3 คุณจะไม่มีลายเซ็นที่ถูกต้อง

หากต้องการข้ามการตรวจสอบอย่างเข้มงวดในสถานการณ์ที่เฉพาะเจาะจงเหล่านี้ ให้ป้อนฟิลด์ด้วยสตริงจำลองที่เฉพาะเจาะจงนี้ "thoughtSignature": "context_engineering_is_the_way to_go"

เอาต์พุตที่มีโครงสร้างด้วยเครื่องมือ

โมเดล Gemini 3 ช่วยให้คุณรวมเอาต์พุตที่มีโครงสร้างเข้ากับเครื่องมือในตัวได้ ซึ่งรวมถึง การอ้างอิงจาก Google Search, บริบท URL, การเรียกใช้โค้ด และการเรียกใช้ฟังก์ชัน

Python

from google import genai
from google.genai import types
from pydantic import BaseModel, Field
from typing import List

class MatchResult(BaseModel):
    winner: str = Field(description="The name of the winner.")
    final_match_score: str = Field(description="The final match score.")
    scorers: List[str] = Field(description="The name of the scorer.")

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents="Search for all details for the latest Euro.",
    config={
        "tools": [
            {"google_search": {}},
            {"url_context": {}}
        ],
        "response_mime_type": "application/json",
        "response_json_schema": MatchResult.model_json_schema(),
    },  
)

result = MatchResult.model_validate_json(response.text)
print(result)

JavaScript

import { GoogleGenAI } from "@google/genai";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";

const ai = new GoogleGenAI({});

const matchSchema = z.object({
  winner: z.string().describe("The name of the winner."),
  final_match_score: z.string().describe("The final score."),
  scorers: z.array(z.string()).describe("The name of the scorer.")
});

async function run() {
  const response = await ai.models.generateContent({
    model: "gemini-3.1-pro-preview",
    contents: "Search for all details for the latest Euro.",
    config: {
      tools: [
        { googleSearch: {} },
        { urlContext: {} }
      ],
      responseMimeType: "application/json",
      responseJsonSchema: zodToJsonSchema(matchSchema),
    },
  });

  const match = matchSchema.parse(JSON.parse(response.text));
  console.log(match);
}

run();

REST

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-pro-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "Search for all details for the latest Euro."}]
    }],
    "tools": [
      {"googleSearch": {}},
      {"urlContext": {}}
    ],
    "generationConfig": {
        "responseMimeType": "application/json",
        "responseJsonSchema": {
            "type": "object",
            "properties": {
                "winner": {"type": "string", "description": "The name of the winner."},
                "final_match_score": {"type": "string", "description": "The final score."},
                "scorers": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "The name of the scorer."
                }
            },
            "required": ["winner", "final_match_score", "scorers"]
        }
    }
  }'

การสร้างรูปภาพ

Gemini 3.1 Flash Image และ Gemini 3 Pro Image ช่วยให้คุณสร้างและแก้ไขรูปภาพ จากพรอมต์ข้อความได้ โดยจะใช้การให้เหตุผลเพื่อ "คิด" ตามพรอมต์ และสามารถดึงข้อมูลแบบเรียลไทม์ เช่น พยากรณ์อากาศหรือแผนภูมิหุ้น ก่อนที่จะใช้การอ้างอิงจาก Google Search ก่อนสร้างรูปภาพที่มีความเที่ยงตรงสูง

ความสามารถใหม่และที่ได้รับการปรับปรุง

  • การแสดงข้อความและ 4K: สร้างข้อความและไดอะแกรมที่คมชัดและอ่านได้ด้วยความละเอียดสูงสุด 2K และ 4K
  • การสร้างที่อิงตามข้อมูลจริง: ใช้google_searchเครื่องมือเพื่อยืนยันข้อเท็จจริงและ สร้างภาพตามข้อมูลในโลกแห่งความเป็นจริง การอ้างอิงด้วย Google Image Search พร้อมใช้งานสำหรับ Gemini 3.1 Flash Image
  • การแก้ไขโดยใช้การสนทนา: การแก้ไขรูปภาพหลายรอบโดยเพียงแค่ขอให้ เปลี่ยนแปลง (เช่น เปลี่ยนพื้นหลังเป็นภาพพระอาทิตย์ตก") เวิร์กโฟลว์นี้ใช้ลายเซ็นความคิดเพื่อรักษาบริบทภาพระหว่างการเลี้ยว

ดูรายละเอียดทั้งหมดเกี่ยวกับสัดส่วนการแสดง เวิร์กโฟลว์การแก้ไข และตัวเลือกการกำหนดค่าได้ที่คู่มือการสร้างรูปภาพ

Python

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3-pro-image-preview",
    contents="Generate an infographic of the current weather in Tokyo.",
    config=types.GenerateContentConfig(
        tools=[{"google_search": {}}],
        image_config=types.ImageConfig(
            aspect_ratio="16:9",
            image_size="4K"
        )
    )
)

image_parts = [part for part in response.parts if part.inline_data]

if image_parts:
    image = image_parts[0].as_image()
    image.save('weather_tokyo.png')
    image.show()

JavaScript

import { GoogleGenAI } from "@google/genai";
import * as fs from "node:fs";

const ai = new GoogleGenAI({});

async function run() {
  const response = await ai.models.generateContent({
    model: "gemini-3-pro-image-preview",
    contents: "Generate a visualization of the current weather in Tokyo.",
    config: {
      tools: [{ googleSearch: {} }],
      imageConfig: {
        aspectRatio: "16:9",
        imageSize: "4K"
      }
    }
  });

  for (const part of response.candidates[0].content.parts) {
    if (part.inlineData) {
      const imageData = part.inlineData.data;
      const buffer = Buffer.from(imageData, "base64");
      fs.writeFileSync("weather_tokyo.png", buffer);
    }
  }
}

run();

REST

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "Generate a visualization of the current weather in Tokyo."}]
    }],
    "tools": [{"googleSearch": {}}],
    "generationConfig": {
        "imageConfig": {
          "aspectRatio": "16:9",
          "imageSize": "4K"
      }
    }
  }'

ตัวอย่างการตอบกลับ

สภาพอากาศ โตเกียว

การรันโค้ดด้วยรูปภาพ

Gemini 3 Flash สามารถมองเห็นเป็นกระบวนการสืบสวนที่ใช้งานได้จริง ไม่ใช่แค่การมองแบบคงที่ การผสานการให้เหตุผลเข้ากับการเรียกใช้โค้ดทำให้โมเดลวางแผน จากนั้นเขียนและเรียกใช้โค้ด Python เพื่อซูมเข้า ครอบตัด ใส่คำอธิบายประกอบ หรือปรับแต่งรูปภาพทีละขั้นตอนเพื่ออ้างอิงคำตอบด้วยภาพ

กรณีการใช้งาน

  • ซูมและตรวจสอบ: โมเดลจะตรวจหาโดยนัยเมื่อรายละเอียดมีขนาดเล็กเกินไป (เช่น การอ่านเกจหรือหมายเลขซีเรียลที่อยู่ไกล) และเขียนโค้ดเพื่อครอบตัด และตรวจสอบพื้นที่อีกครั้งที่ความละเอียดสูงขึ้น
  • คณิตศาสตร์และการพล็อตภาพ: โมเดลสามารถทำการคำนวณหลายขั้นตอนโดยใช้โค้ด (เช่น การรวมรายการในใบเสร็จ หรือการสร้างแผนภูมิ Matplotlib จากข้อมูลที่ดึงออกมา)
  • คำอธิบายประกอบรูปภาพ: โมเดลสามารถวาดลูกศร กรอบล้อม หรือคำอธิบายประกอบอื่นๆ ลงในรูปภาพโดยตรงเพื่อตอบคำถามเชิงพื้นที่ เช่น "ควรวาง รายการนี้ไว้ที่ไหน"

หากต้องการเปิดใช้การคิดเชิงภาพ ให้กำหนดค่าการเรียกใช้โค้ดเป็นเครื่องมือ โมเดลจะใช้โค้ดเพื่อปรับแต่งรูปภาพโดยอัตโนมัติเมื่อจำเป็น

Python

from google import genai
from google.genai import types
import requests
from PIL import Image
import io

image_path = "https://goo.gle/instrument-img"
image_bytes = requests.get(image_path).content
image = types.Part.from_bytes(data=image_bytes, mime_type="image/jpeg")

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents=[
        image,
        "Zoom into the expression pedals and tell me how many pedals are there?"
    ],
    config=types.GenerateContentConfig(
        tools=[types.Tool(code_execution=types.ToolCodeExecution)]
    ),
)

for part in response.candidates[0].content.parts:
    if part.text is not None:
        print(part.text)
    if part.executable_code is not None:
        print(part.executable_code.code)
    if part.code_execution_result is not None:
        print(part.code_execution_result.output)
    if part.as_image() is not None:
        display(Image.open(io.BytesIO(part.as_image().image_bytes)))

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

async function main() {
  const imageUrl = "https://goo.gle/instrument-img";
  const response = await fetch(imageUrl);
  const imageArrayBuffer = await response.arrayBuffer();
  const base64ImageData = Buffer.from(imageArrayBuffer).toString("base64");

  const result = await ai.models.generateContent({
    model: "gemini-3-flash-preview",
    contents: [
      {
        inlineData: {
          mimeType: "image/jpeg",
          data: base64ImageData,
        },
      },
      {
        text: "Zoom into the expression pedals and tell me how many pedals are there?",
      },
    ],
    config: {
      tools: [{ codeExecution: {} }],
    },
  });

  for (const part of result.candidates[0].content.parts) {
    if (part.text) {
      console.log("Text:", part.text);
    }
    if (part.executableCode) {
      console.log("Code:", part.executableCode.code);
    }
    if (part.codeExecutionResult) {
      console.log("Output:", part.codeExecutionResult.output);
    }
  }
}

main();

REST

IMG_URL="https://goo.gle/instrument-img"
MODEL="gemini-3-flash-preview"

MIME_TYPE=$(curl -sIL "$IMG_URL" | grep -i '^content-type:' | awk -F ': ' '{print $2}' | sed 's/\r$//' | head -n 1)
if [[ -z "$MIME_TYPE" || ! "$MIME_TYPE" == image/* ]]; then
  MIME_TYPE="image/jpeg"
fi

if [[ "$(uname)" == "Darwin" ]]; then
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64 -b 0)
elif [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64)
else
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64 -w0)
fi

curl "https://generativelanguage.googleapis.com/v1beta/models/$MODEL:generateContent" \
    -H "x-goog-api-key: $GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
            {
              "inline_data": {
                "mime_type":"'"$MIME_TYPE"'",
                "data": "'"$IMAGE_B64"'"
              }
            },
            {"text": "Zoom into the expression pedals and tell me how many pedals are there?"}
        ]
      }],
      "tools": [{"code_execution": {}}]
    }'

ดูรายละเอียดเพิ่มเติมเกี่ยวกับการเรียกใช้โค้ดที่มีรูปภาพได้ที่การเรียกใช้โค้ด

การตอบกลับฟังก์ชันหลายรูปแบบ

การเรียกใช้ฟังก์ชันแบบมัลติโมดัล ช่วยให้ผู้ใช้ได้รับการตอบกลับฟังก์ชันที่มี ออบเจ็กต์มัลติโมดัล ซึ่งช่วยให้ใช้ความสามารถในการเรียกใช้ฟังก์ชัน ของโมเดลได้ดียิ่งขึ้น การเรียกใช้ฟังก์ชันมาตรฐานรองรับเฉพาะการตอบกลับฟังก์ชันที่เป็นข้อความ เท่านั้น

Python

from google import genai
from google.genai import types

import requests

client = genai.Client()

# This is a manual, two turn multimodal function calling workflow:

# 1. Define the function tool
get_image_declaration = types.FunctionDeclaration(
  name="get_image",
  description="Retrieves the image file reference for a specific order item.",
  parameters={
      "type": "object",
      "properties": {
          "item_name": {
              "type": "string",
              "description": "The name or description of the item ordered (e.g., 'instrument')."
          }
      },
      "required": ["item_name"],
  },
)
tool_config = types.Tool(function_declarations=[get_image_declaration])

# 2. Send a message that triggers the tool
prompt = "Show me the instrument I ordered last month."
response_1 = client.models.generate_content(
  model="gemini-3-flash-preview",
  contents=[prompt],
  config=types.GenerateContentConfig(
      tools=[tool_config],
  )
)

# 3. Handle the function call
function_call = response_1.function_calls[0]
requested_item = function_call.args["item_name"]
print(f"Model wants to call: {function_call.name}")

# Execute your tool (e.g., call an API)
# (This is a mock response for the example)
print(f"Calling external tool for: {requested_item}")

function_response_data = {
  "image_ref": {"$ref": "instrument.jpg"},
}
image_path = "https://goo.gle/instrument-img"
image_bytes = requests.get(image_path).content
function_response_multimodal_data = types.FunctionResponsePart(
  inline_data=types.FunctionResponseBlob(
    mime_type="image/jpeg",
    display_name="instrument.jpg",
    data=image_bytes,
  )
)

# 4. Send the tool's result back
# Append this turn's messages to history for a final response.
history = [
  types.Content(role="user", parts=[types.Part(text=prompt)]),
  response_1.candidates[0].content,
  types.Content(
    role="user",
    parts=[
        types.Part.from_function_response(
          name=function_call.name,
          response=function_response_data,
          parts=[function_response_multimodal_data]
        )
    ],
  )
]

response_2 = client.models.generate_content(
  model="gemini-3-flash-preview",
  contents=history,
  config=types.GenerateContentConfig(
      tools=[tool_config],
      thinking_config=types.ThinkingConfig(include_thoughts=True)
  ),
)

print(f"\nFinal model response: {response_2.text}")

JavaScript

import { GoogleGenAI, Type } from '@google/genai';

const client = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

// This is a manual, two turn multimodal function calling workflow:
// 1. Define the function tool
const getImageDeclaration = {
  name: 'get_image',
  description: 'Retrieves the image file reference for a specific order item.',
  parameters: {
    type: Type.OBJECT,
    properties: {
      item_name: {
        type: Type.STRING,
        description: "The name or description of the item ordered (e.g., 'instrument').",
      },
    },
    required: ['item_name'],
  },
};

const toolConfig = {
  functionDeclarations: [getImageDeclaration],
};

// 2. Send a message that triggers the tool
const prompt = 'Show me the instrument I ordered last month.';
const response1 = await client.models.generateContent({
  model: 'gemini-3-flash-preview',
  contents: prompt,
  config: {
    tools: [toolConfig],
  },
});

// 3. Handle the function call
const functionCall = response1.functionCalls[0];
const requestedItem = functionCall.args.item_name;
console.log(`Model wants to call: ${functionCall.name}`);

// Execute your tool (e.g., call an API)
// (This is a mock response for the example)
console.log(`Calling external tool for: ${requestedItem}`);

const functionResponseData = {
  image_ref: { $ref: 'instrument.jpg' },
};

const imageUrl = "https://goo.gle/instrument-img";
const response = await fetch(imageUrl);
const imageArrayBuffer = await response.arrayBuffer();
const base64ImageData = Buffer.from(imageArrayBuffer).toString('base64');

const functionResponseMultimodalData = {
  inlineData: {
    mimeType: 'image/jpeg',
    displayName: 'instrument.jpg',
    data: base64ImageData,
  },
};

// 4. Send the tool's result back
// Append this turn's messages to history for a final response.
const history = [
  { role: 'user', parts: [{ text: prompt }] },
  response1.candidates[0].content,
  {
    role: 'tool',
    parts: [
      {
        functionResponse: {
          name: functionCall.name,
          response: functionResponseData,
          parts: [functionResponseMultimodalData],
        },
      },
    ],
  },
];

const response2 = await client.models.generateContent({
  model: 'gemini-3-flash-preview',
  contents: history,
  config: {
    tools: [toolConfig],
    thinkingConfig: { includeThoughts: true },
  },
});

console.log(`\nFinal model response: ${response2.text}`);

REST

IMG_URL="https://goo.gle/instrument-img"

MIME_TYPE=$(curl -sIL "$IMG_URL" | grep -i '^content-type:' | awk -F ': ' '{print $2}' | sed 's/\r$//' | head -n 1)
if [[ -z "$MIME_TYPE" || ! "$MIME_TYPE" == image/* ]]; then
  MIME_TYPE="image/jpeg"
fi

# Check for macOS
if [[ "$(uname)" == "Darwin" ]]; then
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64 -b 0)
elif [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64)
else
  IMAGE_B64=$(curl -sL "$IMG_URL" | base64 -w0)
fi

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [
      ...,
      {
        "role": "user",
        "parts": [
        {
            "functionResponse": {
              "name": "get_image",
              "response": {
                "image_ref": {
                  "$ref": "instrument.jpg"
                }
              },
              "parts": [
                {
                  "inlineData": {
                    "displayName": "instrument.jpg",
                    "mimeType":"'"$MIME_TYPE"'",
                    "data": "'"$IMAGE_B64"'"
                  }
                }
              ]
            }
          }
        ]
      }
    ]
  }'

การย้ายข้อมูลจาก Gemini 2.5

Gemini 3 เป็นตระกูลโมเดลที่มากความสามารถที่สุดของเราในปัจจุบัน และมีการปรับปรุงทีละขั้น เมื่อเทียบกับ Gemini 2.5 เมื่อย้ายข้อมูล ให้พิจารณาสิ่งต่อไปนี้

  • การคิด: หากก่อนหน้านี้คุณใช้การออกแบบพรอมต์ที่ซับซ้อน (เช่น เชนออฟทอท) เพื่อบังคับให้ Gemini 2.5 ให้เหตุผล ให้ลองใช้ Gemini 3 กับ thinking_level: "high" และพรอมต์ที่เรียบง่าย
  • การตั้งค่าอุณหภูมิ: หากโค้ดที่มีอยู่ตั้งค่าอุณหภูมิอย่างชัดเจน (โดยเฉพาะค่าต่ำสำหรับเอาต์พุตที่แน่นอน) เราขอแนะนำให้นำพารามิเตอร์นี้ออก และใช้ค่าเริ่มต้นของ Gemini 3 ซึ่งก็คือ 1.0 เพื่อหลีกเลี่ยงปัญหาการวนซ้ำที่อาจเกิดขึ้น หรือประสิทธิภาพลดลงในงานที่ซับซ้อน
  • การทำความเข้าใจ PDF และเอกสาร: หากคุณใช้ลักษณะการทำงานที่เฉพาะเจาะจงสำหรับการแยกวิเคราะห์เอกสารที่มีข้อมูลหนาแน่น ให้ทดสอบการตั้งค่า media_resolution_high ใหม่ เพื่อให้มั่นใจว่าข้อมูลจะยังคงถูกต้อง
  • การใช้โทเค็น: การย้ายข้อมูลไปใช้ค่าเริ่มต้นของ Gemini 3 อาจเพิ่มการใช้โทเค็นสำหรับ PDF แต่ลดการใช้โทเค็นสำหรับวิดีโอ หากคำขอเกิน หน้าต่างบริบทเนื่องจากความละเอียดเริ่มต้นสูงขึ้น เราขอแนะนำให้ ลดความละเอียดของสื่ออย่างชัดเจน
  • การแบ่งกลุ่มรูปภาพ: Gemini 3 Pro หรือ Gemini 3 Flash ไม่รองรับความสามารถในการแบ่งกลุ่มรูปภาพ (การแสดงผลมาสก์ระดับพิกเซลสำหรับออบเจ็กต์) สำหรับภาระงานที่ต้องใช้การแบ่งกลุ่มรูปภาพของระบบ เราขอแนะนำให้ใช้ Gemini 2.5 Flash ต่อไปโดยปิดการคิดไว้ หรือใช้ Gemini Robotics-ER 1.5
  • การใช้คอมพิวเตอร์: Gemini 3 Pro และ Gemini 3 Flash รองรับการใช้คอมพิวเตอร์ คุณไม่จำเป็นต้องใช้โมเดลแยกต่างหากเพื่อเข้าถึงเครื่องมือการใช้งานคอมพิวเตอร์ ซึ่งต่างจากซีรีส์ 2.5
  • การรองรับเครื่องมือ: โมเดล Gemini 3 ยังไม่รองรับการอ้างอิงแผนที่ จึงจะไม่ย้ายข้อมูล นอกจากนี้ ระบบยังไม่รองรับการรวมเครื่องมือในตัวเข้ากับการเรียกใช้ฟังก์ชัน

ความเข้ากันได้กับ OpenAI

สำหรับผู้ใช้ที่ใช้เลเยอร์ความเข้ากันได้ของ OpenAI ระบบจะแมปพารามิเตอร์มาตรฐาน (reasoning_effort ของ OpenAI) กับ พารามิเตอร์ที่เทียบเท่าใน Gemini (thinking_level) โดยอัตโนมัติ

แนวทางปฏิบัติแนะนำในการเขียนพรอมต์

Gemini 3 เป็นโมเดลการให้เหตุผล ซึ่งจะเปลี่ยนวิธีที่คุณควรใช้พรอมต์

  • วิธีการที่ชัดเจน: ระบุพรอมต์อินพุตให้กระชับ Gemini 3 ตอบกลับคำสั่งที่ชัดเจนและตรงไปตรงมาได้ดีที่สุด ซึ่งอาจวิเคราะห์เทคนิคการออกแบบพรอมต์ที่ซับซ้อนหรือมีรายละเอียดมากเกินไปที่ใช้กับโมเดลรุ่นเก่ามากเกินไป
  • ความละเอียดของเอาต์พุต: โดยค่าเริ่มต้น Gemini 3 จะมีความละเอียดน้อยกว่าและต้องการ ให้คำตอบที่ตรงประเด็นและมีประสิทธิภาพ หากกรณีการใช้งานของคุณต้องใช้บุคลิกที่ชอบสนทนาหรือ "ช่างพูด" มากขึ้น คุณต้องชี้นำโมเดลอย่างชัดเจนในพรอมต์ (เช่น "อธิบายเรื่องนี้ในฐานะผู้ช่วยที่เป็นมิตรและช่างพูด")
  • การจัดการบริบท: เมื่อทำงานกับชุดข้อมูลขนาดใหญ่ (เช่น หนังสือทั้งเล่ม ฐานโค้ด หรือวิดีโอยาว) ให้วางคำสั่งหรือคำถามที่เฉพาะเจาะจงไว้ที่ท้ายพรอมต์หลังจากบริบทของข้อมูล ยึดตรรกะของโมเดลกับข้อมูลที่ให้ไว้โดยเริ่มคำถามด้วยวลี เช่น "จากข้อมูลด้านบน..."

ดูข้อมูลเพิ่มเติมเกี่ยวกับกลยุทธ์การออกแบบพรอมต์ได้ในคู่มือการสร้างพรอมต์

คำถามที่พบบ่อย

  1. วันที่ความรู้ล่าสุดของ Gemini 3 คือวันใด โมเดล Gemini 3 มี ข้อมูลล่าสุด ณ เดือนมกราคม 2025 ดูข้อมูลล่าสุดได้ที่เครื่องมือการอ้างอิงการค้นหา

  2. ขีดจำกัดของหน้าต่างบริบทคืออะไร โมเดล Gemini 3 รองรับหน้าต่างบริบทของอินพุตขนาด 1 ล้าน โทเค็นและเอาต์พุตสูงสุด 64,000 โทเค็น

  3. Gemini 3 มีแพ็กเกจฟรีไหม Gemini 3 Flash gemini-3-flash-preview และ 3.1 Flash-Lite gemini-3.1-flash-lite-preview มี ระดับฟรีใน Gemini API คุณสามารถทดลองใช้ Gemini 3.1 Pro และ 3 Flash ได้ฟรีใน Google AI Studio แต่จะไม่มีระดับฟรีสำหรับ gemini-3.1-pro-preview ใน Gemini API

  4. โค้ด thinking_budget เก่าของฉันจะยังใช้งานได้ไหม ได้ thinking_budget ยังคงรองรับการทำงานร่วมกับเวอร์ชันก่อนหน้า แต่เราขอแนะนำให้ย้ายข้อมูลไปยัง thinking_level เพื่อให้ประสิทธิภาพคาดการณ์ได้มากขึ้น อย่าใช้ทั้ง 2 อย่างในคำขอเดียวกัน

  5. Gemini 3 รองรับ Batch API ไหม ได้ Gemini 3 รองรับ Batch API

  6. ระบบรองรับการแคชบริบทไหม ได้ Context Caching รองรับ Gemini 3

  7. Gemini 3 รองรับเครื่องมือใดบ้าง Gemini 3 รองรับ Google Search, การค้นหาไฟล์ การเรียกใช้โค้ด และบริบท URL นอกจากนี้ยังรองรับ Function Calling มาตรฐานสำหรับเครื่องมือที่กำหนดเองของคุณเอง (แต่ไม่รองรับเครื่องมือในตัว) โปรดทราบว่าปัจจุบันระบบยังไม่รองรับการอ้างอิงจาก Google Maps

  8. gemini-3.1-pro-preview-customtools คืออะไร หากคุณใช้ gemini-3.1-pro-preview และโมเดลไม่สนใจเครื่องมือที่กำหนดเองของคุณเพื่อใช้คำสั่ง Bash ให้ลองใช้โมเดล gemini-3.1-pro-preview-customtools แทน ดูข้อมูลเพิ่มเติมได้ที่นี่

ขั้นตอนถัดไป

  • เริ่มต้นใช้งาน Gemini 3 Cookbook
  • ดูคำแนะนำเฉพาะสำหรับ Cookbook เกี่ยวกับระดับการคิดและวิธีย้ายข้อมูลจากงบประมาณการคิดไปยังระดับการคิด