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: Gates the chat history endpoint behind a waffle flag #137

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

rijuma
Copy link
Member

@rijuma rijuma commented Nov 22, 2024

Currently, the only logic for the chat history behind the feature flag learning_assistant.enable_chat_history is the saving of the messages.

If we want to disable the feature, the chats are no longer being saved but the existing ones will still be returned by the learning Assistant Message History endpoint.

This update makes sure that if the flag for the chat history is disabled, the endpoint would just return an empty list.

Copy link

github-actions bot commented Nov 22, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  learning_assistant
  __init__.py
  views.py
Project Total  

This report was generated by python-coverage-comment-action

@rijuma rijuma force-pushed the rijuma/gate-chat-history branch from eb18d27 to 010052e Compare November 22, 2024 16:38
@rijuma rijuma marked this pull request as ready for review November 22, 2024 16:50
Copy link
Member

@varshamenon4 varshamenon4 left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -247,6 +247,10 @@ def get(self, request, course_run_id):
data={'detail': 'Learning assistant not enabled for course.'}
)

# If chat history is disabled, we return no messages as response.
if not chat_history_enabled(courserun_key):
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@rijuma rijuma merged commit dcf45e2 into main Nov 22, 2024
4 checks passed
@rijuma rijuma deleted the rijuma/gate-chat-history branch November 22, 2024 17:07
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.

2 participants