feat: Add async/await support to Seam SDK - #622
Merged
Conversation
Add an async variant of every client entrypoint, mirroring the sync API one-to-one, backed by httpx.AsyncClient: - AsyncSeamHttpClient wraps httpx.AsyncClient with the same retry transport, header, and error handling as SeamHttpClient, with the shared response handling extracted into SeamHttpResponseHandler. - Generate Async* and AbstractAsync* route classes alongside the sync classes from the same templates, plus AsyncRoutes in the routes index. - Add resolve_action_attempt_async polling with asyncio.sleep, and AsyncSeamPaginator with async response hooks and an async flatten generator. - Add AsyncSeam and AsyncSeamWithoutWorkspace with async context manager support and close(), and give the sync clients close() and context manager support for symmetry. - Test the async client against the fake Seam Connect server and the recording server using pytest-asyncio, covering auth, action attempt waiting, pagination, retries, errors, and concurrent requests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TszCfraSbGaYQ9TFaD5jjX
razor-x
marked this pull request as ready for review
August 19, 2026 19:09
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.
This PR adds comprehensive asynchronous support to the Seam Python SDK, enabling users to make non-blocking API calls using async/await patterns.
Summary
The SDK now provides fully async-compatible classes and methods alongside the existing synchronous API. Users can choose between
Seam(synchronous) andAsyncSeam(asynchronous) clients based on their application needs.Key Changes
AsyncSeamandAsyncSeamWithoutWorkspaceas async counterparts to the synchronousSeamandSeamWithoutWorkspaceclassesAsyncSeamHttpClientusinghttpx.AsyncClientfor non-blocking HTTP operationsAbstractAsync*andAsync*classes for all route modules (e.g.,AsyncAccessCodes,AsyncThermostats, etc.) with async method implementationsAsyncSeamPaginatorfor paginated async requestsresolve_action_attemptmodule withresolve_action_attempt_asyncfor async action pollingasync with) for proper resource cleanuptest/async_seam_test.pywith async test casesImplementation Details
async defand useawaitfor I/O operationsAsyncSeamHttpClientextendshttpx.AsyncClientand implements the same error handling as the synchronous clientpytest-asyncioto dev dependencies for async test supportBackward Compatibility
All existing synchronous APIs remain unchanged. This is a purely additive change that provides async alternatives without breaking existing code.
https://claude.ai/code/session_01TszCfraSbGaYQ9TFaD5jjX