Commit f944f5f
v0.18.0: cache-key migration, audio input, cached_only, service-tier pricing (#45)
* Fix duplicate additionalProperties in JSON schema serialization
The schema had duplicate `additionalProperties` keys: one from
SchemaFormat's struct field and another from OpenAiTransform. This
produced malformed JSON that OpenAI started rejecting.
Fix: OpenAiTransform now only adds `additionalProperties` to
object-type schemas (not primitives like string/integer), and the
redundant field is removed from SchemaFormat. Also adds a unit test
to prevent regression, plus an OpenAI integration test.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix duplicate additionalProperties in schema + add cache migration
The schema had duplicate additionalProperties keys: one from
SchemaFormat's struct field and another from OpenAiTransform. This
produced malformed JSON.
Fix:
- OpenAiTransform now only adds additionalProperties to object-type
schemas (not primitives like string/integer)
- Removed redundant additionalProperties field from SchemaFormat
- Added legacy cache key migration so existing caches are found under
the old key format and copied to the new key
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove unnecessary Gemini-specific additionalProperties stripping
The schema fix (only adding additionalProperties to object-type
schemas, no duplicates) makes the Gemini-specific stripping in
chat_uncached redundant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add audio input support and Gemini transcription test
- Add InputAudio variant to ChatMessageContent for sending audio
(wav/mp3) as base64-encoded data in chat completions
- Add InputAudio struct with wav() and mp3() convenience constructors
- Add base64 dependency
- Move harvard.wav to test_fixtures/
- Add gemini_audio_transcription integration test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* gemini audio
* add cached_only option
* Bump to 0.18.0: service-tier pricing, new models, cost signature change
Adds flex and priority tier price tables, new gpt-5.4-mini/nano entries,
and threads service_tier through cost() so ChatClient::cost picks the
right table. Pricing snapshot refreshed to 2026-03-17.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clippy: collapse legacy-cache-key lookup to ? operator
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update test expectations for cleaned-up schema format
- multiple_optional_fields: model now returns "Elon Reeve Musk" (full legal name) under the new schema
- optional_fields_varying_presence: the model was filling `title` with the struct name "BookInfo" when the prompt was "Tell me about the book X"; disambiguating the prompt fixes it
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 908ad0d commit f944f5f
7 files changed
Lines changed: 552 additions & 86 deletions
File tree
- src
- test_fixtures
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments