Repository navigation
feat: implement the Audio API (create_speech) synced from schemas v0.25.0 - #112
Conversation
1720fc8 to
f47e886
Compare
|
@infer Can you implement the newly generated types in the client? use /ponytail:ponytail Also please update the PR's body and title to reflect on the actual feature. |
|
Model: Todos
Pull Request✅ Infer Result: SuccessDone. The newly generated schemas v0.25.0 types are now implemented in the client, and the PR title/body reflect the actual feature. What I implemented (commit
Checks: Ponytail notes: skipped a streaming variant (the endpoint returns a single binary payload, not an SSE stream) and a dedicated PR updated: title is now Follow-up filed: [DOCS] issue inference-gateway/docs#616 to document Model: Tokens: 2,484,400 in · 16,759 out · 2,501,159 total (42 requests) Tool calls: 49 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
Implements the generated types from schemas v0.25.0 in the client: a create_speech method that POSTs a validated CreateSpeechRequest to /audio/speech and returns the raw audio bytes, provider query param included for both requests and httpx backends since both go through _make_request. Exports CreateSpeechRequest from the package and adds a mocked test mirroring the images tests. Also annotates the response/request dicts in create_response/_stream as Dict[str, Any] so task lint (mpy with newer mypy) passes. Tests run: task test (36 passed, 1 xfailed) and task lint (black, isort, mypy clean).
Co-authored-by: Eden Reich <[email protected]>
## [0.17.0](v0.16.0...v0.17.0) (2026-08-31) ### ✨ Features * implement the Audio API (create_speech) synced from schemas v0.25.0 ([#112](#112)) ([714e41c](714e41c)) ### 👷 CI * **claude:** centralize claude.yml via reusable workflow ([#109](#109)) ([2eed134](2eed134)) ### 📚 Documentation * rewrite AGENTS.md per agents.md standard ([#111](#111)) ([220cc9f](220cc9f)) ### 🔧 Miscellaneous * **deps:** bump claude-code 2.1.201 -> 2.1.238 ([#108](#108)) ([d100215](d100215)) * **deps:** bump infer CLI v0.155.0 -> v0.164.0 ([#107](#107)) ([ce76479](ce76479)) * **deps:** bump infer CLI v0.164.0 -> v0.183.0 ([#110](#110)) ([7b50070](7b50070))
|
🎉 This PR is included in version 0.17.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What
Syncs generated types from inference-gateway/schemas at
v0.25.0and implements the new Audio API surface in the client.Generated types (schemas v0.25.0)
POST /audio/speechpath (createSpeech, tagAudio),SpeechNotSupportedresponse, andCreateSpeechRequestschema inopenapi.yamlCreateSpeechRequestmodel andEndpoints.speechfield ininference_gateway/models.py(generated viatask oas-sync SCHEMAS_REF=refs/tags/v0.25.0)Client implementation
InferenceGatewayClient.create_speech(model, input, voice, provider=None, instructions=None, response_format=None, speed=None, reference_audio=None, **kwargs) -> bytesCreateSpeechRequest, POSTs to/audio/speech; the optionalprovideris sent as a query parambytes(no JSON parsing; the response is binary, itsContent-Typereflectsresponse_format)response_format=mp3,speed=1)_make_requestInferenceGatewayAPIError(HTTP 400 per theSpeechNotSupportedresponse)CreateSpeechRequestexported frominference_gateway/__init__.pySkipped on purpose (ponytail): no streaming variant (the endpoint returns a single binary payload, not an SSE stream) and no examples/speech script; ask if one is wanted.
Tests
tests/test_client.py::test_create_speechmirrors the image tests: exact URL, params, JSON body, and binary response handlingtask test(36 passed, 1 xfailed) andtask lint(black, isort, mypy) passAlso annotates the request dicts in
create_response/create_response_streamasDict[str, Any]sotask lintstays green with newer mypy; no behavior change.Docs: inference-gateway/docs#616