Git Product home page Git Product logo

apollo-qa-bot's Introduction

qa-bot

A smart qa bot that can answer questions based on existing documents.

Getting Started

Prerequisites

  1. Java 17+
  2. Milvus 2.2.0+

Installation

  1. Clone this repo
  2. Execute ./build.sh
  3. Upload and unzip the generated qa-bot-x.x.x.jar to the server

Configuration

Edit the config/application.yaml

  1. Config the markdown.files.location to the directory of the markdown files
  2. Config the markdown.files.scheduleEnabled to true if you want to auto update the markdown files
  3. Config the milvus.host and milvus.port to the Milvus server
  4. Config the milvus.useZillzCloud, milvus.zillizCloudUri and milvus.zillizCloudToken if you are using Zilliz Cloud
  5. Config other parameters as needed

Edit the qa-bot.conf

  1. Config the OPENAI_API_KEY to the OpenAI API key
  2. Config the HTTP_PROXY to the proxy server if needed
export OPENAI_API_KEY=sk-************************************************
export HTTP_PROXY=http{s}://${username}:${password}@${url}:${port}

Usage

  1. Start the service: ./scripts/startup.sh
  2. Stop the service: ./scripts/shutdown.sh
  3. Check the logs: tail -f /opt/logs/qa-bot.log
  4. Manually trigger the markdown files processing: curl http://${your-server-url}:9090/markdown/load
  5. Test the QA bot via browser: http://${your-server-url}:9090

Integrate the QA bot with your website

Refer apollo pr for an example.

<html>
    <head>
      ...
    </head>
    <body>
      ...
    </body>
    <!-- add qa bot -->
    <script>
      (function() {
        var link = document.createElement('link');
        link.rel = 'stylesheet';
        link.href = 'http://${your-server-url}:9090/qa-bot.css';
        document.head.appendChild(link);

        var script = document.createElement('script');
        script.src = 'http://${your-server-url}:9090/qa-bot.js';
        script.onload = function () {
          QABot.initialize({
            "serverUrl": "http://${your-server-url}:9090/qa",
            "documentSiteUrlPrefix": "https://${your-documentation-site-prefix-url}"
          });
        };
        document.body.appendChild(script);
      })();
    </script>
</html>

apollo-qa-bot's People

Contributors

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