gemini-code-execution-json-mode
Handle model-specific compatibility between Gemini code execution and structured JSON output.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- gemini-code-execution-json-mode
- description
- Handle model-specific compatibility between Gemini code execution and structured JSON output.
03 SKILL.md 正文
Gemini Code Execution + JSON Mode Compatibility
CRITICAL: Model-Specific Behavior
For all new model selections, use Gemini 3.8 Flash (gemini-3.8-flash) or a later Flash model. Never select Gemini Pro. Older rows below document compatibility only.
Gemini 3 (gemini-3.8-flash)
CAN combine code_execution with JSON mode/structured outputs.
From Gemini 3 Developer Guide:
"Gemini 3 allows you to combine Structured Outputs with built-in tools, including Grounding with Google Search, URL Context, and Code Execution."
Gemini 2.x (gemini-2.0-flash, gemini-2.5-flash)
CANNOT combine code_execution with JSON mode/controlled generation.
Error returned:
INVALID_ARGUMENT: Unable to submit request because controlled generation
is not supported with Code Execution tool.
Summary Table
| Model | Code Execution | JSON Mode | Both Together |
|---|---|---|---|
| gemini-3.8-flash | YES | YES | YES |
| gemini-2.0-flash | YES | YES | NO |
| gemini-2.5-flash | NO | YES | N/A |
Architecture Implications
For Your Project dice rolling:
- Gemini 3: Can use single-phase code_execution + JSON mode
- Gemini 2.x: Must use two-phase JSON-first tool_requests flow
- Phase 1: JSON mode call, LLM includes
tool_requestsarray - Phase 2: Execute tools server-side, inject results, second JSON call
- Phase 1: JSON mode call, LLM includes
Code Pattern
# Gemini 3: Can enable code_execution with JSON mode
if model_name in GEMINI_3_MODELS:
enable_code_execution = True # Safe with JSON mode
# Gemini 2.x: Must disable code_execution when using JSON mode
if model_name in ["gemini-2.0-flash", "gemini-2.5-flash"]:
enable_code_execution = False # Would cause INVALID_ARGUMENT
Sources
Last Updated
2025-12-16
04 同仓库更多 Skills
instinct
Use when the user invokes /instinct or /in, or asks to "message Instinct", "ask Instinct", "tell Instinct", "check Instinct", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.
hr
Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.
history-resume
Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.
grok
Alias for the canonical grokbot browser conversation workflow; /grok talks to the Grok bot the same way /dot talks to Dot.
codexa-bench
Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.