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

WIP 🚀 feat: Add Custom Welcome Message Support in LibreChat #5870

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 14, 2025

Summary

This update introduces support for a customizable welcome message, allowing users to configure a greeting via the .env file. This enhancement improves branding and user experience.

Closes: #2967
Docs: LibreChat-AI/librechat.ai#236

Changes Made

  • Environment Variable Update:
    • Added CUSTOM_WELCOME_MESSAGE in .env.example.
  • Backend Update:
    • Updated api/server/routes/config.js to read CUSTOM_WELCOME_MESSAGE from the environment variables and include it in the startup config payload.
  • Frontend Update:
    • Refactored client/src/components/Chat/Landing.tsx to use the new CUSTOM_WELCOME_MESSAGE from the startup config.
    • Improved logic for computing assistant/agent welcome messages.
    • Minor code optimizations in Landing.tsx for better readability.
  • Type Update:
    • Updated TStartupConfig in packages/data-provider/src/config.ts to include customWelcomeMessage.

Motivation and Context

This change allows platform administrators to define a customized greeting that appears when users access the chat interface. The goal is to improve engagement and provide a tailored experience.

Dependencies

  • No new dependencies introduced.

Change Type

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

Testing

Test Process

  1. Backend:

    • Start the server with a .env file including CUSTOM_WELCOME_MESSAGE="Welcome to LibreChat!".
    • Send a request to /api/startup-config and verify that customWelcomeMessage is included in the response.
  2. Frontend:

    • Load the chat interface and confirm that the welcome message displays correctly.
    • Test scenarios where CUSTOM_WELCOME_MESSAGE is missing or empty to ensure fallback messages still work.
    • Check assistant and agent welcome messages to verify no regressions.

Test Configuration

  • Local testing in Chrome & Safari

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.
  • My changes do not introduce new warnings.
  • I have written tests demonstrating that my changes are effective.
  • Local unit tests pass with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@rubentalstra rubentalstra added the ✨ enhancement New feature or request label Feb 14, 2025
@rubentalstra rubentalstra self-assigned this Feb 14, 2025
@rubentalstra rubentalstra marked this pull request as draft February 14, 2025 10:30
rubentalstra added a commit to rubentalstra/librechat.ai that referenced this pull request Feb 14, 2025
@rubentalstra rubentalstra marked this pull request as ready for review February 14, 2025 10:42
@danny-avila
Copy link
Owner

Thanks! Small nitpick but this would be really nice as part of the librechat.yaml instead of .env. Forward thinking, this would allow setting custom greetings at the user/role level, as mappings for all those settings will be possible.

@rubentalstra
Copy link
Collaborator Author

for sure. going to update the code to do that. it's just a minor change.

@rubentalstra rubentalstra marked this pull request as draft February 14, 2025 14:31
@rubentalstra rubentalstra changed the title 🚀 feat: Add Custom Welcome Message Support in LibreChat WIP 🚀 feat: Add Custom Welcome Message Support in LibreChat Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Custom Welcome Message
2 participants