GithubHelp home page GithubHelp logo

maryayobami / custom-chatgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eh-mr-sk/custom-chatgpt

0.0 0.0 0.0 3.92 MB

The Repository contains code for a Custom ChatGPT built using React, Express, and Node.js. The chatbot is powered by OpenAI's text-davinci-003 language model and Custom dataset.

Home Page: https://vercel-frontend-six.vercel.app/

JavaScript 69.88% CSS 25.60% HTML 4.52%

custom-chatgpt's Introduction

ChatGPT- Custom ChatGPT Q&A system

The repository contains code for a Custom ChatGPT built using React, Express, and Node.js. The chatbot is powered by OpenAI's text-davinci-003 language model and Custom dataset.

Web Version

Deploy the chatgpt

Alt text

Web ChatBot Version

Deploy the chatbot

Alt text

Getting Started

ChatGPT is a web-based chatbot application that uses OpenAI's GPT-3 language model to generate natural language responses to user inputs. The application was developed using React, Express, and Node.js, and the OpenAI API was accessed using the @openai/ai-engine package.

The application features a clean and modern user interface, and allows users to chat with the chatbot in real time. The GPT-3 model used in the application is the text-davinci-003 model, which is one of the most advanced language models currently available, and is capable of generating human-like responses to a wide variety of prompts.

ChatGPT is designed to be easily deployable, and can be run on any system that supports Node.js and the OpenAI API. It can also be customized to fit specific use cases and domains, making it a powerful tool for developers and businesses looking to incorporate natural language processing into their applications.

Environment

Before you begin, ensure you have met the following requirements:

  1. You have installed Node.js and npm on your machine.
  2. You have an API key or other credentials for any necessary third-party services or APIs.

Pre-requisite

You'll need to have your own OpenAi apikey to operate this package. Follow these steps to get it:

  1. Go to https://beta.openai.com/
  2. Select your profile menu and go to Manage API Keys
  3. Select + Create new secret key
  4. Copy generated key

Installation

Clone the repository and follow these instructions:

Frontend

  1. git clone [email protected]:MohammadAtikurRahman/Custom-ChatGPT.git
  2. cd frontend
  3. npm install
  4. Create a .env file in the frontend directory of the project. Add your environment variables to the .env file using the following format: REACT_APP_URL=backend api end point
  5. npm start

API Request

const { Configuration, OpenAIApi } = require("openai");

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);

const response = await openai.createCompletion({
  model: "text-davinci-003",
  prompt: "I am a highly intelligent question answering bot. If you ask me a question that is rooted in truth, I will give you the answer. If you ask me a question that is nonsense, trickery, or has no clear answer, I will respond with \"Unknown\".\n\nQ: What is human life expectancy in the United States?\nA: Human life expectancy in the United States is 78 years.\n\nQ: Who was president of the United States in 1955?\nA: Dwight D. Eisenhower was president of the United States in 1955.\n\nQ: Which party did he belong to?\nA: He belonged to the Republican Party.\n\nQ: What is the square root of banana?\nA: Unknown\n\nQ: How does a telescope work?\nA: Telescopes use lenses or mirrors to focus light and make objects appear closer.\n\nQ: Where were the 1992 Olympics held?\nA: The 1992 Olympics were held in Barcelona, Spain.\n\nQ: How many squigs are in a bonk?\nA: Unknown\n\nQ: Where is the Valley of Kings?\nA:",
  temperature: 0,
  max_tokens: 100,
  top_p: 1,
  frequency_penalty: 0.0,
  presence_penalty: 0.0,
  stop: ["\n"],
});

Backend

  1. cd .. (to move to the root directory)
  2. cd backend
  3. npm install
  4. Create a .env file in the backend directory of the project. Add your environment variables to the .env file using the following format: OPENAI_API_KEY=generated key
  5. node index.js

Available Scripts

In the project directory, you can run:

npm start

Runs both the client app. Open [http://localhost:3006]

node index.js

Runs just the server app. Open [http://localhost:5000]

npm run build

Runs just for the production

custom-chatgpt's People

Contributors

mohammadatikurrahman 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.