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

Chatbot debug mode #1401

Merged
merged 3 commits into from
Nov 17, 2024
Merged

Chatbot debug mode #1401

merged 3 commits into from
Nov 17, 2024

Conversation

TamiTakamiya
Copy link
Contributor

@TamiTakamiya TamiTakamiya commented Nov 15, 2024

Jira Issue: https://issues.redhat.com/browse/AAP-35616

Description

Enable "debug" chatbot UI that allows end-user to pick up a model to be used. This time it only allows to use the default granite-8b model and the granite3-8b model, which was installed with AAP-35616,

image

This is enabled only when the chatbot UI is loaded with ?debug=true query parameter, e.g.

https://stage.ai.ansible.redhat.com/chatbot?debug=true

Testing

Steps to test

  1. Pull down the PR
  2. Run unit test

Scenarios tested

Unit tests are included

Production deployment

  • This code change is ready for production on its own
  • This code change requires the following considerations before going to production:

@TamiTakamiya TamiTakamiya force-pushed the TamiTakamiya/chatbot-debug-ui branch 4 times, most recently from e4e03cd to 7172009 Compare November 16, 2024 04:39
@TamiTakamiya TamiTakamiya force-pushed the TamiTakamiya/chatbot-debug-ui branch from 7172009 to 7ecb4d8 Compare November 16, 2024 04:44
@TamiTakamiya TamiTakamiya marked this pull request as ready for review November 16, 2024 04:54
Copy link
Contributor

@jameswnl jameswnl left a comment

Choose a reason for hiding this comment

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

How about having the debug switch set in backend? And so we can turn on for stage only

@TamiTakamiya
Copy link
Contributor Author

@jameswnl Updated the code to enable the debug UI via a setting (CHATBOT_DEBUG_UI). Also opened https://github.com/ansible/ansible-wisdom-ops/pull/1124 for enabling the debug UI in STAGE. Thanks.

manstis
manstis previously approved these changes Nov 16, 2024
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

IDK if you'd like @jameswnl to review ad he requested the changes.

@@ -136,6 +136,7 @@ def get_context_data(self, **kwargs):
user = self.request.user
if user and user.is_authenticated:
context["user_name"] = user.username
context["debug"] = "true" if settings.CHATBOT_DEBUG_UI == "true" else "false"
Copy link
Contributor

Choose a reason for hiding this comment

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

This could simply be context["debug"] = settings.CHATBOT_DEBUG_UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your comment. This code was wrong because settings.CHATBOT_DEBUG_UI is boolean and cannot have "true" as a value... I have fixed it in the newest commit.

Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@TamiTakamiya TamiTakamiya merged commit 20de6ca into main Nov 17, 2024
13 checks passed
@TamiTakamiya TamiTakamiya deleted the TamiTakamiya/chatbot-debug-ui branch November 17, 2024 00:06
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