This PR adds integration with ML commons optional model interfaces parameter. It is used in the MLProcessorInputs component in a few ways:
Show a warning callout if the selected model does not have any associated model interface
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)
Note: will have future PRs to automatically populate doc / query fields as well.
Issues Resolved
Makes progress on #23
Resolves #218
Check List
[x] 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.
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.