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

Add dedicated UX for query template building (ML search req processors) #407

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Oct 2, 2024

Description

This PR improves the UX for query configuration/overriding the query via a query_template field exposed in the ML search request processors. This is a common pattern for vector search use cases, to generate a valid knn query, injecting the returned vector embedding directly into the new query. Before, this was nested under 'Advanced settings', under 'Query template'. Now, we add a dedicated modal similar to prompt-building for this particular scenario.

More details

  • adds a 'Override query' option for ML search req processors only
  • supports preset selection, the same as the base query configuration (one difference, is once a preset is selected, we sanitize to be in a proper templated format, since the value here is a template rather than a string)
  • similar to the prompt modal, we expose some model configuration. In this case, the model outputs. Note we dynamically generate the list based on the presence of a configured output map or not. If there is an output map, then pull the keys (the transformed/new outputs) as available options to inject in the template. If there is no output map, then pull the model outputs from the interface directly, as this implies no further transformation is needed
  • minor: adds some helper text in the configure prompt modal
  • bug fix of back button disabled when skipping ingest altogether

Demo video, showing the new modal, and the various options shown under "Model outputs" based on any output map configuration.

screen-capture.7.webm

Issues Resolved

Resolves #404
Resolves #407

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.

Copy link
Collaborator

@saimedhi saimedhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, Looks good to me. Thank you Tyler.

@ohltyler ohltyler merged commit 228735e into opensearch-project:main Oct 3, 2024
6 checks passed
@ohltyler ohltyler deleted the updates-3 branch October 3, 2024 16:31
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 3, 2024
…s) (#407)

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 228735e)
ohltyler added a commit that referenced this pull request Oct 3, 2024
…s) (#407) (#408)

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

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.

Improve query template building experience
2 participants