Repository navigation
Conversation
Add native streaming, function calls, thought-signature replay, token usage and error mapping. Integrate the recorder, redact Google API key headers, and cover the adapter with offline conformance and failure tests.
There was a problem hiding this comment.
@itzgeebee Thanks — solid native Gemini reference adapter; it fits the 0.2.0 “copyable examples/providers” direction well (signatures via provider_data, no retries, transport/extra_body, check_model + recorder wiring, x-goog-api-key redaction). Offline unit suite looks strong.
Requesting a few updates before merge:
-
Live fixture (issue #30) — I re-recorded successfully with a free-tier key. Text + tool turns pass all 8
check_modelrules. Please replace the hand-written fixture with a live recording (or document maintainer acceptance of a hand-written v1). Keep a third fixture line with HTTP 429 sotest_reference_adapter_fixture_passes_check_modelstill assertserror_status == 429(synthetic rate-limit line is fine if you aren’t rate-limited during record). -
Default / docs model —
gemini-2.5-flashreturns 404 for new users (“no longer available… use models/gemini-3.8-flash”). Please update README / record examples / defaults to a model new free-tier keys can call (e.g.gemini-3.8-flash), and note the 2.5→3.x availability gotcha. -
CHANGELOG — #38 also adds
## [Unreleased]; rebase/merge so Unreleased combines both entries without a duplicate heading. -
PR status — description still reads like a draft pending live validation; either mark draft until the fixture is updated, or update the body once the live fixture lands.
Happy to re-review as soon as that’s up.
Closes #30
What changed
Add a copyable
GeminiModeladapter for nativestreamGenerateContentover httpx. It maps text, thoughts, function calls/results, finish reasons and cumulative usage, preserves signed model parts throughprovider_data, and classifies HTTP, transport and malformed-stream errors without retrying.Register the adapter with
record.py, list it in the README and changelog, and add a fixture plus offline contract/failure tests. Extend fixture recording to redact Google'sx-goog-api-keyheader.Validation
check_modelrules.uv build: passed.Live validation pending
The fixture is explicitly documented as hand-written responses captured through
record.pyoverhttpx.MockTransport, following the repository's existing fixture convention. It is not a live Gemini recording.Live model discovery succeeded with the native API. Text and tool generation still need successful live validation before this draft is ready. The fixture README includes the command to replace the two successful mock exchanges with a real recording.