v0.5.2 - Python SDK v0.76.0 Feature Parity
π Python SDK v0.76.0 Feature Parity
This release achieves complete feature parity with Python SDK v0.76.0.
β¨ New Features
Server-Side Tools Support
Tool runners now seamlessly handle server-side tool execution:
- β
BetaToolRunner,ToolRunner, andStreamingToolRunnersupportserver_tool_useblocks - β Server-side tools (code execution, bash) are recognized but not executed locally
- β Automatic differentiation between client-side and server-side tool calls
- π Example:
examples/server_side_tools.php
Binary Request Streaming
Advanced binary data handling with streaming responses:
- β
New
HttpClient::postStreamBinary()method for binary request bodies - β
Resource::_postStreamBinary()helper for resource classes - β Configurable Content-Type for binary payloads
- π Enables binary uploads with real-time processing
Stream Closure Guarantees
Enhanced resource management for streaming responses:
- β
StreamResponseincludes__destruct()for automatic cleanup - β
Idempotent
close()method prevents duplicate close attempts - β Network resources freed even without explicit close
- π§ͺ 8 comprehensive test cases
Authentication Flexibility
Support for alternative authentication methods:
- β API key now optional if custom auth headers provided
- β
Supports
x-api-key,Authorization(Bearer), or custom headers - β Perfect for OAuth2, service accounts, proxies, and enterprise SSO
- π Example:
examples/authentication_flexibility.php
π§ Changes
- Authentication: Loosened API key validation for flexible auth strategies
- StreamResponse: Enhanced with automatic cleanup and idempotent close
π Fixes
- Verified PATCH method correctly handles file uploads and multipart data
- Updated test assertions for new authentication error messages
π Testing
- β 312 tests passing (100%)
- β 880 assertions
- β 21 new test cases across 3 test files
- β Full code coverage for new features
π¦ Installation
composer require claude-php/claude-php-sdk:^0.5.2π Resources
β οΈ Breaking Changes
None - This release is fully backward compatible.
Full Changelog: v0.5.1...v0.5.2