From 208acd7d019759efc825491b2b21610865177d41 Mon Sep 17 00:00:00 2001 From: saleem-latif Date: Fri, 25 Aug 2023 05:42:36 +0000 Subject: [PATCH 1/2] feat: Upgrade Python dependency edx-enterprise Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/saleem-latif/ENT-7362` --- requirements/constraints.txt | 2 +- requirements/edx/base.txt | 13 ++++++++++--- requirements/edx/development.txt | 10 +++++++++- requirements/edx/doc.txt | 9 ++++++++- requirements/edx/testing.txt | 9 ++++++++- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 683a8a2799..64b4f92a67 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -28,7 +28,7 @@ django-storages==1.9.1 # The team that owns this package will manually bump this package rather than having it pulled in automatically. # This is to allow them to better control its deployment and to do it in a process that works better # for them. -edx-enterprise==4.0.18 +edx-enterprise==4.1.0 # 1. django-oauth-toolkit version >=2.0.0 has breaking changes. More details # mentioned on this issue https://github.com/openedx/edx-platform/issues/32884 diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index abe4caa40a..4c02ea6144 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -7,7 +7,9 @@ acid-xblock==0.2.1 # via -r requirements/edx/kernel.in aiohttp==3.8.5 - # via geoip2 + # via + # geoip2 + # openai aiosignal==1.3.1 # via aiohttp algoliasearch==2.6.3 @@ -479,7 +481,7 @@ edx-drf-extensions==8.9.1 # edx-when # edxval # openedx-learning -edx-enterprise==4.0.18 +edx-enterprise==4.1.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/kernel.in @@ -751,6 +753,8 @@ oauthlib==3.2.2 # social-auth-core olxcleaner==0.2.1 # via -r requirements/edx/kernel.in +openai==0.27.9 + # via edx-enterprise openedx-blockstore==1.4.0 # via -r requirements/edx/kernel.in openedx-calc==3.0.1 @@ -987,6 +991,7 @@ requests==2.31.0 # edx-rest-api-client # geoip2 # mailsnake + # openai # optimizely-sdk # pyjwkest # pylti1p3 @@ -1121,7 +1126,9 @@ tinycss2==1.1.1 tomlkit==0.12.1 # via snowflake-connector-python tqdm==4.66.1 - # via nltk + # via + # nltk + # openai typing-extensions==4.7.1 # via # -r requirements/edx/paver.txt diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 516fdbf846..e02e6f0c67 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -17,6 +17,7 @@ aiohttp==3.8.5 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # geoip2 + # openai aiosignal==1.3.1 # via # -r requirements/edx/doc.txt @@ -746,7 +747,7 @@ edx-drf-extensions==8.9.1 # edx-when # edxval # openedx-learning -edx-enterprise==4.0.18 +edx-enterprise==4.1.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/doc.txt @@ -1268,6 +1269,11 @@ olxcleaner==0.2.1 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt +openai==0.27.9 + # via + # -r requirements/edx/doc.txt + # -r requirements/edx/testing.txt + # edx-enterprise openedx-blockstore==1.4.0 # via # -r requirements/edx/doc.txt @@ -1728,6 +1734,7 @@ requests==2.31.0 # edx-rest-api-client # geoip2 # mailsnake + # openai # optimizely-sdk # pact-python # pyjwkest @@ -2035,6 +2042,7 @@ tqdm==4.66.1 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # nltk + # openai types-pytz==2023.3.0.1 # via django-stubs types-pyyaml==6.0.12.11 diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index 658ae0091c..2346a5ca26 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -12,6 +12,7 @@ aiohttp==3.8.5 # via # -r requirements/edx/base.txt # geoip2 + # openai aiosignal==1.3.1 # via # -r requirements/edx/base.txt @@ -554,7 +555,7 @@ edx-drf-extensions==8.9.1 # edx-when # edxval # openedx-learning -edx-enterprise==4.0.18 +edx-enterprise==4.1.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt @@ -890,6 +891,10 @@ oauthlib==3.2.2 # social-auth-core olxcleaner==0.2.1 # via -r requirements/edx/base.txt +openai==0.27.9 + # via + # -r requirements/edx/base.txt + # edx-enterprise openedx-blockstore==1.4.0 # via -r requirements/edx/base.txt openedx-calc==3.0.1 @@ -1171,6 +1176,7 @@ requests==2.31.0 # edx-rest-api-client # geoip2 # mailsnake + # openai # optimizely-sdk # pyjwkest # pylti1p3 @@ -1377,6 +1383,7 @@ tqdm==4.66.1 # via # -r requirements/edx/base.txt # nltk + # openai typing-extensions==4.7.1 # via # -r requirements/edx/base.txt diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 353752bf9e..3249522c2e 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -10,6 +10,7 @@ aiohttp==3.8.5 # via # -r requirements/edx/base.txt # geoip2 + # openai aiosignal==1.3.1 # via # -r requirements/edx/base.txt @@ -583,7 +584,7 @@ edx-drf-extensions==8.9.1 # edx-when # edxval # openedx-learning -edx-enterprise==4.0.18 +edx-enterprise==4.1.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt @@ -959,6 +960,10 @@ oauthlib==3.2.2 # social-auth-core olxcleaner==0.2.1 # via -r requirements/edx/base.txt +openai==0.27.9 + # via + # -r requirements/edx/base.txt + # edx-enterprise openedx-blockstore==1.4.0 # via -r requirements/edx/base.txt openedx-calc==3.0.1 @@ -1305,6 +1310,7 @@ requests==2.31.0 # edx-rest-api-client # geoip2 # mailsnake + # openai # optimizely-sdk # pact-python # pyjwkest @@ -1504,6 +1510,7 @@ tqdm==4.66.1 # via # -r requirements/edx/base.txt # nltk + # openai typing-extensions==4.7.1 # via # -r requirements/edx/base.txt From 4136147d5886b367bb076acfb080399f677bd228 Mon Sep 17 00:00:00 2001 From: Saleem Latif Date: Fri, 25 Aug 2023 10:19:47 +0500 Subject: [PATCH 2/2] chore: Added new settings required by edx-enterprise latest version. --- cms/envs/common.py | 7 +++++++ cms/envs/production.py | 8 ++++++++ lms/envs/common.py | 7 +++++++ lms/envs/production.py | 9 +++++++++ 4 files changed, 31 insertions(+) diff --git a/cms/envs/common.py b/cms/envs/common.py index 543f481b38..e799613371 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -780,6 +780,13 @@ ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = {} +# Setting for Open API key and prompts used by edx-enterprise. +OPENAI_API_KEY = '' +LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT = '' +LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT = '' +LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT = '' +LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT = '' + # Public domain name of Studio (should be resolvable from the end-user's browser) CMS_BASE = 'localhost:18010' diff --git a/cms/envs/production.py b/cms/envs/production.py index 9acdd9748e..401cca648d 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -166,6 +166,14 @@ ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', LMS_INTERNAL_ROOT_URL + '/consent/api/v1/') # Note that FEATURES['PREVIEW_LMS_BASE'] gets read in from the environment file. +OPENAI_API_KEY = ENV_TOKENS.get('OPENAI_API_KEY', '') +LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT', '') +LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT = ENV_TOKENS.get( + 'LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT', + '' +) +LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT', '') +LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT', '') # List of logout URIs for each IDA that the learner should be logged out of when they logout of # Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit). diff --git a/lms/envs/common.py b/lms/envs/common.py index 26a4dafded..a2666d3d67 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4616,6 +4616,13 @@ ENTERPRISE_ALL_SERVICE_USERNAMES = [ 'subscriptions_worker' ] +# Setting for Open API key and prompts used by edx-enterprise. +OPENAI_API_KEY = '' +LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT = '' +LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT = '' +LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT = '' +LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT = '' + ############## ENTERPRISE SERVICE LMS CONFIGURATION ################################## # The LMS has some features embedded that are related to the Enterprise service, but diff --git a/lms/envs/production.py b/lms/envs/production.py index d5404c9cff..48554b9d09 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -926,6 +926,15 @@ ENTERPRISE_CATALOG_INTERNAL_ROOT_URL = ENV_TOKENS.get( ENTERPRISE_CATALOG_INTERNAL_ROOT_URL ) +OPENAI_API_KEY = ENV_TOKENS.get('OPENAI_API_KEY', '') +LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_ENGAGEMENT_PROMPT_FOR_ACTIVE_CONTRACT', '') +LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT = ENV_TOKENS.get( + 'LEARNER_ENGAGEMENT_PROMPT_FOR_NON_ACTIVE_CONTRACT', + '' +) +LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_PROGRESS_PROMPT_FOR_ACTIVE_CONTRACT', '') +LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT = ENV_TOKENS.get('LEARNER_PROGRESS_PROMPT_FOR_NON_ACTIVE_CONTRACT', '') + ############## ENTERPRISE SERVICE LMS CONFIGURATION ################################## # The LMS has some features embedded that are related to the Enterprise service, but # which are not provided by the Enterprise service. These settings override the