Code Monkey home page Code Monkey logo

ai_chatbots's Introduction

ai_chatbots

Ai based chatbot with a dashboard thats hosted in Amazon Amplify right now, the URL is: https://dev.d22t33og3k5tju.amplifyapp.com/. Its username, password protected for security reasons.

Chat example

app

  • This is the ai chatbot component written in vite + React JS.

  • To run please move to the app/ folder and use command

npm install
npm run dev 
  • Uses Openai API for providing the intelligence for the chatbot

  • The chatbot has been supplied with the following context informations,

[
    {
      name: "Organic Apples",
      category: "Fresh Produce",
      price: 2.99,
      origin: "Germany"
    },
    {
      name: "Whole Grain Bread",
      category: "Bakery",
      price: 1.49,
      origin: "Local Bakery"
    },
    {
      name: "Free-Range Eggs",
      category: "Dairy",
      price: 3.99,
      origin: "Germany"
    },
    // Add more product details here
    {
      name: "Fairtrade Coffee",
      category: "Beverages",
      price: 4.99,
      origin: "Various"
    }
  ];

  
 "You are a REWE customer assistence agent, only reply in German. Your task is to help the answer or process the customer" + 
  "queries based on the information provided to you." + 
  " If the sentiment of the user sound negative, then please ask the user to contact [email protected] " +
  " For the details of the products Rewe sells follow the details after delimeter ### " + reweProductsString

  • Note : The chatbot has been given the following commands (via Prompt Engineering Certification done )
    • Act as a Rewe Customer assistent
    • Reply in German
    • It has been supplied 4 product informations (mentioned above)
    • It does a out of box, Sentiment analysis and redirects to [email protected] if user sound Negative
  • Note : For using the chatbot my personal OpenAI keys are being used Its not pushed as part of the repository for security reasons. For testing in local you need to set your own key in .env file under root folder ex. "/app"

AWS Amplify

Amplify seem to be a perfect match for hosting the vite + React JS project. Needed to be public hosted for flexible demo purposes, also for learning purpose. We followed following simple steps

  • configured amplify CLI by following docs
  • inside root path /app used command ´Amplify init´. Everything else is default except the Source Directory Path, Distribution Directory Path is set to ´dist´ because thats how vite builds the project.
  • Authentication method: AWS Profile
  • after init is done successfully we need the following steps
 amplify add hosting
✔ Select the plugin module to execute · Hosting with Amplify Console (Managed hosting with custom domains, Continuous deployment)
? Choose a type Manual deployment
  • followed by ´amplify publish´. This will automatically create a URL for accessing the hosted app.
  • Amplify automatically creates S3 buckets for the static files etc. This costs money though Amplify is free.
  • Alternate deployment method using Github tutorial, would be easy to enable CI.

Getting started with Amplify How to configure CLI

ai_chatbots's People

Contributors

haramoz avatar

Stargazers

 avatar

Watchers

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