Gemini 3 api

From jleechanorg/claude-commands · View interactive version

Gemini 3 api is an AI agent skill from the GitHub repository jleechanorg/claude-commands. Use current google-genai parameters and thinking configuration for Gemini 3 models.

How to use this skill

Skill file

Gemini 3 API (google-genai) - Usage Notes

Use this when wiring Gemini 3 models in the Python SDK to avoid outdated params.

Model invariant: Never select Gemini 3.1 Pro or any Gemini Pro model. Use Gemini 3.8 Flash (gemini-3.8-flash, gemini-3.8-flash-high) or later.

ThinkingConfig (Gemini 3)

For Gemini 3, use the google-genai SDK ThinkingConfig field thinking_level. Add include_thoughts=True only when thought summaries are needed.

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Explain how AI works.",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(thinking_level="high"),
    ),
)
print(response.text)

Notes:

Code execution tool (Gemini API)

Enable code execution via tools in GenerateContentConfig:

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Compute the sum of the first 50 primes using code.",
    config=types.GenerateContentConfig(
        tools=[types.Tool(code_execution=types.ToolCodeExecution)],
    ),
)

for part in response.candidates[0].content.parts:
    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)

Structured JSON output (response_mime_type)

Gemini supports structured JSON outputs via response_mime_type and schema.

Gemini 3 can combine structured outputs with built-in tools, including code execution.

from google import genai
from google.genai import types
from pydantic import BaseModel

class Result(BaseModel):
    summary: str

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Summarize this text in one sentence.",
    config=types.GenerateContentConfig(
        response_mime_type="application/json",
        response_json_schema=Result.model_json_schema(),
    ),
)

Model Selection Requirement (Gemini Invariant)

Mandatory Invariant: Never use Gemini 3.1 Pro (or older Gemini Pro models). Always use Gemini 3.8 Flash (gemini-3.8-flash / gemini-3.8-flash-high) or later.

Checklist for Gemini 3 integrations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.