Skip to content

Expose model capabilities#227

Draft
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:feat/expose_modal_caps
Draft

Expose model capabilities#227
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:feat/expose_modal_caps

Conversation

@sarthak-19
Copy link
Copy Markdown

@sarthak-19 sarthak-19 commented Apr 12, 2026

Summary

Closes #226 Expose model input/output modality capabilities at runtime.

Currently there is no ergonomic way to ask a model instance which input and output modalities it accepts. Developers had to guess from model names ("transcribe", "audio", etc.) or dig through raw SupportedOption objects — both fragile approaches.

This PR adds three first-class methods to ModelInterface and implements them in AbstractApiBasedModel:

// Returns all supported input/output modality enums
$model->getCapabilities();
/*
[
  'input'  => [ModalityEnum::text(), ModalityEnum::image()],
  'output' => [ModalityEnum::text()],
]
*/

// Simple boolean helpers
$model->supportsInput(ModalityEnum::text());   // true
$model->supportsInput(ModalityEnum::audio());  // false
$model->supportsOutput(ModalityEnum::text());  // true
$model->supportsOutput(ModalityEnum::image()); // false
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.21%. Comparing base (6317042) to head (3655406).

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #227      +/-   ##
============================================
+ Coverage     88.12%   88.21%   +0.08%     
- Complexity     1213     1227      +14     
============================================
  Files            60       60              
  Lines          3934     3964      +30     
============================================
+ Hits           3467     3497      +30     
  Misses          467      467              
Flag Coverage Δ
unit 88.21% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant