v0.2.0 (2025-05-12)
Breaking Changes
See #1647 — usage makes sense as part of ModelResponse
, and could be really useful in "messages" (really a sequence of requests and response). In this PR:
- Adds
usage
toModelResponse
(field has a default factory ofUsage()
so it'll work to load data that doesn't have usage) - changes the return type of
Model.request
to justModelResponse
instead oftuple[ModelResponse, Usage]
Other Changes
- Add support for non-string enums in Gemini by @zaidhaan in #1564
- Fix parallel tool calls on Bedrock with Nova and Claude models by @pandersen-uncharted in #1656
- Fix Anthropic streaming by @samuelcolvin in #1686
- Fix serializability of ModelRequestParameters by @dmontagu in #1690
- Stop incorrectly treating side-by-side JSON schema $refs as recursion by @DouweM in #1697
- Set
ToolCallPartDelta.tool_call_id
when known from previous delta by @DouweM in #1694
New Contributors
Full Changelog: v0.1.11...v0.2.0