Open
Conversation
…et serialization - _transform.py: `_async_transform_recursive` was calling the *sync* `_transform_recursive` when the annotated type was `Dict[str, T]`. This meant type aliases inside the dict values were never applied in the async path. Fixed by awaiting `_async_transform_recursive` instead. - _utils.py: `required_args` built the list of missing arguments from a `set` subtraction, producing a non-deterministic error message across Python runs. Changed to `sorted(...)` so the message is always stable. - _utils.py: `json_safe` now converts `set` and `frozenset` to a sorted list so they can be serialised to JSON without raising a TypeError. - _utils.py: clarify `deepcopy_minimal` docstring — tuples are intentionally not copied because they are immutable containers. - _compat.py: `ConfigDict` under Pydantic v1 was silently set to `None`. It now raises a clear `RuntimeError` if instantiated, pointing users towards upgrading to Pydantic v2. Tests added for all of the above changes. https://claude.ai/code/session_01CqXN7tjqqv1rCwTMkEmbFb
…k, and more Bug fixes: - _files.py: fix missing f-prefix on f-string in async_to_httpx_files error message - _streaming.py: narrow broad `except Exception` to `except json.JSONDecodeError` when parsing error body from SSE, preventing accidental swallowing of errors - _qs.py: raise NotImplementedError for unknown nested_format values (resolves existing TODO comment) Streaming improvements: - lib/streaming/_messages.py: add index bounds validation for content_block_start and content_block_delta events; align input_json_delta error handling with beta - lib/streaming/_beta_messages.py: add same index bounds validation New feature — on_retry callback: - _base_client.py: add `RetryInfo` dataclass (attempt, max_retries, url, wait_seconds, response, error) and `on_retry` callback parameter to BaseClient, SyncAPIClient, and AsyncAPIClient; callback is invoked before each retry sleep - _client.py: thread `on_retry` through Anthropic and AsyncAnthropic constructors and copy() / with_options() methods - __init__.py: export RetryInfo in public API Tests: - tests/test_qs.py: add test_unknown_nested_format https://claude.ai/code/session_01CqXN7tjqqv1rCwTMkEmbFb
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.
No description provided.