Skip to content

v0.5.2 - Python SDK v0.76.0 Feature Parity

Choose a tag to compare

@dalehurley dalehurley released this 17 Jan 22:12
· 11 commits to main since this release

πŸŽ‰ 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, and StreamingToolRunner support server_tool_use blocks
  • βœ… 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:

  • βœ… StreamResponse includes __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