NewsCrawler.org

Google adds file slicing controls to the Gemini API

Google adds file slicing controls to the Gemini API
"Most LiteLLM users sending PDFs, slide decks, and spreadsheets only need a few pages or one sheet. With this feature, they can point Gemini at exactly that slice and pay only for those tokens, and it works through LiteLLM's Gemini routes with no extra setup. In our testing, slicing cut prompt tokens by 67% for a PDF and 33% for a workbook." LiteLLM
Google adds file slicing controls to the Gemini API
Google Gemini's File Slicing Controls examples
Google Gemini's File Slicing Controls examples
Google Gemini's File Slicing Controls examples
Image: Reddit

Update · : The new article says the feature applies to Gemini 4 models and gives a 'Skim Then Zoom' workflow where selected PDF pages are summarized while other pages are skipped, and it claims that narrowing the input reduces hallucinations and 'Context Limit' errors. These specific claims about hallucination reduction and error reduction are not in the original brief.

On 23 November 2026, Google announced file slicing controls in the Gemini API, available in Google AI Studio and the Gemini platform, along with native upload support for Microsoft Office and OpenDocument formats. Developers can pass PDFs, Office files, audio and video directly to the API and request only the pages, spreadsheet cells, media segments and layers they need. Billing covers only the tokens[1] for the parts that Gemini inspects.

A file uploaded once with the Files API can be reused across turns and tool calls by its URI[2], and an agent can specify which parts of a file to inspect inside a function response. The API slices, renders and tokenizes files on the server, so the client no longer has to run LibreOffice, PDF renderers or ffmpeg. Native slicing works across all Gemini 4 models, and existing file size and page limits still apply.

Options depend on the file type. Documents take a page range, a resolution of low, medium or high, and page_text or page_image layers. Spreadsheets take a sheet_index, visible_cells, and data, formulas or visuals layers. Video takes start_offset and end_offset, fps[3] and resolution settings, and transcript, frames or audio layers. When options are omitted, documents default to layout-preserving page images, and spreadsheets include evaluated values, formulas and sheet names across all tabs. Google says that gateway and SDK partners validated the controls before launch and cut prompt token spend in their production harnesses[4], but the source gives no figures.

Product Gemini API ai.google.dev

Google's API for building apps and agents with Gemini models, offering file uploads, tool calls and model access for developers.

Google shares (GOOGL)

275.99 USD −2.2% since the news day, November 23

Close on November 27 Quotes: CNBC

Read the original blog.googleDiscussion

Sources

Published: First seen: Updated: Читать по-русски

Open as a page