Meet the ChatGPT XBlock for the Open edX® LMS

Hi, I’m Dean from ABC Online Courses. We are always striving to enhance the learning experience for our clients and other community members using the Open edX® platform. That’s why we are excited to announce our newest development: the XBlock that runs ChatGPT inside your online courses!

If you’ve ever used Khan Academy, you may be familiar with the ChatGPT feature. It’s an innovative way to learn online, where you can ask questions to an AI-powered (artificial intelligence) chatbot that can provide answers to a wide range of topics. Now, we’re bringing that same technology to our Open edX® online courses, allowing our clients to benefit from this cutting-edge learning tool.

What is ChatGPT?

ChatGPT is an AI-powered chatbot that uses natural language processing to understand and respond to questions. It’s based on the GPT-3 language model, which has been trained on a massive dataset of human language, allowing it to generate responses that are both accurate and human-like. OpenAI, the company behind ChatGPT, has trained ChatGPT to interact in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests.

With ChatGPT, learners can ask questions about any topic covered in the course and receive instant answers. Whether the learner is struggling to understand a concept or simply wants to clarify something, ChatGPT is there to help.

How does it work?

The ChatGPT XBlock is integrated as a component into Open edX® online courses at the unit level, so learners can access it directly from the course interface. A learner simply inputs a question and clicks the Submit button. ChatGPT will then analyze the question and provide a response based on its understanding of the topic, and as it’s powered by AI it can provide answers to a wide range of questions, from simple queries to complex problems. One of the key benefits of the ChatGPT XBlock is that it can be trained to focus only on the course subject. In other words, ChatGPT will only answer questions related to the course topic, ensuring that students receive accurate and relevant information. The component can be inserted multiple times across the course in different units, with each component being provided a unique context so that it provides answers in said context.

How to set up ABC’s ChatGPT XBlock in Open edX® Studio?

If ABC’s ChatGPT XBlock is already installed and configured in your Open edX® platform, simply add the ChatGPT XBlock via Studio > Advanced Settings > Advanced Modules List, as follows:

What does the user interface look like and what plans are there for the future?

The current version of our ChatGPT XBlock comprises a simple question and answer format. It’s possible to create new XBlocks using ChatGPT to serve specific needs, such as a chatbot format for example. Here is a quick look at the user interface and what it can do. In this instance we have provided the ChatGPT XBlock some context about the instructors who are (in this case) a group of quantum computing experts from Singapore using ABC’s ChatGPT XBlock in their Open edX® instance:

In this next instance, the learner has asked the question “Is quantum computing important?” and the ChatGPT XBlock has provided the following response:

What are the main benefits of the ChatGPT XBlock?

There are many benefits to using ChatGPT in your online courses. Here are just a few:

  1. Instant answers: With ChatGPT, you don’t have to wait for a teacher or tutor to be available. You can get answers to your questions instantly, allowing you to move forward with your learning.

  2. 24/7 availability: ChatGPT is available 24/7, so you can get help whenever you need it, no matter what time of day or night it is.

  3. Personalized learning: Because ChatGPT responds to your specific questions, it can help you tailor your learning experience to your own needs and interests.

  4. Improved retention: By providing instant answers to your questions, ChatGPT can help improve your retention of the material covered in the course.

  5. Expert answers: As ChatGPT is such an advanced technology, it is able to provide answers to complex questions. It can even write code for you. It’s like having an expert sitting right in front of you at all times.

  6. Scalability: It’s super scalable. OpenAI has different pricing structures, depending on the API being used. At the time of writing, the most advanced one costs 0.06 USD per 1000 tokens (or “words”).

Overall, we believe that the ChatGPT XBlock is a helpful feature for online courses on the Open edX® platform, as long as it is used in context. It’s an innovative way to enhance the learning experience, providing students with instant answers and personalized support. We’re excited to offer this feature to our clients and can’t wait to see the impact it has on their learning outcomes.

Is the ChatGPT XBlock open source and ready to be used by the community?

Yes! It is open source and available here:

Please read the README file for more information: chatgpt-xblock/README.md at main · abconlinecourses/chatgpt-xblock · GitHub

If you need help to set it up, we offer professional services to help you with this. Reach out to us here or use our contact form: Contact > ABC Online Courses Open edX® Service Providers

21 Likes

Well done @Dean!! Congrats to you and your team for this development. Hopefully you can get the appropriate support by Axim and the community to make this xBlock an innovative extension to the Open edX platform. Count on us for any help.

3 Likes

How is the Chat GPT trained? “It can be trained to focus only on the course subject”

1 Like

Also my question. BTW, can anyone instruct me how to use this, as I’m new to OpenEDX.

Hi Dean, can you support me with setting ChatGPT-XBlock up. I’ll pay for any fees :wink:, but I think this is a very interesting feature for our website. Our team are having some problems with setting it up tho, although we have followed the guide to setup in the GitHub repo.

Hope to hear from you soon.

Hello community!

The ChatGPT XBlock is now public here:

We’re glad to have made this contribution!

3 Likes

Thanks, @estebanetcheverry for sharing this article:

1 Like

Congrats @Dean for releasing the “avant- premiere” of a chatGPT integration for Open edX.

1 month before edX !

2 Likes

Congrats, @Dean . Do you have any guides for using this with Tutor?

Hi @nguyenntdev

Great to hear from you!

In terms of documentation all we have is the Readme file at the moment.

1 Like

Hi I tried to install but after all, I click send and nothing to reply, here is the issue

APIRemovedInV1 at /courses/course-v1:Megauni+C1+2023_11/xblock/block-v1:Megauni+C1+2023_11+type@chatgptxblock+block@f21c3f4ad88f49d2b8f0b9ca4f0668d8/handler/get_answer

You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0 - see the README at GitHub - openai/openai-python: The official Python library for the OpenAI API for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: v1.0.0 Migration Guide · openai/openai-python · Discussion #742 · GitHub

And after all when I submit

CSRF verification failed. Request aborted.

@luan.tm hi, I am also encountering the same problem. I changed this in the python code. openai ==0.28
.then “RateLimitError: You exceeded your current quota, please check your plan and billing details.” I had the problem.
Can you help me if you solved the problem?

Hey Sariaydin,
Where exactly did you change this in the code?

Edit: I have looked a bit into migrations and will attempt a fork with the following changes


Will update soon