A.I. Powered E-Learning Platform, openai API Integration (chatgpt-3.5-turbo) with Flask Web Development
Hello! Welcome to Learnify, your go-to-website whenever you're in need of study material and resources.
In order to use Learnify, I request you to install all the folders and files on your Desktop, and ensure that the way of encapsulation of files within their respective folders remains the same.
Now, in order to use the openai API, you'll have to head over to the learnify.py file and edit your API KEY into the space provided.
The API_KEY = '####' is to be replaced by your API KEY in this format - API_KEY = 'your_api_key'
Once this is said and done, you can head over to your command prompt and change the directory to Learnify.
Now you simply run learnify.py, which is the Flask-based application that will be portraying to you the first page of Learnify.
Now you head over to your favorite browser and type out 127.0.0.1:5000, which will lead you to your local host.
You press enter, and voila! You've made it to Learnify!
Learnify asks the user for a prompt, a topic or a subject which the user desires to learn about.
You are requested to enter the topic or a subject you are interested in, Algorithms, or Web Development, for example.
Once you're done, you simply hit 'Learn'.
What now happens is, the input from the form gets handed over to a function that I have explicitly written for making the API call. This function imports openai, and using the API KEY, starts a conversation with ChatGPT. In our case, we are asking ChatGPT to frame 'n' number of questions, and their answers on the prompt given to us by the user.
The response given back to use by ChatGPT is then sliced and diced using Python into a manner which is useful to us, which happens to be a list of dictionaries, resembling the JSON text architecture.
This response is then sent to an HTML page which finally displays all the questions and answers iteratively, thereby concluding the main function of Learnify.
Thank you for visiting Learnify, this had been its implementation so far. I am working on adding further features such as quizzes and textbook links to it, as well as incorporating Google Maps API to display the location of nearby libraries for the user.