Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/exceptiongroup-1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Dec 6, 2023
2 parents f54fc6c + aad7706 commit 081c38d
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 91 deletions.
31 changes: 0 additions & 31 deletions .pre-commit-config.yaml

This file was deleted.

152 changes: 95 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,97 +1,135 @@
# PROJECT NAME

# TutorAI
<div align="center">

![Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/USERNAME/REPONAME/python-package.yml)
[![codecov.io](https://codecov.io/github/USERNAME/REPONAME/coverage.svg?branch=main)](https://codecov.io/github/USERNAME/REPONAME?branch=main)
![top language](https://img.shields.io/github/languages/top/USERNAME/REPONAME)
![GitHub language count](https://img.shields.io/github/languages/count/USERNAME/REPONAME)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/CogitoNTNU/TutorAI/main.yml)
![GitHub top language](https://img.shields.io/github/languages/top/CogitoNTNU/TutorAI)
![GitHub language count](https://img.shields.io/github/languages/count/CogitoNTNU/TutorAI)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Project Version](https://img.shields.io/badge/version-0.0.1-blue)](https://img.shields.io/badge/version-0.0.1-blue)

<img src="docs/images/TutorAI.png" width="50%" alt="Cogito Image" style="display: block; margin-left: auto; margin-right: auto;">
</div>

<details>
<summary> <b> Table of Contents </b> </summary>
<ol>
<li>
<a href="#standard_python_application"> PROJECT NAME </a>
</li>
<li>
<a href="#Introduction">Introduction</a>
</li>
</li>
<li><a href="#Usage">Usage</a></li>
<li><a href="#Installation">Installation</a>
<ul>
<li><a href="#Prerequisites">Prerequisites</a></li>
<li><a href="#Setup">Setup</a></li>
</ul>
</li>
<li><a href="#Tests">Tests</a></li>
<li><a href="#license">License</a></li>
</ol>
<details>
<summary><b>📋 Table of contents </b></summary>

1. [Introduction](#introduction)
2. [Setup](#setup)
3. [Usage](#usage)
4. [Tests](#tests)
5. [Repository Structure](#repository-structure)
6. [Contributors](#contributors)
7. [License](#license)

</details>

## Introduction
TutorAI is a language agent capable of assisting with learning academic subjects. The project revolves around building an application that ingests a textbook in PDF format and facilitates efficient learning of the course material.

### Planned Features
TutorAI is designed to be an interactive and comprehensive educational tool aimed at enhancing the learning experience for users of all ages. Below are the planned features that we are excited to introduce:

* **PDF upload**: This functionality enables users to upload PDF documents directly into TutorAI. The application will integrate these documents seamlessly, allowing for an interactive and integrated learning experience.
* **Information search**: Empower your learning with the ability to conduct in-depth searches within uploaded PDFs. Whether it's a quick fact verification or a deep dive into complex topics, TutorAI makes comprehensive information access simple and efficient.
* **Learning plans**: These plans will be tailored to the user's learning pace, style, and goals, offering a structured path to mastering the subject.
* **Flashcards and Memory aids**: Enhance memory retention with our range of digital memory aids, including customizable flashcards. These interactive tools are designed to make study sessions more productive and engaging.
* **Quiz and test generation**: Automatic generation of quizzes and tests based on the material in the PDF
* **Study streaks**: This gamified element aims to motivate users to engage with their learning material regularly, making education a daily habit, and exams passed easily.

## Usage

```bash
python src/main.py
```
## Setup
To setup the project, one needs to have all the prerequisites installed. Then one needs to clone the repository, setup a virtual environment, and install the dependencies. This is described in more detail below.

## Installation
To install the PROJECT NAME, one needs to have all the prerequisites installed and set up, and follow the setup guild. The following sections will guide you through the process.
### Prerequisites
- Python 3.9 or higher

- Ensure that git is installed on your machine. [Download Git](https://git-scm.com/downloads)
- Ensure Python 3.9 or newer is installed on your machine. [Download Python](https://www.python.org/downloads/)
- Familiarity with basic Python package management and virtual environments is beneficial.

### Setup
1. Clone the repository
### Clone the repository
```bash
git clone https://github.com/USERNAME/REPONAME.git
cd PROJECT NAME
git clone https://github.com/CogitoNTNU/TutorAI.git
cd TutorAI
```
2. Create and run a virtual environment (optional but recommended).

Create the virtual by running the following command.
```bash
python -m venv venv
```
To use the virtual environment run the following command
#### On Windows:
### Virtual Environment (Recommended)

<details>
<summary><strong>🚀 A better way to set up repositories </strong></summary>

A virtual environment in Python is a self-contained directory that contains a Python installation for a particular version of Python, plus a number of additional packages. Using a virtual environment for your project ensures that the project's dependencies are isolated from the system-wide Python and other Python projects. This is especially useful when working on multiple projects with differing dependencies, as it prevents potential conflicts between packages and allows for easy management of requirements.

1. **To set up and use a virtual environment for TutorAI:**
First, install the virtualenv package using pip. This tool helps create isolated Python environments.
```bash
source venv/Scripts/activate
pip install virtualenv
```
#### On macOS and Linux:

2. **Create virtual environment**
Next, create a new virtual environment in the project directory. This environment is a directory containing a complete Python environment (interpreter and other necessary files).
```bash
source venv/bin/activate
python -m venv venv
```

3. Install the required packages
4. **Activate virtual environment**
To activate the environment, run the following command:
* For windows:
```bash
source ./venv/Scripts/activate
```

* For Linux / MacOS:
```bash
source venv/bin/activate
```
</details>

### Install dependencies
With the virtual environment activated, install the project dependencies:
```bash
pip install -r requirements.txt
```
The requirements.txt file contains a list of packages necessary to run TutorAI. Installing them in an activated virtual environment ensures they are available to the project without affecting other Python projects or system settings.

### Create a .env file
For secure and efficient management of environment-specific variables, TutorAI utilizes a `.env` file. This file is used to store sensitive information, such as API keys, which should not be hard-coded into the source code or shared publicly. The `.env` file is particularly crucial for maintaining the confidentiality of your API keys and other sensitive data.

**Important:** The `.env` file should never be committed to version control (e.g., GitHub). Always include `.env` in your `.gitignore` file to prevent accidental upload of sensitive information.

4. Create a file called `.env` in the root directory of the project. Add the following lines to the file:
#### Steps to Create and Configure the .env File:

1. **Create the .env File:**
In the root directory of the project, create a new file named `.env`. This file will be used to store environment variables.
```bash
touch .env
```

2. **Add Environment Variables:**
```bash
echo "API_KEY=YOUR_API_KEY" > .env # Remember to change YOUR_API_KEY to your actual API key
```

3. **Obtaining an API Key:**
If you don't have an API key from OpenAI, you can obtain one by visiting [OpenAI API Keys](https://platform.openai.com/api-keys). Follow their instructions to generate a new API key.

By following these steps, you'll ensure that your application has all the necessary environment-specific configurations, while keeping sensitive data secure and out of version control.


## Usage
To run the project, run the following command in the root directory of the project:
```bash
touch .env
echo "SECRET=SECRET_VALUE" > .env # Remember to change SECRET_VALUE to your actual key
python main.py
```

## Tests
To run all the tests, run the following command in the root directory of the project:
```bash
pytest --cov
coverage html # To generate a coverage report
pytest
```

If you do not want to run api tests, run the following command instead:
```bash
pytest -m "not apitest" --cov
pytest -m "not apitest"
```

### License
## License
Licensed under the [MIT License](LICENSE). Because this is a template repository, you need to change the license if you want to use it for your own project.

Empty file added course_materials/.gitkeep
Empty file.
Binary file added docs/images/TutorAI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
colorama==0.4.6
coverage==7.3.1
coverage==7.3.2
exceptiongroup==1.2.0
iniconfig==2.0.0
packaging==23.1
packaging==23.2
pluggy==1.3.0
pytest==7.4.2
pytest==7.4.3
pytest-cov==4.1.0
tomli==2.0.1

0 comments on commit 081c38d

Please sign in to comment.