Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Responses api resource - #89

Open
RushitaThakkar wants to merge 2 commits into
responses-api-typesfrom
responses-api-resource
Open

RushitaThakkar wants to merge 2 commits into
responses-api-typesfrom
responses-api-resource

Conversation

@RushitaThakkar

@RushitaThakkar RushitaThakkar commented Feb 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds the Responses API resource and client.responses.create() (sync and async), plus tests. Depends on PR 1 (types). Base branch: responses-api-types.

Changes

  • Resource (src/gradient/resources/responses/): ResponsesResource and AsyncResponsesResource with create() (POST /v1/responses or {inference_endpoint}/v1/responses, Bearer model_access_key). Four wrapper classes: with_raw_response and with_streaming_response for sync and async.
  • Exports (src/gradient/resources/__init__.py): Import and export the six responses resource classes.
  • Client (src/gradient/_client.py): responses cached property on Gradient, AsyncGradient, and the four wrapper clients (GradientWithRawResponse, AsyncGradientWithRawResponse, GradientWithStreamedResponse, AsyncGradientWithStreamedResponse).
  • Tests (tests/api_resources/test_responses.py): 7 tests with respx only (no real API): sync create() (minimal params; with tools and max_output_tokens); with_raw_response.create() + parse(); missing model_access_key → TypeError; async create(); async with_raw_response.create() + await raw.parse(); async missing model_access_key → TypeError.

Testing

  • pytest tests/api_resources/test_responses.py — 7 passed
  • pytest tests/types/responses/ — 8 passed (from base branch)
  • Ruff check and Pyright (with typed MINIMAL_INPUT) — pass

Depends on

  • PR 1 (responses-api-types) — types and type tests. This PR's base is responses-api-types.

After merge

  • Change this PR's base to main after PR 1 is merged, or merge responses-api-resource into main once responses-api-types has been merged.

Ref: docs/RESPONSES_API_PR_BREAKDOWN.md

rushitat and others added 2 commits February 6, 2026 15:21
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

1 participant