You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] docs: add a Responses API example for create_response and create_response_stream #175
Domain: Responses API (OpenAI-compatible POST /responses). The client exposes create_response and create_response_stream, and the package exports the related models (Response, ResponseStreamEvent, ResponseInputItem, ResponseTool, ResponseOutputMessage, ResponseOutputText, ResponseFunctionToolCall and more), but no example demonstrates them. There is no examples/responses/ directory, and the root README.md only names create_response_stream once, in the error-handling paragraph. The request and response shapes differ from chat completions (a string or item list as input, max_output_tokens, a flattened ResponseTool, a typed output item list and typed stream events), so a user cannot reasonably use the feature from the README alone.
Acceptance Criteria
Add examples/responses/main.py that calls client.create_response(model=..., input="...", max_output_tokens=...) and prints the text by walking response.output for ResponseOutputMessage items and their ResponseOutputText content.
In examples/responses/main.py, call client.create_response_stream(...) and print event.delta for events whose type is response.output_text.delta, showing that events arrive as typed ResponseStreamEvent objects.
In examples/responses/main.py or its README, show a multi-turn input built from ResponseInputItem objects and a function tool defined with ResponseTool(name=..., description=..., parameters=FunctionParameters(...)), reading the call back from a ResponseFunctionToolCall output item.
Add examples/responses/README.md with usage, the note that providers without Responses API support return a 400, and the env var used for the model.
Add a "Responses API" section to the root README.md with standard and streaming snippets, and list the new example in the README.md "Examples" section and in examples/README.md.
Standard: calls create_response(model, input="...", max_output_tokens=...), then gets the text by walking response.output for ResponseOutputMessage items and their ResponseOutputText parts.
Streaming: calls create_response_stream(...) and prints event.delta for each response.output_text.delta event.
Tools: sends a multi-turn input built from ResponseInputItem objects with a flattened ResponseTool(..., parameters=FunctionParameters(...)), then reads the calls back from ResponseFunctionToolCall output items.
examples/responses/README.md covers usage, code snippets, the note that providers without Responses API support return a 400, and the LLM_NAME env var (default openai/gpt-4o).
The root README.md has a new "Responses API" section with standard and streaming snippets. The example is now listed in both the root README.md and examples/README.md.
Checks:
task lint passes (black, isort and mypy on examples/).
task test passes: 53 passed, 1 xfailed.
I ran the example's parsing helpers offline against a hand-built Response, and they read it correctly.
I did not run the example against a live gateway.
I didn't open a docs ticket because only the examples and README changed. The SDK's public behavior is the same.
| Branch
Activity
edenreich commentedon Nov 17, 2026
@claude can you work on this?
inference-gateway-maintainer commentedon Nov 17, 2026
Claude finished @edenreich's task in 2m 41s —— View job •
feat/issue-175-20261117-1939• [Create PR ➔](https://github.com/inference-gateway/python-sdk/compare/main...feat/issue-175-20261117-1939?quick_pull=1&title=Issue%20%23175%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23175%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Responses API example added - PR #180
examples/responses/main.pyexamples/responses/README.mdREADME.mdandexamples/README.mdPR: #180
What changed:
examples/responses/main.pyhas three demos:create_response(model, input="...", max_output_tokens=...), then gets the text by walkingresponse.outputforResponseOutputMessageitems and theirResponseOutputTextparts.create_response_stream(...)and printsevent.deltafor eachresponse.output_text.deltaevent.inputbuilt fromResponseInputItemobjects with a flattenedResponseTool(..., parameters=FunctionParameters(...)), then reads the calls back fromResponseFunctionToolCalloutput items.examples/responses/README.mdcovers usage, code snippets, the note that providers without Responses API support return a 400, and theLLM_NAMEenv var (defaultopenai/gpt-4o).README.mdhas a new "Responses API" section with standard and streaming snippets. The example is now listed in both the rootREADME.mdandexamples/README.md.Checks:
task lintpasses (black, isort and mypy onexamples/).task testpasses: 53 passed, 1 xfailed.Response, and they read it correctly.I didn't open a docs ticket because only the examples and README changed. The SDK's public behavior is the same.
| Branch
inference-gateway-releaser commentedon Nov 17, 2026
🎉 This issue has been resolved in version 0.26.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀