Skip to content

docs: add Responses API example and README section - #180

Merged
edenreich merged 2 commits into
mainfrom
feat/issue-175-20261117-1939
Nov 17, 2026
Merged

edenreich merged 2 commits into
mainfrom
feat/issue-175-20261117-1939

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

Adds documentation and a runnable example for the OpenAI-compatible Responses API (create_response / create_response_stream).

  • examples/responses/main.py - three demos:
    • Standard: create_response(model=..., input="...", max_output_tokens=...), printing text by walking response.output for ResponseOutputMessage items and their ResponseOutputText parts
    • Streaming: create_response_stream(...), printing event.delta for typed ResponseStreamEvent objects of type response.output_text.delta
    • Multi-turn input built from ResponseInputItem objects plus a flattened ResponseTool(name=..., description=..., parameters=FunctionParameters(...)), reading calls back from ResponseFunctionToolCall output items
  • examples/responses/README.md - usage, code snippets, the 400 note for providers without Responses API support, and the LLM_NAME env var (default openai/gpt-4o)
  • Root README.md - new "Responses API" section with standard and streaming snippets, and the example listed under "Examples"
  • examples/README.md - example listed

Closes #175

Testing

  • task lint (black, isort, mypy on inference_gateway/ and examples/) passes
  • task test passes (53 passed, 1 xfailed)
  • Offline smoke check: the example's output-parsing helpers were run against a hand-built Response with message and function_call items, and the tool/input items validate against CreateResponseRequest. The example was not run against a live gateway.

No generated code changes and no API changes. No docs ticket: examples and README only, no change to public SDK behavior.

Generated with Claude Code

@edenreich

Copy link
Copy Markdown
Contributor

@claude can you resolve the merge conflict?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 50s —— View job


Merge conflict resolved

  • Find conflicting files against main
  • Resolve conflicts locally
  • Create merge commit via GitHub API and move branch

The only conflict was in README.md. main added an Audio section (#176) in the same spot where this PR adds the Responses API section. I kept both: Responses API first, then Audio. examples/README.md and the root README's Examples list merged cleanly, so both the Audio and Responses entries are there.

Merge commit 0e7cde0 (parents: PR head 869eb92 and main c1f04d0). The branch was moved forward with a normal ref update, not a force push. GitHub now reports the PR as MERGEABLE, and compared with main the diff is still the original 5 files (+275).

I didn't run lint or tests again because this merge only changes Markdown.
| Branch

Resolve README.md conflict by keeping both the Responses API and Audio sections.

Co-authored-by: Eden Reich <[email protected]>
@edenreich
edenreich merged commit ec0e02a into main Nov 17, 2026
1 check passed
@edenreich
edenreich deleted the feat/issue-175-20261117-1939 branch November 17, 2026 20:08
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 17, 2026
## [0.26.0](v0.25.0...v0.26.0) (2026-11-17)

### ✨ Features

* sync schemas v1.14.1 and accept standard OpenAI stream chunks ([#182](#182)) ([d4e2634](d4e2634)), closes [#181](#181)

### 🐛 Bug Fixes

* allow null stop_reason in Messages stream message_start ([#179](#179)) ([cb9440e](cb9440e))
* read stream chunks as JSON in chat examples ([#178](#178)) ([fca4630](fca4630)), closes [#172](#172)

### 👷 CI

* align Dependabot schedule and grouping ([#169](#169)) ([3f5ad19](3f5ad19))
* set up orchestrators from repos.yaml ([#170](#170)) ([bffe983](bffe983))

### 📚 Documentation

* add audio example for speech, sfx and music ([#176](#176)) ([c1f04d0](c1f04d0))
* add Responses API example and README section ([#180](#180)) ([ec0e02a](ec0e02a))
* sync examples and README with gateway config ([#177](#177)) ([ee0999d](ee0999d))

### 🔧 Miscellaneous

* **deps:** bump flox dependencies to latest ([#167](#167)) ([55f32c5](55f32c5))
* **deps:** bump flox dependencies to latest ([#168](#168)) ([de020e9](de020e9))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.26.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] docs: add a Responses API example for create_response and create_response_stream

1 participant