Repository navigation
feat(models): add native Google Interactions support - #263
Merged
ethan-scitix merged 5 commits intoOct 28, 2026
Merged
Conversation
Implement POST /v1beta/interactions and /v1/interactions through the existing async_http_json connection without changing google_genai. Keep the upstream SGLang/vLLM registrations and tests intact. Lower chat messages and tool exchanges into native steps. Support text and image input, function and hosted tools, structured JSON, reasoning summaries, citations and streamed response lifting. Enforce store=false and reject server-side continuation, background execution and agent selection before HTTP. Audit input/output contracts and fail on malformed or contradictory streamed evidence. Recognize HTTP-envelope body.stream in shared request definitions and classify native incomplete replies as truncation. Keep result schema version 1 and the upstream identity schema unchanged. Add versioned wire, dialect-contract and resume integration tests, plus usage/digest regression coverage and user-facing documentation. Refs: scitix#25, scitix#152
Round-trip native steps, thought signatures and system instructions through ReasoningOutput.opaque_roundtrip. Audit replayed history and serialized requests independently, and enforce instruction consistency. Infer function-result names from matching calls, including opaque history. Align legacy FunctionCalling, StructuredOutput and ServerTools with capability decisions without bypassing model-profile gates. Treat step.delta.metadata.total_usage as a cumulative fallback. Replace rather than sum observations, prefer terminal usage and reject malformed provided counters, including explicit null. Accept signature-only thoughts when thinking_summaries=auto omits visible summaries. Preserve content and snapshot-consistency guards, including rejection of provider calls violating tool_choice=none. Publish sanitized live captures for gemini-3.6-flash and document the 30-scenario matrix (33 generation requests). Validation is single-model; optional terminal snapshots and metadata-only usage fallback remain deterministic tests, not claimed as observed live responses. Validate after rebase: 10897 unit/integration tests passed, 29 skipped; repository Ruff checks and scoped type checks passed; quick preflight reported 26 PASS and 1 SKIP (deep HTTP reachability).
Trace the shared HTTP-envelope body.stream request-definition change in CHANGELOG, including preservation of GenerateContent path/query stream detection. Keep only post-rebase automated results in the live validation record. Clarify that the validated dialect and JSON/SSE captures were preserved during rebase, without claiming additional live calls or coverage runs. Validate the documentation-only changes with 139 request-metadata unit tests passed and 1 skipped, documentation consistency checks, quick preflight (26 PASS, 1 SKIP), and git diff --check.
Exclude only Google Interactions SSE fixtures from EOF normalization, keeping all other hook selections unchanged. Add six final-frame separator regressions and update fixture documentation and validation records. Production code and captured SSE bytes remain unchanged. Validation: all CI-equivalent pre-commit hooks passed; unit/integration tests: 10903 passed, 29 skipped; quick preflight: 26 passed, 1 skipped.
12 of 13 tasks
Collaborator
…ons docs Move the strict JSON helpers that google_genai and google_interactions both carried byte-for-byte into dialects/_google_json.py, so the two Google dialects reject duplicate keys and non-finite constants through one implementation. Drop the [Unreleased] CHANGELOG block: entries are written at release time, and most of its bullets described fixes to code this PR adds. Trim the Interactions guide section, the fixtures README and verbose docstrings, and drop live_validation.md; the PR description keeps the live matrix. The guide now states that, through a YAML config, only plain text, streaming and dialect_options work today, uses the validated gemini-3.6-flash in its example, and no longer calls failed or budget_exceeded non-terminal. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Summary
google_interactionsdialect alongsidegoogle_genai, using the existing provider-neutral HTTP connection and dialect registry.store: falseon every request. Support stateless, client-side opaque continuation through signed native-step history, system-instruction replay, and typed persistence.body.streamin shared request-definition hashing, distinguishing Interactions streaming from non-streaming requests while preserving existing GenerateContent path/query handling.RESULT_SCHEMA_VERSIONremains 1; upstream identity schema 5 is preserved.Related Issues
Closes #152. Refs #25.
Related implementation: #249.
Test Plan
Automated
ruff check && ruff format --check)ty checkormypy --strict)pdm run pytest)Manual
generativelanguage.googleapis.comon October 28, 2026.Tested model:
gemini-3.6-flash, reported as3.6-flash-07-2026in model metadata. BothPOST /v1beta/interactionsandPOST /v1/interactionsreturned successful responses.The final matrix passed 30 verification scenarios, representing 33 generation requests, excluding earlier diagnostic/probe iterations. Guard-only scenarios deliberately made no provider request.
noneandauto; verbatim multi-item summaries and signature-only thoughtsis_error: trueModel.agenerate(ChatInput(...))in both response modes, without injected capability outcomes; invalid storage/stateful/background settings rejected before HTTPEvery transmitted request was checked for Boolean
store: falseand the absence ofprevious_interaction_id,background, andagent.Detailed evidence, accounting examples, and validation limits are recorded in
tests/unit/core/models/dialects/fixtures/google_interactions/live_validation.md:1.Rebase preserved the validated Interactions dialect source and captured JSON/SSE bytes. The automated checks above were rerun afterward; no additional live API requests were made for the rebase verification.
Live-test findings and validation scope
thinking_summaries: autowhile providing a thought signature. This is accepted and covered by four live SSE fixtures, while contradictory content still fails.tool_choice: none. The client correctly rejected it; the sanitized response is retained as a negative regression fixture.steps. Optional terminal-step reconciliation and metadata-only usage fallback are covered by deterministic tests, not claimed as observed live behaviors.Modelrequests retain the existing model-profile requirements. Standalone dialect tests do not bypass those gates.Checklist
Required (all PRs)
type(scope): description)AI-Generated Code - <model> (<provider>)in module docstringcore/