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

fix: add "hello there" to introductory words list for better greeting… #198

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AritraDey-Dev
Copy link

@AritraDey-Dev AritraDey-Dev commented Jan 29, 2025

Fixes Issue 🛠️

Closes #166

Description 👨‍💻

Added "hello there" to the list of introductory words in the INTRO_WORDS array to ensure the chatbot detects the phrase and responds appropriately. This improves the chatbot’s greeting functionality, particularly for users typing "hello there".

Type of Change 📄

  • Bug fix (non-breaking change which fixes a bug)
  • New feature (non-breaking change which adds functionality)
  • Style (non-breaking change which improves website style or formatting)
  • Documentation (non-breaking change which updates or adds documentation)
  • Responsiveness (non-breaking change which improves UI/UX on different screen sizes)

Checklist ✅

  • I am an Open Source contributor
  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas

Screenshots/GIF 📷

N/A (No UI changes, functionality improvement only)


Copy link

vercel bot commented Jan 29, 2025

@AritraDey-Dev is attempting to deploy a commit to the Pratik0112's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AritraDey-Dev, Welcome to 💖TelMedSphere !!! 🎊
Thanks for raising a PR! Your effort makes this project better. 🙌
Please wait for the PR to be reviewed.
Happy Coding!! ✨

@AdityaBavadekar
Copy link
Collaborator

Hi @AritraDey-Dev, you have update the INTRO_WORDS list which could improve the responses but it will still not fix the issue.
The issue can be fixed by adding a system prompt to the messages initially itself that will provide the model with instruction on how to response and the overall context. This could be done by adding an instruction message at first index in the messages just before sending the messages to the API.

@AdityaBavadekar
Copy link
Collaborator

Refer processMessageToGemini method, in this method you can add a instruction prompt message at first index.

@AritraDey-Dev
Copy link
Author

Hi @AdityaBavadekar , I’ve implemented the suggested change by adding a system prompt as the first message in the array. This will now provide the model with the necessary context and instructions for more accurate and relevant responses. Let me know if there are any further improvements needed!

}

const updatedMessages = [...messages, newMessage];
const updatedMessages = [systemMessage, ...messages, newMessage];
Copy link
Collaborator

@AdityaBavadekar AdityaBavadekar Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it will be added to updatedMessages directly it will be displayed in UI chat box, but the system message is just for model context and not for the UI.

That is why I suggested to add it in chatMessages from processMessageToGemini method.

@AdityaBavadekar
Copy link
Collaborator

Test the changes locally also.

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.

[Bug] Incorrect Response of TelMedBot to user queries
3 participants