Update RequestX adapter for v1.0.2 with httpx-like API#1
Merged
Conversation
- Changed from Session() to Client() for sync and AsyncClient() for async - Added proper aclose() for async client cleanup - Switched from 'data' to 'content' parameter for request body - Added native streaming support using stream() method with iter_bytes/aiter_bytes - Added verify_ssl attribute initialization - Updated pyproject.toml to require requestx>=1.0.2 https://claude.ai/code/session_018m5XH5sVYS25zAr6258ygf
Reformatted to match httpx adapter style exactly: - Single line docstrings - Inline method call parameters - Consistent code structure https://claude.ai/code/session_018m5XH5sVYS25zAr6258ygf
- Updated requestx adapter for v1.0.3 API (httpx-like interface) https://claude.ai/code/session_018m5XH5sVYS25zAr6258ygf
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.
Summary
Updates the RequestX HTTP client adapter to support RequestX 1.0.2, which introduces an httpx-compatible API. This change modernizes the adapter to use the new
ClientandAsyncClientclasses instead of the previousSessionAPI.Key Changes
pyproject.tomlrequestx.Session()withrequestx.Client()for sync operations andrequestx.AsyncClient()for async operationsdatatocontentto match httpx API conventionsverify_sslfrom per-request to client initialization viaverifyparameterawait self.async_client.aclose()instead of synchronousclose()client.stream()andasync_client.stream()context managers, replacing the previous fallback behaviorresponse.elapsed.total_seconds()for sync requests (when available) and manual timing for async requestsImplementation Details
timeimport from module level (now imported locally in streaming methods)session/async_sessiontoclient/async_clientfor clarityverify_sslas instance variable initialized during client creationiter_bytes()andaiter_bytes()with 8KB chunk sizehttps://claude.ai/code/session_018m5XH5sVYS25zAr6258ygf