Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically populate model inputs/outputs if applicable #254

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Jul 31, 2024

Description

This PR adds integration with ML commons optional model interfaces parameter. It is used in the MLProcessorInputs component in a few ways:

  1. Show a warning callout if the selected model does not have any associated model interface
  2. Dynamically render the input map / output map forms; if an interface is found, automatically populate available options for model inputs / model outputs. If no interface is found, leave as free-form text input fields.

More implementation details:

  • adds types/interfaces related to model interfaces
  • adds keyOptions / valueOptions as optional parameters in the map form components. In MapField, it is used to dynamically render a text input or select input based on an interface being found (see point 2 above). Consequentially, this means removing EuiFormControlLayoutDelimited component, and replacing with a flexible EuiFlexGroup. This is because EuiFormControlLayoutDelimited has rendering issues when using non-basic <inputs> components, such as the EuiComboBox we now optionally use
  • adds a SelectWithCustomOptions component for maintaining a list of available options, and the ability to add a custom option. This is now optionally used in MapField
  • updates MLProcessorInputs to maintain interface state; including whether or not one exists, and if so, what the model's inputs/outputs are. This state is propagated to the downstream child components for dynamic rendering based on this state
  • adds logic to persist any model interfaces on server-side, in server/routes/helpers.ts
  • propagates the input fields / output fields to the advanced transform modals for consistency

Demo video, showing how the form looks for a model with an interface, and without. The model with an interface automatically populates the maps' input fields and output fields based on the interface definition. The model without an interface has a warning modal, and free-form text inputs for configuring the input maps / output maps: (note: placeholders for the free-form text fields were added after video was recorded)

screen-capture.15.webm

Note: will have future PRs to automatically populate doc / query fields as well.

Issues Resolved

Makes progress on #23
Resolves #218

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@ohltyler ohltyler merged commit f17ba6a into opensearch-project:main Jul 31, 2024
6 checks passed
@ohltyler ohltyler deleted the model-interface branch July 31, 2024 18:40
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 31, 2024
ohltyler added a commit that referenced this pull request Jul 31, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit f17ba6a)

Co-authored-by: Tyler Ohlsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Workflow editor] Integrate with ML commons interface updates
2 participants