Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exam Generator

This REST API is designed to be consumed by a UI app in order to allow a user to upload a file which is read by an AI that generates an entire exam with multiple choice questions and answers

Run the REST API's Swagger page

You can run this directly in VSCode or from a terminal and go to it's Swagger UI to see it in action (you can also call the REST API from Postman):

http://127.0.0.1:8000/docs

Press "Try it out"

image

Choose your text file with the information you'd like to create your multiple choice exam

The example in this repo is a selection of pages from the Washington state drivers manual that shows the new information changed in this version of the manual.
image

Press "Execute"

image

Returns the exam in JSON format

One nice feature of Mistral is that you can easily train it to return responses already formatted in JSON so there's no need to use a json formatter or wrapper.
As you can see, based on the provided text and no other information, it creates a list of questions each with the correct answer and additional "correctly" incorrect answers as alternatives, including multiple correct answers such as "A and B".
This allows the UI to easily consume the data in order to create or modify the exam. image

Built with Python, FastAPI, and Mistral

You'll need to install the following:

pip install mistralai fastapi uvicorn python-multipart  

Go to the mistral-ai.com site in order to create your api key and store it in a "MISTRAL_API_KEY" environmental variable on your computer.

Enjoy!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages