Skip to content

Commit

Permalink
runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshk-18 committed Jul 23, 2023
1 parent a60d287 commit 824dbb2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions chatgptxblock/chatgptxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ class ChatgptXBlock(StudioEditableXBlockMixin, XBlock):
# d_name=settings.DISPLAY_NAME
# print("hi",Scope)
# def api_init(self, context=None):
xblock_config = runtime.handler_env['xblock'].runtime.get_user_state('XBLOCK_CONFIG')
a_key = xblock_config.get('OPENAI_KEY')
print(a_key)
# xblock_config = self.runtime.handler_env['xblock'].runtime.get_user_state('XBLOCK_CONFIG')
# a_key = xblock_config.get('OPENAI_KEY')
# print(a_key)
# api_init(self)
def __init__(self, *args, **kwargs):
# Call the superclass' __init__ method first
super(ChatgptXBlock, self).__init__(*args, **kwargs)

# Accessing the configuration data from XBlock runtime
xblock_config = self.runtime.handler_env['xblock'].runtime.get_user_state('XBLOCK_CONFIG')
a_key = xblock_config.get('OPENAI_KEY')
print(a_key)
display_name = String(
display_name="Display Name",
help="Display name for this module",
Expand Down

0 comments on commit 824dbb2

Please sign in to comment.