Skip to content

Commit f944f5f

Browse files
anchpopclaude
andauthored
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

Cargo.lock

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tysm"
3-
version = "0.17.1"
3+
version = "0.18.0"
44
edition = "2021"
55
description = "Batteries-included Rust OpenAI Client"
66
license = "MIT"
@@ -35,6 +35,7 @@ zstd = "0.13.3"
3535
log = "0.4.27"
3636
itertools = "0.14.0"
3737
dashmap = "6.1.0"
38+
base64 = "0.22.1"
3839

3940
[dev-dependencies]
4041
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread", "full"] }

0 commit comments

Comments
 (0)