Add dedicated prompt configuration for ML search resp processors #389
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
Adds a dedicated section and modal for optionally configuring a prompt. Only exposing in the search response context, as that is the most likely place users will be setting it up. Can easily be enabled for other contexts if wanted later on. The dedicated modal has 3 main parts: 1/ dropdown with prompt template presets for users to select from, 2/ the user-editable text editor that displays the prompt, and 3/ the list of model inputs (and corresponding placeholder strings) that users can copy/paste, in order to insert these dynamic values into the template at runtime (this part is omitted if no input interface found). A common example of this, is passing returned documents as context in the prompt template for some LLM to answer a question with / summarize/ etc.
Implementation details:
MLProcessorInputs
to include a new section to configure the prompt and render the modal if clickedConfigurePromptModal
component to handle the user interactions and configuration as described above. any updates to the prompt will be reflected in the form, by updating theprompt
sub-field under the model config form field.modals
moduletouched
check when selecting a new query, so the save button is enabled immediately when changed (if nothing else is dirty)text
field index mapping by defaultDemo video, showing a new RAG use case with no prompt template. Shows configuration of the template using a preset, also including the dynamic
context
input to be injected into the template. The full example with injected inputs is available to view when configuring the input transform. When running, the results are as expected, containing a readable summary of the results found.screen-capture.1.webm
Issues Resolved
Resolves #380
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.