Add support for text to speech conversion - #42
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
superdav42
left a comment
There was a problem hiding this comment.
Requesting one change before merge:
src/Models/OpenAiTextToSpeechConversionModel.php:213: an empty successful response is malformed provider output, but this branch throwsCommon\Exception\InvalidArgumentException, which represents bad caller input. The SDK reservesProviders\Http\Exception\ResponseExceptionfor unexpected or malformed provider responses, and the existing response parsers in this repository useResponseException::fromMissingData(). The current exception type can make consumers misclassify the failure and skip their provider-error handling or retry path. Please throw aResponseExceptionhere (for example, for a missing response body) and add a focused regression test that passes an empty 2xx body.
Verification: reviewed head 954aa2e; PHP syntax and PHPCS pass for all three changed files against locked wordpress/php-ai-client 1.3.1.
…ion when the LLM returns no response
Good idea, updated in e5ac5a3
Right now this plugin has no tests which is why I didn't add any as part of this PR. It seems like a separate PR would be better to get test harness in place but let me know if you'd like all of this in this PR instead |
What?
Adds support for text to speech conversion
Why?
We currently have a
TODOstatement around adding support for text to speech so this PR implements that. This allows others to build out text to speech systems using this provider plugin.How?
OpenAiTextToSpeechConversionModelthat handles all requests to convert text to speechUse of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.8
Used for: Putting together a plan and executing on that plan. Plan reviewed and modified by me and all code was reviewed and tested by me
Testing Instructions
Hard to test on it's own as this plugin provides functionality but doesn't actually do anything with that. Easiest approach is the following:
Changelog Entry