Giter Club home page Giter Club logo

tutor-assistant's Introduction

OpenAI Math Tutor Assistant

This Node.js application utilizes the OpenAI Assistants API to create a Math Tutor assistant. It allows you to interact with the assistant by asking math-related questions and getting answers.

Prerequisites

Before running the code, ensure you have the following prerequisites installed:

  • Node.js
  • OpenAI npm (4.16.1 or later)
  • Readline npm
  • dotenv npm
  • An OpenAI API key

You may need to make sure that your Node.js version is compatible with the OpenAI npm to avoid dependency issues.

Installation

  1. Clone or download this repository to your local machine.

  2. Navigate to the project folder in your terminal.

  3. Create a .env file in the project directory and add your OpenAI API key to it:

    OPENAI_API_KEY="REPLACE WITH YOUR OPENAI API KEY HERE"
    
  4. Install the required dependencies by running the following commands:

    yarn add openai
    yarn add readline
    yarn add dotenv
    

Usage

To run the Math Tutor Assistant, execute the following command in your terminal:

node math-tutor.js

The chatbot will start and guide you through the process of asking math questions.

Configuration

The code is set up to use the GPT-4 model and the "Math Tutor" assistant by default. You can customize the assistant's behavior by modifying the code. You can change the assistant's name, instructions, and the OpenAI model used in the main function.

const assistant = await openai.beta.assistants.create({
  name: "Math Tutor",
  instructions:
    "You are a math tutor. Write and run code to answer math questions.",
  tools: [{ type: "code_interpreter" }],
  model: "gpt-4-1106-preview",
});

License

This project is licensed under the MIT License.

tutor-assistant's People

Contributors

arham-kk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.