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

Add Feedback Buttons on Chat #721

Merged
merged 10 commits into from
May 20, 2024

Conversation

MythicalCow
Copy link
Contributor

Description and Rationale for Changes

This feature includes thumbs up and thumbs down buttons on Khoj's chat responses that provide automated feedback. When a thumbs up/down button is clicked, the code sends an email to team@khoj.dev with the following:

  • user query
  • khoj's response
  • whether the sentiment of the user was good or bad.

This is critical in improving Khoj's nondeterministic LLM model for a better user experience.

List of Changes

  • new endpoint in api_chat.py (/feedback) that can be used to trigger mail sending).
  • thumbs up and thumbs down buttons implemented in chat.html
  • new function in routers/email.py to handle feedback email sending via resend
  • feedback.html template for a formatted email with the feedback.

Demo Images

Screenshot from 2024-04-22 20-01-52
Screenshot 2024-04-23 142314

@sabaimran sabaimran changed the title New Feature - Feedback Buttons on Chat Add Feedback Buttons on Chat Apr 24, 2024
Copy link
Collaborator

@sabaimran sabaimran left a comment

Choose a reason for hiding this comment

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

This is awesome! It'll be super useful being able to collect in-app feedback. Just a few comments, but the structure is great.

src/khoj/interface/web/chat.html Outdated Show resolved Hide resolved
src/khoj/interface/web/chat.html Outdated Show resolved Hide resolved
src/khoj/processor/conversation/prompts.py Show resolved Hide resolved
src/khoj/routers/api_chat.py Outdated Show resolved Hide resolved
src/khoj/routers/email.py Outdated Show resolved Hide resolved
src/khoj/routers/email.py Outdated Show resolved Hide resolved
src/khoj/routers/email.py Outdated Show resolved Hide resolved
src/khoj/routers/api_chat.py Outdated Show resolved Hide resolved
src/khoj/routers/email.py Outdated Show resolved Hide resolved
src/khoj/routers/email.py Show resolved Hide resolved
@sabaimran sabaimran merged commit d57772f into khoj-ai:master May 20, 2024
7 checks passed
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.

None yet

2 participants