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

Set default outputs and display schema based on full_response_path #382

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

ohltyler
Copy link
Member

Description

ML inference processors parse out the response differently depending on if full_response_path is true or not. The model interfaces will always include the full path. To help abstract this on the UI, we can implement the same parsing logic to get to the nested model output data when full_response_path=false. This way, it is consistent across the interface, and the configured output map configuration. The path to get such nested data is inference_results[0].output[0].dataAsMap.

More details:

  • only displays preset options for model outputs when full_response_path=false. Else, it will not be useful, as the path would always start with inference_results arr, and users would need to write full JSON path here to get to the nested data they want
  • adds a "View output schema" button that is visible when a model output interface is defined. Shows the full interface, or the nested interface, depending on if full_response_path is true/false, respectively.

Demo video, showing a model with an output interface. The nested interface in dataAsMap includes a single response field as a string. When full_response_path=false, we show the model output options in a dropdown, and show the nested interface. When full_response_path=true, we leave the model output field as freeform text w/ no options, and show the whole nested interface.

screen-capture.23.webm

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.

@saimedhi saimedhi merged commit 68a152d into opensearch-project:main Sep 17, 2024
11 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 17, 2024
saimedhi pushed a commit that referenced this pull request Sep 17, 2024
… (#384)

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 68a152d)

Co-authored-by: Tyler Ohlsen <[email protected]>
@ohltyler ohltyler deleted the interfaces-5 branch September 17, 2024 16:15
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.

3 participants