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

Add Responses API example and documentation - #91

Open
RushitaThakkar wants to merge 4 commits into
responses-api-modelsfrom
responses-api-docs
Open

RushitaThakkar wants to merge 4 commits into
responses-api-modelsfrom
responses-api-docs

Conversation

@RushitaThakkar

Copy link
Copy Markdown
Collaborator

Summary

Adds a runnable example and documentation for the Responses API: tool-calling example script, updated create() docstrings, and a short README subsection.

Changes

Example

  • examples/responses_tool_calling.py — Script that:
    • Uses client.responses.create() with a function tool (get_weather).
    • Sends a user message, handles a function_call in the output, appends function_call_output, calls create again, and prints the final output_text.
    • Uses ResponsesModels.GPT_5_1_CODEX_MAX.
    • Reads GRADIENT_MODEL_ACCESS_KEY from the environment (optional python-dotenv for a .env file).

Docstrings

  • src/gradient/resources/responses/responses.py — Sync and async create() docstrings now document the model argument and point to ResponsesModels (e.g. ResponsesModels.GPT_5_2_PRO) for recommended model IDs.

README

  • README.md — New bullet under “The Gradient SDK provides clients for”: Responses API — client.responses with tools (e.g. GPT 5.2 Pro, 5.1 Codex Max), with a link to examples/responses_tool_calling.py.

Testing

  • No new unit tests (doc/example only). Example can be run manually with GRADIENT_MODEL_ACCESS_KEY set:
    python examples/responses_tool_calling.py
rushitat and others added 4 commits February 9, 2026 14:47
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ent.types.responses import)

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