Automatically populate model inputs/outputs if applicable #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds integration with ML commons optional model interfaces parameter. It is used in the
MLProcessorInputs
component in a few ways:More implementation details:
keyOptions
/valueOptions
as optional parameters in the map form components. InMapField
, 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 removingEuiFormControlLayoutDelimited
component, and replacing with a flexibleEuiFlexGroup
. This is becauseEuiFormControlLayoutDelimited
has rendering issues when using non-basic<inputs>
components, such as theEuiComboBox
we now optionally useSelectWithCustomOptions
component for maintaining a list of available options, and the ability to add a custom option. This is now optionally used inMapField
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 stateserver/routes/helpers.ts
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
--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.