In @google/genai v2.x, step.result on code execution steps was typed as a plain string. In v3.0.0, it is typed as Array<Content> | string (aliased as CodeExecutionResultStepResult). Any existing TypeScript codebase passing step.result directly into functions expecting string will fail compilation during tsc build with: Type 'Array<Content> | string' is not assignable to type 'string'.
Prior to v3.0.0, when Gemini executed Python or bash scripts in isolated agent sandboxes, output capture was restricted to serialized terminal logs (stdout and stderr). If an agent executed a script that produced a Matplotlib visualization, a Seaborn statistical heatmap, or an exported SVG document, the developer had to implement awkward workarounds—such as instructing the agent to base64-encode the image to stdout and writing custom regex splitters on the client.
With @google/genai v3.0.0, the Interactions API natively supports multimodal execution artifacts. When the agent's code execution runtime generates binary visual outputs, the Google sandbox wraps the images directly as structured Content[] blocks containing MIME types and image buffers or Files API URIs.
To safely handle both legacy text-only terminal output and modern multimodal outputs, implement explicit type narrowing:
import type { CodeExecutionResultStep, Content } from '@google/genai';
function processExecutionStep(step: CodeExecutionResultStep) {
// Legacy or text-only execution stdout/stderr
if (typeof step.result === 'string') {
console.log('[Agent Stdout]:', step.result);
return;
}
// Modern v3.0.0 multimodal execution artifacts (images, plots, tables)
if (Array.isArray(step.result)) {
for (const part of step.result) {
if ('inlineData' in part && part.inlineData) {
console.log(`[Generated Plot]: ${part.inlineData.mimeType} (${part.inlineData.data.length} bytes)`);
renderInlineImage(part.inlineData.mimeType, part.inlineData.data);
} else if ('fileData' in part && part.fileData) {
console.log(`[Files API Artifact]: ${part.fileData.fileUri}`);
fetchFilesApiArtifact(part.fileData.fileUri);
}
}
}
}
Aligned with the November 5 Gemini API core release, @google/genai v3.0.0 embeds native MIME type validation for the full suite of Microsoft Office and OpenDocument formats within client.interactions:
application/vnd.oasis.opendocument.text (ODT)application/vnd.oasis.opendocument.presentation (ODP — rendered as page images)application/vnd.oasis.opendocument.spreadsheet (ODS — data + formulas from first sheet)application/msword (legacy DOC — rendered as page images)application/vnd.ms-powerpoint (legacy PPT — rendered as page images)application/vnd.ms-excel (legacy XLS)In addition, video content blocks inside function_result steps now accept processing: "agentic" for dynamic scrubbing across long-horizon video analysis.
A recurring challenge in v2.x bidirectional live voice/vision agents occurred when network drops or authentication handshake failures occurred during initial WebSocket negotiation. Live.connect() would occasionally enter an indefinite hanging state, failing to reject its promise and leaving developer frontends frozen.
In v3.0.0, Live.connect() attaches early listeners to the underlying WebSocket instance. If an error event fires or the socket terminates before the bidirectional setup protocol completes, the promise rejects immediately with a descriptive LiveConnectError, allowing frontends to initiate automatic exponential backoff retry loops.
SDK v3.0.0 introduces two additional developer enhancements:
source_text in AudioTranscriptionConfig: Allows passing ground-truth or contextual hint text to guide the speech recognition tokenizer in specialized medical, legal, or domain-specific terminology.gemini-3.5-transcribe: The bundled command-line interface now defaults to the dedicated low-latency audio model gemini-3.5-transcribe for transcription workflows rather than generic conversational models.MALFORMED_RESPONSE in FinishReason: Adds formal enum representation for cases where the upstream model stream experiences unexpected token truncation or serialization malformation, preventing ambiguous fallback states.