Git Product home page Git Product logo

chattutor2's Introduction

image

ChatTutor

Code Size Repo Size

ChatTutor is an AI-agent capable of teaching and research communications, ranging from new learners to industry professionals, undergraduates, and graduate students. We aim for ChatTutor to possess deep domain-specific, hierarchical, and trust-weighted knowledge.

Overview

GitHub last commit

License

license

ChatTutor is an educational project. It is licensed under the GNU General Public License version 3.0 (GPL-3.0), which guarantees end users the freedom to run, study, share, and modify the software.

See the LICENSE.txt file for more details.

Configuration

First, clone this repository. Then navigate to the ChatTutor folder and create an .env.yaml file which should have the following format:

env_variables:
    CHATUTOR_GCP: false
    OPENAI_API_KEY: <your_openai_api_key>

If you would like an OpenAI API key for the purposes of developing our repository, please reach out to [email protected]

The project file tree should look like this:

root_folder (named chattutor)
|- ChatTutor/
      |- ... (other files and folders)
      |- .env.yaml (the file you added)
|- db/
      |- ...
|- README.md
|- requirements.txt
|- ...

Usage

  1. Setup Virtual Environment and Install Dependencies
   python -m venv .venv       # python3 -m venv .venv
   source .venv/bin/activate  # On Windows use `venv\Scripts\activate`
   pip install -r requirements.txt

Alternatively, use docker: docker build -t chattutor .;docker run -p 5000:5000 chattutor

  1. Run the flask application
   cd ChatTutor
   python main.py
  1. Interact with ChatTutor: Open a web browser and navigate to http://127.0.0.1:5000/ to interact with the application. Use the provided interface to ask questions and receive responses based on the loaded data sources.

Components

1. Flask Application

  • File: main.py
    • Hosts a Flask application that serves various static files and handles HTTP routes.
    • The ask route facilitates interaction with the tutor module to formulate responses to user queries.
  • File: extensions.py
    • Defines the configuration for the selected database service.

2. Tutor Module

  • File: tutor.py
    • Contains core functions to interface with the OpenAI API.
    • Crafts responses based on user queries and maintains conversation context.

3. Database Interaction

  • File: database.py
    • Defines the VectorDatabase class for managing vectorized data.
    • Facilitates interaction with various database providers such as Chroma and Deeplake.
    • Manages the loading of data sources, the addition of new texts, and execution of queries.
  • File: definitions.py
    • Defines fundamental classes for data structure and parsing of the dataset.

4. Text Reading and Parsing

  • File: loader.py
    • Execute this file to generate embeddings for the dataset and upload them to a cloud-based service.
    • Utilizes reader.py to systematically parse each file in the dataset.
  • File: reader.py
    • Contains functions to read directories and parse files of varied formats (PDF, plaintext, Jupyter notebooks) into discrete text chunks.
    • Employs specialized parsing strategies for each file type.

5. Frontend Components

  • File: index.js
    • Manages user interactions on the client side.
    • Orchestrates the conversation flow, transmits user messages to the server, and refreshes the chat interface with responses.
  • File: index.html
    • Defines the graphical user interface (GUI) for the chatbot.

Contribution Guidelines

If you'd like to contribute to ChatTutor, please take a look at our contribution guidelines. We use GitHub issues for tracking requests and bugs.

Acknowledgements

MIT

ChatTutor V1 was developed by Dirk Englund for the Spring 6.2410 course "Quantum Systems Engineering" at MIT. It was further developed with Hank Stennes, Hyeongrak "Chuck" Choi, and Hunter Kemeny in the summer of 2023, and late in the summer they were joined by Aatmik Mallya, Adrian and Alexandru Ariton, and a growing team of developers organized by Hunter and a cohort of key developers.

chattutor2's People

Contributors

aatmikmallya avatar adrianariton avatar barosandu avatar berncasa avatar choihrm3 avatar dirkenglund avatar hunterkemeny avatar mitquantumai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.