Add Responses API example and documentation#91
Open
RushitaThakkar wants to merge 4 commits intoresponses-api-modelsfrom
Open
Add Responses API example and documentation#91RushitaThakkar wants to merge 4 commits intoresponses-api-modelsfrom
RushitaThakkar wants to merge 4 commits intoresponses-api-modelsfrom
Conversation
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>
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
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:client.responses.create()with a function tool (get_weather).function_callin the output, appendsfunction_call_output, calls create again, and prints the finaloutput_text.ResponsesModels.GPT_5_1_CODEX_MAX.GRADIENT_MODEL_ACCESS_KEYfrom the environment (optionalpython-dotenvfor a.envfile).Docstrings
src/gradient/resources/responses/responses.py— Sync and asynccreate()docstrings now document themodelargument and point toResponsesModels(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.responseswith tools (e.g. GPT 5.2 Pro, 5.1 Codex Max), with a link toexamples/responses_tool_calling.py.Testing
GRADIENT_MODEL_ACCESS_KEYset:python examples/responses_tool_calling.py