Skip to content

Add raw/streaming responses, aiohttp transport, OPENCODE_LOG and client.copy - #21

Merged
shrijayan merged 5 commits into
mainfrom
feat/sdk-parity
Oct 22, 2026
Merged

shrijayan merged 5 commits into
mainfrom
feat/sdk-parity

Conversation

@shrijayan

Copy link
Copy Markdown
Owner

Closes feature gaps with the OpenAI/Anthropic Python SDKs.

  • .with_raw_response / .with_streaming_response on every resource (sync and async), plus client.get/post/put/patch/delete for endpoints without a method.
  • DefaultAioHttpClient: optional aiohttp transport for AsyncOpencode via the aiohttp extra.
  • OPENCODE_LOG=debug|info configures the opencode logger.
  • client.copy(...) alias for with_options, with docs on the shared connection pool.

Not added: _request_id on responses, since OpenCode 2.1.2 sends no request ID header.

Checked locally: ruff, ruff format, pyright, mypy, codegen --check, 463 tests, mkdocs build --strict.

Comment thread tests/test_with_options.py Fixed
DefaultAioHttpClient wraps httpx-aiohttp behind a new 'aiohttp' extra and is
passed as http_client=. Tests run it against a real aiohttp server for
requests, SSE streaming, retries and timeouts, and skip without the extra.
…thods

Every generated resource (sync and async) gets with_raw_response, returning an
APIResponse with headers, status and parse(), and with_streaming_response, a
context manager that leaves the body unread. List methods give the first page's
response; event streams are never read eagerly. Also adds client.get/post/put/
patch/delete for endpoints without a method, and README sections for raw
responses, custom requests and the installed version.
@shrijayan
shrijayan merged commit 7bc98ed into main Oct 22, 2026
17 checks passed
@shrijayan
shrijayan deleted the feat/sdk-parity branch October 22, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants