-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: integrate system prompt * feat: add course waffle flag for content integration
- Loading branch information
Showing
19 changed files
with
243 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Toggles for learning-assistant app. | ||
""" | ||
|
||
WAFFLE_NAMESPACE = 'learning_assistant' | ||
|
||
# .. toggle_name: learning_assistant.enable_course_content | ||
# .. toggle_implementation: CourseWaffleFlag | ||
# .. toggle_default: False | ||
# .. toggle_description: Waffle flag to enable the course content integration with the learning assistant | ||
# .. toggle_use_cases: temporary | ||
# .. toggle_creation_date: 2024-01-08 | ||
# .. toggle_target_removal_date: 2024-01-31 | ||
# .. toggle_tickets: COSMO-80 | ||
ENABLE_COURSE_CONTENT = 'enable_course_content' | ||
|
||
|
||
def _is_learning_assistant_waffle_flag_enabled(flag_name, course_key): | ||
""" | ||
Import and return Waffle flag for enabling the summary hook. | ||
""" | ||
# pylint: disable=import-outside-toplevel | ||
try: | ||
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag | ||
return CourseWaffleFlag(f'{WAFFLE_NAMESPACE}.{flag_name}', __name__).is_enabled(course_key) | ||
except ImportError: | ||
return False | ||
|
||
|
||
def course_content_enabled(course_key): | ||
""" | ||
Return whether the learning_assistant.enable_course_content WaffleFlag is on. | ||
""" | ||
return _is_learning_assistant_waffle_flag_enabled(ENABLE_COURSE_CONTENT, course_key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ djangorestframework | |
edx-drf-extensions | ||
edx-rest-api-client | ||
edx-opaque-keys | ||
jinja2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.