From 5c1466e8f5fe5e106a93bd4e8b3ae53e10c1749a Mon Sep 17 00:00:00 2001 From: lokeshk-incresco Date: Sun, 23 Jul 2023 16:35:33 +0530 Subject: [PATCH] runtime --- chatgptxblock/chatgptxblock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chatgptxblock/chatgptxblock.py b/chatgptxblock/chatgptxblock.py index daa8bf6..c96f30b 100644 --- a/chatgptxblock/chatgptxblock.py +++ b/chatgptxblock/chatgptxblock.py @@ -30,8 +30,8 @@ def __init__(self, *args, **kwargs): # Accessing the configuration data from XBlock runtime xblock_config = self.runtime.handler_env['xblock'].runtime.get_user_state('XBLOCK_CONFIG') - this.a_key = xblock_config.get('OPENAI_KEY') - print(this.a_key) + self.a_key = xblock_config.get('OPENAI_KEY') + print(self.a_key) display_name = String( display_name="Display Name", help="Display name for this module", @@ -52,7 +52,7 @@ def __init__(self, *args, **kwargs): ) api_key = String( - default=this.a_key, + default=a_key, scope=Scope.settings, help="Your OpenAI API key, which can be found at https://platform.openai.com/account/api-keys", )