Parameter Changes

Complete reference of every parameter that changed, was removed, or added new requirements in Gemini 3.5 Flash.

Change summary

ParameterStatusAction Required
temperatureremovedDelete the parameter. Use thinking_level to control reasoning depth instead.
top_premovedDelete the parameter. No direct replacement.
top_kremovedDelete the parameter. No direct replacement.
thinking_budgetdeprecatedReplace with thinking_level="minimal|low|medium|high". Remove thinking_budget.
thoughts_in_content (thought preservation)default changedSet thoughts_in_content=False for chat sessions, or truncate history explicitly.
FunctionResponse.idnow requiredAdd id field matching the function call id to all FunctionResponse objects.
FunctionResponse.namenow requiredAdd name field matching the function name to all FunctionResponse objects.

temperature / top_p / top_k removed

These sampling parameters are no longer accepted. They were used in gemini-3-flash-preview to control output diversity. In Gemini 3.5 Flash, output quality is primarily controlled via thinking_level.

Before (gemini-3-flash-preview)
# gemini-3-flash-preview — these params worked
from google.generativeai.types import GenerationConfig

generation_config = GenerationConfig(
    temperature=0.7,     # ← REMOVED in 3.5-flash
    top_p=0.9,           # ← REMOVED in 3.5-flash
    top_k=40,            # ← REMOVED in 3.5-flash
    max_output_tokens=2048,
)
After (gemini-3.5-flash)
# gemini-3.5-flash — remove temperature/top_p/top_k
from google.generativeai.types import GenerationConfig, ThinkingConfig

generation_config = GenerationConfig(
    # temperature, top_p, top_k removed — not supported
    max_output_tokens=2048,
    thinking_config=ThinkingConfig(
        thinking_level="high",  # use thinking_level for quality control
    ),
)

Thought preservation default changed

Watch out in multi-turn chats: Thinking tokens now accumulate in conversation history by default. A 10-turn chat at thinking_level="high" (~8K tokens/turn) can consume 80K+ tokens of context, increasing cost and approaching context limits.

Before — no thought accumulation
# gemini-3-flash-preview — thoughts NOT preserved by default
# Multi-turn chat: each turn only sees the output, not thinking tokens
chat = model.start_chat(history=[])
response1 = chat.send_message("Analyze this codebase...")
# response1.candidates[0].content has output only
response2 = chat.send_message("Now summarize your findings...")
# history is compact — no token blowup
After — thoughts accumulate (+ how to fix)
# gemini-3.5-flash — thoughts ARE preserved by default
# ⚠ Thinking tokens accumulate in chat history!
# A 10-turn chat with "high" level can exceed 80K tokens quickly

# Option A: Disable thought preservation for chat sessions
from google.generativeai.types import GenerationConfig, ThinkingConfig

generation_config = GenerationConfig(
    thinking_config=ThinkingConfig(
        thinking_level="high",
        thoughts_in_content=False,  # ← prevents accumulation
    ),
)

# Option B: Truncate history explicitly after each turn
def truncate_history(history, max_turns=5):
    return history[-max_turns * 2:] if len(history) > max_turns * 2 else history

FunctionResponse: id + name now required

This causes a 400 error — not a silent regression. Any FunctionResponse that omits id or name will fail with HTTP 400. Check all tool-use handlers.

Before — id and name optional
# gemini-3-flash-preview — id and name were optional
tool_response = {
    "functionResponse": {
        "response": {
            "result": "The weather in NYC is 72°F and sunny."
        }
    }
}
# This worked fine in gemini-3-flash-preview
After — both required
# gemini-3.5-flash — id AND name are REQUIRED
# Missing either field returns HTTP 400

tool_response = {
    "functionResponse": {
        "id": "call_abc123",      # ← REQUIRED: matches the function call id
        "name": "get_weather",    # ← REQUIRED: the function name
        "response": {
            "result": "The weather in NYC is 72°F and sunny."
        }
    }
}

# Python SDK equivalent
from google.generativeai.types import FunctionResponse

func_response = FunctionResponse(
    id=function_call.id,         # match the call's id
    name=function_call.name,     # match the function name
    response={"result": "72°F and sunny"},
)