Gemini 3.7 Flash 新增功能

最新模型 其他模型

Gemini 3.7 Flash (gemini-3.7-flash) 是 Gemini 3 系列中的上一代 Flash 模型,现已废弃,并会自动路由到 Gemini 3.8 Flash。

本指南仅供参考,其中介绍了 Gemini 3.7 Flash 中引入的功能和更改。

模型概览

模型 模型 ID 默认思考等级 说明
Gemini 3.7 Flash(已废弃) gemini-3.7-flash medium 上一代 Flash 模型,专为编码、Agentic Workflows 和多步执行而打造。已替换为 Gemini 3.8 Flash。

Gemini 3.7 Flash 支持 100 万个 token 的上下文窗口、最多 6.4 万个输出 token、可调整的思考等级(low、medium、high),以及与 3.6 Flash 相同的内置工具套件。

如需了解完整规格,请参阅Gemini 3.7 Flash 模型页面。

快速入门

Python

from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.7-flash",
    contents="Write a responsive navigation component in React with smooth animations and dark mode toggle."
)

print(response.text)

JavaScript

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

const ai = new GoogleGenAI({});

const response = await ai.models.generateContent({
  model: "gemini-3.7-flash",
  contents: "Write a responsive navigation component in React with smooth animations and dark mode toggle.",
});

console.log(response.text);

REST

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.7-flash:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [{
      "parts": [{"text": "Write a responsive navigation component in React with smooth animations and dark mode toggle."}]
    }]
  }'

Gemini 3.7 Flash 的新功能

  • 编码和智能体任务: 在实际软件工程和智能体基准测试中,质量显著提高,有助于解决问题并减少智能体循环失败的情况。
  • Web 开发和更强的设计对等性: 直接从设计模拟生成高保真桌面和 Web 应用代码,在设计一致性方面取得了显著提升,并能根据模拟审核现有代码库,以验证 1:1 的设计对等性。

了解推理等级

Gemini 3.7 Flash 允许开发者通过调整模型的思考等级来灵活控制延迟时间和智能程度:

  • 低思考力度:缩短了延迟时间敏感型任务(例如突发事件响应流水线、实时聊天、撰写草稿和快速数据分析)的回答时间。
  • 中等(默认): 适用于大多数任务,可提供最佳质量。建议用于复杂的代码和智能体用例,首次准确率更高。
  • 高思考量:最大限度地提高了模型的思考能力和使用工具的能力。最适合处理复杂的推理、高难度数学运算以及困难的编码和智能体任务。允许进行扩展思考和函数调用,但 token 消耗量和费用会更高。

如需在 Gemini 3.7 Flash 中配置思考等级,请执行以下操作:

Python

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.7-flash",
    contents="Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(
            thinking_level="medium"  # Balanced reasoning effort for complex tasks
        ),
    ),
)

print(response.text)

如需查看多语言代码示例(JavaScript、REST)和深入的推理概念,请参阅 Gemini 3.8 Flash 中的了解推理等级。

Antigravity 智能体支持

其他模型

后续步骤