Return decorative flag for generated alt text#659
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. |
|
@yusufhay Thanks for the PR. I see you've opened a number of recent PRs and it seems that none of them utilize our PR template. Can you update all of these to provide the information we request, see https://raw.githubusercontent.com/WordPress/ai/refs/heads/develop/.github/PULL_REQUEST_TEMPLATE.md. In particular, extremely useful to have the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #659 +/- ##
=============================================
+ Coverage 74.57% 74.68% +0.10%
Complexity 1754 1754
=============================================
Files 85 85
Lines 7548 7549 +1
=============================================
+ Hits 5629 5638 +9
+ Misses 1919 1911 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changed - Return a consistent decorative flag from alt text generation results Co-authored-by: yusufhay <yusufmudagal@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>
What?
Returns
is_decorative: falsefor non-decorative alt text generation results.Why?
The alt text ability output schema includes
is_decorativeas a boolean. The decorative-image path already returnsis_decorative: true, but the normal generated-alt-text path omitted the field. Returningfalsemakes the runtime response shape consistent with the schema and easier for consumers to handle.How?
Adds
is_decorative => falseto the non-decorative return value from the alt text generation ability. Adds an integration test with a test-only subclass that stubs image lookup and AI generation, then verifies the non-decorative response includesis_decorative: false.Use of AI Tools
AI assistance: Yes
Tool(s): Codex / ChatGPT
Model(s): GPT-5
Used for: Comparing the output schema with runtime return values, drafting the minimal response-shape fix, and adding focused test coverage. I reviewed the change and PR description before submitting.
Testing Instructions
is_decorative: false.is_decorative: truebehavior is unchanged.Screenshots or screencast
Not applicable. This PR does not change the UI.
Changelog Entry