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

Support inserting template vars at cursor position; improve RAG preset #526

Merged
merged 7 commits into from
Dec 12, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Dec 12, 2024

Description

Mixed-bag PR, includes the following:

  • changes the variable insertion in the template from a copy/paste flow, to a single "insert" flow. Cursor position is persisted in the prompt code editor, and when users click "insert" on a particular template var, the formatted var is injected at such position. Further improvements to help automate these things, as well as better & more prompt templates, will come in the future when those flows are finalized and UX feedback is gathered.
  • improves the RAG quick-configure presets to follow the new pattern of a model expecting a single 'prompt' field. This is defined in quick create, and used alongside any contextual field (so far, the "text field") and automatically attach as a template variable.'
  • improves default transform types for the input / output transforms, and doesn't leave them as empty like before
  • minor spacing improvements in the Configure Prompt modal
  • NPE check which can be triggered if server-side returns 500s on Workflow List page
  • filters out register-agent-related workflows on the Workflow List page
  • provides better messaging if resource fetching for a particular workflow (e.g., custom, no ui_metadata found, etc.) when opening the flyout on the Workflow List page

Demo video covering most of the changes listed above:

screen-capture.4.webm

Issues Resolved

N/A

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 changed the title Support inserting template vars at cursor position; other minor improvements Support inserting template vars at cursor position; improve RAG preset Dec 12, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
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.

LGTM

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.

LGTM

@saimedhi saimedhi merged commit b613ce3 into opensearch-project:main Dec 12, 2024
6 of 7 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 12, 2024
#526)

* Improve RAG preset prompt defaults

Signed-off-by: Tyler Ohlsen <[email protected]>

* Change prompt vars to insert at editor cursor position

Signed-off-by: Tyler Ohlsen <[email protected]>

* Fix spacing in configure prompt modal

Signed-off-by: Tyler Ohlsen <[email protected]>

* Improve default empty vals for input output map transforms

Signed-off-by: Tyler Ohlsen <[email protected]>

* handle npe; add check to block showing resources for custom workflow types

Signed-off-by: Tyler Ohlsen <[email protected]>

* add check to handle empty or missing ui_metadata

Signed-off-by: Tyler Ohlsen <[email protected]>

* fix UT

Signed-off-by: Tyler Ohlsen <[email protected]>

---------

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit b613ce3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
saimedhi pushed a commit that referenced this pull request Dec 12, 2024
#526) (#527)

* Improve RAG preset prompt defaults



* Change prompt vars to insert at editor cursor position



* Fix spacing in configure prompt modal



* Improve default empty vals for input output map transforms



* handle npe; add check to block showing resources for custom workflow types



* add check to handle empty or missing ui_metadata



* fix UT



---------


(cherry picked from commit b613ce3)

Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ohltyler ohltyler deleted the improve-template-vars branch December 12, 2024 16:43
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.

2 participants