Skip to content

Commit

Permalink
os pack
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshk-18 committed Jul 30, 2023
1 parent 92aac42 commit 37480c5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions chatgptxblock/chatgptxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
import requests
import pkg_resources
import openai
import os
from xblock.core import XBlock
from xblock.fields import Integer, String, Scope
from xblock.fragment import Fragment
from xblockutils.studio_editable import StudioEditableXBlockMixin
import yaml

# import yaml
# with open("/Users/lokeshk/Library/Application Support/tutor/config.yml", "r") as file:
# config_data = yaml.safe_load(file)
# openai_key = config_data.get("OPENAI_KEY")
# print(openai_key)

# from .common import (get_xblock_settings)
# xblock_settings = get_xblock_settings()

class ChatgptXBlock(StudioEditableXBlockMixin, XBlock):

with open("/Users/lokeshk/Library/Application Support/tutor/config.yml", "r") as file:
config_data = yaml.safe_load(file)
openai_key = config_data.get("OPENAI_KEY")
openai_key=os.environ.get('OPENAI_KEY')
print(openai_key)
# xblock_settings = get_xblock_settings()

# Define the fields of the XBlock
display_name = String(
display_name="Display Name",
Expand Down

0 comments on commit 37480c5

Please sign in to comment.