add a prompt library creator/editor #1959
Merged
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.
Closes #1838
This pull request introduces a new feature for managing validation prompt libraries, including backend API endpoints, service logic, and frontend integration. It also includes minor CSS adjustments and UI enhancements for modal overlays. The most significant changes are the addition of a prompt library management service and API, updates to the environments tab to support prompt library operations, and improvements to the overall user interface.
Prompt Library Management (Backend):
PromptLibraryServiceinprompt_library_service.pyto handle CRUD operations for prompt library JSON files, including validation, normalization, and metadata extraction.routes/prompt_libraries.pyproviding endpoints to list, read, and save prompt libraries, with error handling and data validation.Integration with Tab Service and UI Context:
tab_service.pyto load prompt library metadata for the validation and environments tabs, making the data available to the frontend and handling errors gracefully. [1] [2] [3]Frontend Enhancements (Environments Tab):
UI and CSS Improvements:
Other Minor Changes:
custom_componentfield for prompt library path selection in validation field registration.asdictto support serialization of dataclasses.These changes collectively enable robust management of validation prompt libraries within the application, enhancing both backend flexibility and frontend usability.