Google Gemini Backend
The GeminiBackend compiles AXON IR into prompts optimized for the Google Gemini model family.Overview
Target API: Google Gemini APIModels: Gemini Pro, Gemini Ultra, future models Key Features:
system_instructionas a first-class parameter- Markdown-optimized formatting for better instruction following
FunctionDeclarationformat for tool useresponse_schemafor structured output
Key Differences from Anthropic
| Feature | Anthropic | Gemini |
|---|---|---|
| System prompt | system message | system_instruction parameter |
| Persona framing | ”You are X" | "Your identity is X” |
| Formatting | Plain text | Markdown (##, -, bold) |
| Tool format | input_schema | parameters |
| Type names | lowercase | UPPERCASE |
| Structured output | JSON schema | response_schema |
Implementation
System Instruction Compilation
Overview
Gemini’ssystem_instruction is persistent across all turns and applied before content generation. This makes it ideal for persona identity and hard constraints.
Persona Block
Context Block (Markdown Formatting)
Anchor Block (Markdown-Optimized)
Step Compilation
IRStep with Markdown
Probe Compilation (with response_schema)
"type": "OBJECT", "type": "STRING").
Reason Compilation (Markdown Formatting)
Tool Specification Compilation
Gemini FunctionDeclaration Format
Comparison: Anthropic vs Gemini
System Prompt
Anthropic:Tool Declaration
Anthropic:input_schema→parameters"object"→"OBJECT""string"→"STRING"
Next Steps
Anthropic Backend
Compare with Claude’s compilation approach
Runtime Executor
See how compiled prompts are executed
