C.W.K.
Stream
Lesson 04 of 10 · published

Gemini — Multimodal, Long Context, Reasoning

~14 min · providers, gemini

Level 0Apprentice
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

What Gemini does well

  • Long context (millions of tokens on Pro tiers).
  • Strong multimodal — vision, audio, video, files.
  • Native search grounding (results cited).
  • Thinking mode with budget control.
  • Cost-competitive on Flash tier for high-volume tasks.

Quirks to know

  • Roles: system_instruction, user, model. Note 'model' instead of 'assistant.'
  • JSON output via response_mime_type and response_schema in generation_config.
  • Function calling format differs from OpenAI's; arguments come pre-parsed.
  • Safety settings are fine-grained and can be tuned per-request — surprises if you don't set them explicitly.
  • Search grounding is opt-in; when enabled, responses include citations to fetched URLs.

Style preferences

Gemini handles long, multi-section prompts well, but is sensitive to safety settings being overly restrictive. Set them deliberately based on use case.

Code

Gemini — JSON + thinking + grounding·python
import google.generativeai as genai

model = genai.GenerativeModel("gemini-2.5-pro")
resp = model.generate_content(
    contents=[{"role": "user", "parts": [{"text": question}]}],
    generation_config={
        "response_mime_type": "application/json",
        "response_schema": SCHEMA,
        "thinking_config": {"thinking_budget": 8_000},
    },
    tools=[{"google_search": {}}],  # native grounding
)

External links

Exercise

Take a prompt that uses external search via your own tooling. Reimplement it on Gemini with native search grounding. Compare citation quality.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.