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

Enhanced Placeholder Configuration in LibreChat Prompt Library #3618

Conversation

kmeshcheryakov
Copy link
Contributor

Summary

This pull request introduces enhanced placeholder configuration options for the LibreChat Prompt Library. The changes allow for multiline input fields, dropdown lists with custom input options, and the ability to change the order of placeholder fields on the prompt screen. This feature aims to improve the flexibility and usability of prompts, enabling users to create more sophisticated and tailored prompt templates.

Change Type

  • [ X ] New feature (non-breaking change which adds functionality)
  • [ X ] This change requires a documentation update

Testing

To test this feature:

  1. Create a new prompt in the Prompt Library with various placeholder types:

    • Simple text input: {{name}}
    • Multiline text input: {{description:multiline}}
    • Dropdown with options: {{tone:formal|casual|business casual}}
  2. Save the prompt and verify that the placeholder configuration is stored correctly.

  3. Use the prompt and check if the input form displays the correct field types:

    • Single-line input for {{name}}
    • Multiline input for {{description}}
    • Dropdown (with custom input option) for {{tone}}
  4. Verify that the order of placeholders in the input form matches the order in the prompt.

  5. Test edge cases:

    • Very long dropdown option lists
    • Nested placeholders (if supported)
    • Special characters in placeholder names and options

Test Configuration:

  • Tested on the latest main branch of LibreChat
  • Tested with various browsers (Chrome, Firefox)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules
  • A pull request for updating the documentation has been submitted

@danny-avila
Copy link
Owner

Continued in #3681

I updated the styling/accessibility/localizations.

Also added new details on the dropdown variable, in the variables info section. Combined also with the markdown PR due to merge conflicts this would create.

Multiline text input: {{description:multiline}}

I opted to remove this for simplicity's sake, because the textarea can be resized for regular text inputs, and it should be the case if variables will take up a whole row width now.

@bsu3338
Copy link
Contributor

bsu3338 commented Aug 18, 2024

Thanks for working on this, but I am having an issue with the multi-select option. It seems to be putting the option I choose, multiple times in the prompt. However, the setting looks correct in the preview before the Submit button selected.

Prompt Creation:
image

Prompt in Conversation:
image

Prompt Submission:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants