Coder Social home page Coder Social logo

cloudbloqavi / nodejsaiassistant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xekhai/nodejsaiassistant

0.0 0.0 0.0 19 KB

A simple and easy-to-use conversational AI assistant built using Node.js, Express, and OpenAI's text completion API.

License: MIT License

JavaScript 100.00%

nodejsaiassistant's Introduction

Node.js, Express and OpenAI Conversational AI Assistant

A simple and easy-to-use conversational AI assistant built using Node.js, Express, and OpenAI's text completion API.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You'll need to have Node.js and npm (Node Package Manager) installed on your machine. You can download and install them from the official website if you don't already have them.

Installing

  1. Clone the repository to your local machine
git clone https://github.com/Xekhai/nodejsAIAssistant.git
  1. Navigate to the project directory
cd nodejsAIAssistant
  1. Install the project dependencies
npm install
  1. Create a .env file in the project root directory and add your OpenAI API key
OPENAI_API_KEY = your-openai-api-key
  1. Start the development server
node index.js

The app will now be running at http://localhost:3000.

Usage

To send a message to the AI assistant, you can make a POST request to the /converse endpoint with the message in the request body, like so:

$ curl -X POST -H "Content-Type: application/json" -d '{"message":"Hello, who are you?"}' http://localhost:3000/converse

The AI assistant will respond with a completed message, which will be returned in the response data.

Customization

This codebase provides a basic conversational AI assistant that can be customized to suit your specific needs. You can adjust the conversation context prompt, change the temperature and parameters of the text completion API, or add new endpoints to handle different types of requests.

Built With

  • Node.js - A JavaScript runtime built on Chrome's V8 JavaScript engine
  • Express - A fast, unopinionated, minimalist web framework for Node.js
  • OpenAI - An artificial intelligence research laboratory consisting of the for-profit technological company OpenAI LP and its parent company, the non-profit OpenAI Inc
  • Body-Parser - A body parsing middleware for Node.js
  • Dotenv - A zero-dependency module that loads environment variables from a .env file

Contributing

Contributions are welcome! If you have any ideas or suggestions, feel free to open an issue or create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

nodejsaiassistant's People

Contributors

cloudbloqavi avatar xekhai 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.