GithubHelp home page GithubHelp logo

ai-chatbot's Introduction

Ai Chatbot API

Ai Chatbot API is a simple API powered by Google's Generative AI (Gemini) for generating conversational responses. It remembers conversation history and provides responses based on it.

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/korede456/Ai-Chatbot.git
    
  2. Navigate into the project directory:

    cd gemini-chatbot-api
    
  3. Install dependencies using npm:

    npm install
    

Usage

  • Start the server: npm start or run the app.js file
  • Use an HTTP client like Postman to interact with the API.
  • Send a POST request to http://localhost:5000/ask with the following JSON body: { "message": "Your message here"} Replace "Your message here" with the message you want to send to the chatbot.
  • The API will respond with a JSON object containing the chatbot's response: {"response": "Chatbot response here" }

Additional Notes

By default, the API listens on port 5000. You can change this by modifying the PORT variable in the .env file. The API currently only supports a single model (gemini-pro). If you want to use a different model, you'll need to modify the model parameter in the getGenerativeModel function call in app.js. Handle errors appropriately based on your application's requirements.

ai-chatbot's People

Contributors

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