Release Series • Part 1 of 3
Part 1: Multimodal Function Responses & File URIs in Gemini API — What Changed vs. Plain Text JSON Tools
Executive Summary: Released November 5, 2026, Google officially elevates function calling from text-only JSON envelopes to first-class multimodal perception. Custom tools can now return Office and OpenDocument spreadsheets and decks, audio recordings, video sequences, high-resolution imagery, and PDFs directly to Gemini 3.8 and Gemini 4 models. Crucially, tools are no longer restricted to inline base64 bytes: tools can upload assets to the Google GenAI Files API and return a lightweight
uri reference, eliminating payload bloat and memory exhaustion across autonomous agent loops.
1. The Limitations of Text-Only Tool Return Architectures
Prior to this release, function calling operated under a text-constrained contract:
- Tool Result Serialization Bottleneck: If an agent tool generated a chart, retrieved an audio recording from an S3 bucket, or pulled a video from a surveillance feed, it was forced to convert the media into text summaries, extract raw numerical metrics, or pass fragile markdown links that required secondary retrieval turns.
- Base64 Inline Memory Explosions: While image returns were introduced earlier, embedding 10MB to 50MB of inline base64 data inside API payloads frequently triggered HTTP 413 (Payload Too Large) errors, degraded client serialization performance, and congested WebSocket connection buffers.
- Context Window Contamination: Large base64 strings repeatedly counted against request limits without benefiting from prefix context caching across multiple conversation turns.
2. What Changed on November 5, 2026
Google's updated Gemini API specifications introduce two transformative primitives:
- Universal Multimodal Part Acceptance: In the
GenerateContentAPI, function response parts now acceptaudio,video, anddocument(Office & OpenDocument) blocks alongside existingimage,pdf, andtexttypes. In theInteractionsAPI,function_resultsteps accept structuredresultarrays with distinct typed blocks. - Files API URI Delegation: Tools can invoke
client.files.upload()in the background and return{ "type": "document", "uri": sheet.uri }or{ "type": "video", "uri": clip.uri, "processing": "agentic" }. The Gemini inference engine resolves the URI server-side, streaming tokens without client payload overhead.
3. Code Walkthrough: Interactions API vs GenerateContent API
Here is the verified production pattern using the Interactions API in Python (google-genai v2.34+):
from google import genai
client = genai.Client()
# 1. Capture tool call from the previous interaction step
tool_call = next(s for s in interaction.steps if s.type == "function_call")
# 2. Tool downloads/generates assets and registers with Files API
sheet = client.files.upload(
file="q3_financial_variance.ods",
config={"mime_type": "application/vnd.oasis.opendocument.spreadsheet"}
)
clip = client.files.upload(
file="inspection_drone_run.mp4",
config={"mime_type": "video/mp4"}
)
# 3. Supply multimodal function_result step back to the model
final_interaction = client.interactions.create(
model="gemini-3.8-flash",
previous_interaction_id=interaction.id,
input=[
{
"type": "function_result",
"name": tool_call.name,
"call_id": tool_call.id,
"result": [
{"type": "text", "text": '{"status": "assets_retrieved", "items_count": 2}'},
{
"type": "document",
"uri": sheet.uri,
"mime_type": "application/vnd.oasis.opendocument.spreadsheet",
},
{
"type": "video",
"uri": clip.uri,
"mime_type": "video/mp4",
"processing": "agentic",
},
],
}
],
)
print(final_interaction.output_text)
And the TypeScript equivalent using @google/genai v2.32+:
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const toolCall = interaction.steps.find((s) => s.type === "function_call");
// Return tool execution result with Files API URI
const finalInteraction = await client.interactions.create({
model: "gemini-3.8-flash",
previous_interaction_id: interaction.id,
input: [
{
type: "function_result",
name: toolCall?.name ?? "inspect_inventory",
call_id: toolCall?.id ?? "call_01",
result: [
{ type: "text", text: JSON.stringify({ auditStatus: "complete" }) },
{
type: "document",
uri: spreadsheetUpload.uri,
mime_type: "application/vnd.oasis.opendocument.spreadsheet",
},
],
},
],
});
4. Comparative Architecture Matrix
| Feature Dimension | Legacy JSON Return | Inline Multimodal (Base64) | Files API URI Return (Nov 5, 2026) |
|---|---|---|---|
| Supported Modalities | Text / Strings only | Images, PDFs, Plain text | Text, Image, Audio, Video, Office & ODF |
| Client Request Payload | < 5 KB | 10 MB – 50 MB+ (Blows HTTP limits) | < 1 KB (Lightweight URI string) |
| Video Understanding | Unsupported (Requires pre-pass) | Impractical due to size | Native (Static or Agentic Processing) |
| Spreadsheet Formulas | Lossy flattened text | Requires PDF conversion | Native ODS formula & cell retention |
| Context Cache Reusability | Low (Session-locked) | None (Repeated transfer) | High (Cached server-side across turns) |
5. Video Processing Modes: Static vs. Agentic
When returning video blocks in tool responses, developers can specify processing: "agentic" or processing: "static":
processing: "agentic": Instructs the Gemini video perception engine to dynamically scrub the video timeline, adapting frame inspection rates based on model queries to locate critical timestamps and high-detail events.processing: "static": Samples frames uniformly at standard 1 FPS intervals, optimal for ambient landscape summaries or short 5-second video clips.