Skip to content

Commit

Permalink
openai changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshk-18 committed Jul 21, 2023
1 parent b92dde9 commit d1d6e75
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions chatgptxblock/chatgptxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,19 @@
from xblock.fragment import Fragment
from xblockutils.studio_editable import StudioEditableXBlockMixin
from .common import (get_xblock_settings)
# from tutor import config
# print(config.XBLOCK_SETTINGS)
# print(config.XBLOCK_SETTINGS.get("xblocks-chatgpt", {}).get("display_name"))
# d_name=config.XBLOCK_SETTINGS.get("xblocks-chatgpt", {}).get("display_name")
from django.conf import settings

class ChatgptXBlock(StudioEditableXBlockMixin, XBlock):
# xblock_settings = get_xblock_settings()
xblock_settings = get_xblock_settings()
# Define the fields of the XBlock
with open('/Users/lokeshk/chat-config/config.yml', 'r') as config_file:
config = yaml.safe_load(config_file)
xblock_settings = config.get('XBLOCK_SETTINGS', {}).get('xblocks-chatgpt', {})
print(xblock_settings)
print(config.get('XBLOCK_SETTINGS', {}))

d_name=settings.OPENAI_SECRET_KEY
print(d_name)
display_name = String(
display_name="Display Name",
help="Display name for this module",
default=xblock_settings.get("display_name"),
# default=xblock_settings.get("display_name"),
default=d_name,
scope=Scope.settings,
)

Expand Down

0 comments on commit d1d6e75

Please sign in to comment.