• Your Name's avatar
    feat: Rewrite ClaudeProviderHandler to use Anthropic SDK with OAuth2 · 0ba372d8
    Your Name authored
    Major rewrite to use the official Anthropic Python SDK instead of direct
    HTTP calls, while maintaining our OAuth2 authentication flow.
    
    Key changes:
    - Use Anthropic SDK client with OAuth2 token as api_key
    - SDK handles proper message format conversion
    - SDK handles automatic retries (max_retries=3)
    - SDK handles proper streaming event parsing
    - SDK handles correct headers and beta features
    - Better error handling and rate limit management
    
    This should fix the rate limiting issues we were seeing with direct HTTP
    calls, as the SDK implements proper retry logic and request formatting.
    
    New methods:
    - _get_sdk_client(): Creates SDK client with OAuth2 token
    - _handle_streaming_request_sdk(): SDK-based streaming handler
    - get_cache_stats(): Returns cache usage statistics
    
    Removed methods:
    - _request_with_retry(): No longer needed (SDK handles retries)
    - _handle_streaming_request_with_retry(): Replaced by SDK streaming
    - _handle_streaming_request(): Replaced by SDK streaming
    0ba372d8
Name
Last commit
Last update
aisbf Loading commit data...
config Loading commit data...
docs Loading commit data...
static Loading commit data...
templates Loading commit data...
.gitignore Loading commit data...
.providers.json.swp Loading commit data...
=0.5.0 Loading commit data...
AI.PROMPT Loading commit data...
API_EXAMPLES.md Loading commit data...
CHANGELOG.md Loading commit data...
CLAUDE_OAUTH2_DEEP_DIVE.md Loading commit data...
CLAUDE_OAUTH2_SETUP.md Loading commit data...
DEBUG_GUIDE.md Loading commit data...
DOCUMENTATION.md Loading commit data...
LICENSE.txt Loading commit data...
MANIFEST.in Loading commit data...
PYPI.md Loading commit data...
README.md Loading commit data...
TODO.md Loading commit data...
aisbf.sh Loading commit data...
build.sh Loading commit data...
clean.sh Loading commit data...
cli.py Loading commit data...
main.py Loading commit data...
pyproject.toml Loading commit data...
requirements.txt Loading commit data...
screenshot.png Loading commit data...
setup.py Loading commit data...
start_proxy.sh Loading commit data...
test_google.sh Loading commit data...
test_kiro_models_origin.py Loading commit data...
test_proxy.sh Loading commit data...
test_response_cache.py Loading commit data...