generate_content
Generate content with Gemini AI using text prompts, file uploads, Google search, and code execution to create documents, analyze media, and automate tasks.
Instructions
Generate content using Gemini with optional file inputs, code execution, and Google search. Supports multiple files: images (JPG, PNG, GIF, WebP, SVG, BMP, TIFF), video (MP4, AVI, MOV, WebM, FLV, MPG, WMV), audio (MP3, WAV, AIFF, AAC, OGG, FLAC), documents (PDF), and text files (TXT, MD, JSON, XML, CSV, HTML). MIME type is auto-detected from file extension.
Example usage:
{
"user_prompt": "Analyze this video",
"files": [
{
"path": "/path/to/video.mp4"
}
]
}PDF to Markdown conversion:
{
"user_prompt": "Convert this PDF to well-formatted Markdown, preserving structure and formatting",
"files": [
{"path": "/document.pdf"}
]
}With Google Search:
{
"user_prompt": "What are the latest AI breakthroughs in 2024?",
"enable_google_search": true
}With Code Execution:
{
"user_prompt": "Write and run a Python script to calculate prime numbers up to 100",
"enable_code_execution": true
}Combining features with thinking mode:
{
"user_prompt": "Research quantum computing and create a Python simulation",
"model": "gemini-2.5-pro",
"enable_google_search": true,
"enable_code_execution": true,
"thinking_budget": -1
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_prompt | Yes | User prompt for generation | |
| system_prompt | No | System prompt to guide the AI behavior (optional) | |
| files | No | Array of files to include in generation (optional). Supports images, video, audio, PDFs, and text files. | |
| model | No | Gemini model to use (optional) | gemini-2.5-flash |
| temperature | No | Temperature for generation (0-2, default 0.2) | |
| enable_code_execution | No | Enable code execution capability for the model | |
| enable_google_search | No | Enable Google search capability for the model | |
| thinking_budget | No | Thinking budget for models that support thinking mode (-1 for unlimited) |