
Extract Gemini queries from Interactions: steps, status and source scope
Read exposed strings from google_search_call.arguments.queries in the Interactions steps array. Citations from model_output remain at run scope. The offline kit retains neither google_search_result nor Search Suggestions or thought payloads.
Use this for Interactions JSON with Google Search. Fixtures are original synthetic structures; no actual Gemini grounding output is published here.
Inspect your own result nextThe offline kit needs no API key. You can later inspect a separate bounded run in the free tool.Open the free toolChoose the correct API contract
The optional direct Gemini adapter uses /v1beta/interactions with google_search. This teaching example therefore starts with steps. The current website instead routes Gemini through OpenRouter Chat Completions; that checked route exposes search counts and run citations, but no query strings. Responses containing candidates and groundingMetadata follow another API structure; this parser does not use them as a fallback. First identify the surface you actually call.
Each google_search_call becomes an action containing exposed query strings. Missing IDs and models stay null in the teaching example. A plausible label does not replace absent information. When several calls occur, their string membership remains inspectable.
Extract the shared kit and run the code below inside fanout-kit-v2. Both strings come solely from fixtures.mjs. It demonstrates parser behavior without API access, not the search decisions of a Gemini consumer session. A real request needs separate error handling, current model access and your private configuration.
Continue with read a Gemini result safely.
import { parseGeminiInteraction } from "./parsers.mjs";
import { fixtures } from "./fixtures.mjs";
const result = parseGeminiInteraction(fixtures.gemini);
console.log(result.queries); // two synthetic strings
console.log(result.actions[0].sources); // []
console.log(result.runSources[0].sourceScope); // runSeparate search strings from grounding payloads
The synthetic response deliberately includes a marker inside google_search_result. A test requires that it never appear in the parser result. The parser reads search calls and URL annotations on model_output. It copies neither Search Suggestions nor thought blocks.
The fictional URL annotation stays in runSources. The shown search calls contain no supported query-to-source join, so their actions have empty sources and sourceScope not_exposed. A matching domain cannot replace the missing relationship. This matters when you later produce CSV rows or reports.
Discarding selected fields does not automatically settle every question about retaining or reusing actual data. The website's saved Gemini format removes grounding sources and marks sourceEvidenceScope as not_stored_google_grounded_results. Absent saved sources therefore do not mean the live run had none. Review current provider terms for your specific use.
Continue with validate the saved-result contract.
Unknown status stays unknown
The teaching parser uses an available status without turning an absent status into completed. Valid completed output with zero strings differs from failed output, a partial run or a missing steps list. An error response without steps can return failed; an invalid container throws INVALID_RESPONSE.
Only the optional direct Gemini path supplies a completed fallback when provider status is missing; the current OpenRouter path checks the supplied finish status. The website wrapper also bounds and deduplicates strings. The kit explicitly documents this distinction. Workflows requiring complete status evidence must preserve it at the request layer and establish whether storing it is allowed.
Test changes with original synthetic structures first. The download includes valid examples and deliberately invalid fields for negative tests. Publishing actual grounding responses is not required for useful parser checks. A synthetic test verifies shape and state logic, not current provider availability.
Continue with run the shared test kit.
Sources used
These sources support the functions and limits described here. They do not prove claims beyond that scope.
- Gemini Interactions: search calls and step typesOpen source
Supports Interactions steps, google_search_call arguments and output annotations. This is a different contract from GenerateContent candidates. Synthetic teaching fixtures do not establish publication rights for actual grounded output.
- Gemini API Additional TermsOpen source
Restricts caching, syndication, analysis and reuse of Google Grounded Results and Search Suggestions; drives the Gemini local-save redaction and public-example boundary.
- Original runnable offline parser and edge-case test kitOpen source
Original educational parser code and 27 offline checks. Synthetic response fixtures are not provider output; exact strings, status states, source scope and retention exclusions are tested. No paid calls or new actual grounding data. The teaching helper explicitly differs from the live normalized wrapper.
- Current website export contracts and reference validationOpen source
Draft 2020-12 reference for the current native/modelled full runs, query selections and local comparisons. Schema checked against actual service/export functions with synthetic provider stubs and semantic negative tests. No root schemaVersion is invented for full runs. Legacy planner and handoff formats remain separate.